Well – we all now how easy commands get lost – this is my list of command I sometimes need to lean on.
Crontab
crontab -e Show / modify user’s cronjobs
Git
git add . Add all changes files to commit. git checkout <branch> Checkout <branch>. git clone <url> Clone Repository git commit Commit Changes. git pull origin master Pull from master branch. git push origin master Push to master branch. git stash Stash current changes.
Laravel
php artisan key:generate Generate Application Key. php artisan make:factory <Factoryname> –model=<Modelname> Make new factory for Model. php artisan make:model <modelname> -cmr Make model and include Controller, Migration & Ressource. php artisan migrate Migrate tables. php artisan migrate:rollback Undo last migration. php artisan serve –port=<port> Serve Application on <Port>. php artisan tinker start new tinker session.
Logs
grep CRON /var/log/syslognpm run watch Check Cronjob log
npm
npm run watch watch files and auto compile on change.
mysql
GRANT ALL PRIVILEGES ON *.* TO ‘<username>’@’localhost’ IDENTIFIED BY ‘<password>’; Give new user all permissions for all tables in used database. REVOKE ALL PRIVILEGES, GRANT OPTION FROM ‘<username>’@’localhost’; Revoke all rights from user use <dbname> Change database. CREATE DATABASE ; Create database with
Virtualbox
VBoxManage startvm "<vmName>" --type headless
Start headless virtual box from Terminal
Basic Ubuntu OS Setup
sudo apt-get update;
sudo add-apt-repository ppa:phoerious/keepassxc;
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -;
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list;
sudo apt-get update;
sudo apt-get install sublime-text git-core mysql-server mysql-client libmysqlclient-dev apache2 php php7.2-mbstring php7.2-xml php7.2-soap composer filezilla keepassxc;
git config --global user.name "{{Username}}";
git config --global user.email "{{Email}}";
Bash Alias
alias gc='git commit -m'
alias gps='git push origin'
alias gpl='git pull origin'
alias gl='git log'
alias gst='git status'
alias gsh='git stash'
alias npmrw='npm run watch'
alias gb='git branch'
alias gch='git checkout'
PHP
sudo update-alternatives –config php Switch PHP Shell Version
Dualboot System
sudo ntfsfix /dev/sdb1 Fix Drive ntfs permission issues for ubuntu / win10 dualboots