1 min read

Useful Commands

A place for me to keep useful linux commands.
Useful Commands

Colour Palette

System Admin

Rename a Gcloud instance

gcloud beta compute instances set-name oldname --new-name=newname

Install PHP on Debian

sudo apt install php7.4-{fpm,sqlite,curl,bcmath,bz2,dom,intl,gd,mbstring,mysql,zip}

Install nvm and node.js on Debian

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile 
nvm install 16.13.0

Git problems with large files

git config --global http.postBuffer 157286400
💡
Connection to github.com closed by remote host.fatal: The remote end hung up unexpectedly

Copy a folder excluding a subdirectory

rsync -av --progress sourcefolder /destinationfolder --exclude thefoldertoexclude

Add colours to the root bash terminal

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

Add to the bottom of root's .bashrc to get have a red prompt.

Magento 1 SQL db import

💡
Table storage engine for 'catalog_product_relation' doesn't have this option

Replace: ROW_FORMAT=FIXED

cat magento-db-dump.sql | grep '=FIXED'
sed -ie 's/ROW_FORMAT=FIXED//g' magento-db-dump.sql

Find MySQL / MariaDB my.cnf file

mysql --help | grep /my.cnf | xargs ls