Shell Shortcuts

Toying with Permissions

$ groups – to view groups current user belongs to
$ sudo adduser <username> <groupname> – adds user to the group
$ sudo chgrp -R <groupname> <file or directory name> – changes the group owner of the file/directory
$ sudo chown -R <username>:<directoryname> <directory name> – changes the owner of the file/folder
$ sudo chmod -R XXX <foldername> – change permission for folder and everything inside it. XXX -> 755, 775, 777

TAR folder – tar -zcvf outputFileName.tar.gz folderToCompress

UNTAR folder – tar xvzf file.tar.gz

Git Shortcuts

It’s pretty useless unless if you understand how to use Git from the first place. Well, it does for me.

Create new branch based on current branch
git branch -d branchname

Push current new local branch to remote (first time only)
git push --set-upstream origin newbranchname
Note: 
origin is default name of remote fork
after the first push with this command, just use regular push

Deleting a remote branch
git push origin --delete remotebranchname

Update local list of remote branches
git remote update origin --prune
Note: if someone else has created remote branches you need to do this to update your list

How to deploy to production server with Git
https://medium.com/@francoisromain/vps-deploy-with-git-fea605f1303b

Pull remote overwrite local
git fetch –all
git reset –hard origin/master
git reset –hard origin/<branch_name>

Setting up an Ubuntu server

Quickstart

Host Setup

SSL Anyone?

Some DevOps to remember

I should’ve remembed this already. But I’m just to lazy to memorize. Forgive me.

sudo nano /etc/nginx/nginx.conf
sudo nginx -t
sudo systemctl restart nginx
sudo chown -R $USER:$USER /var/www/example.com/public_html
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/example.com.conf
sudo a2ensite test.com.conf
sudo systemctl restart apache2 /  sudo service apache2 restart

VueJS

VueJS – Progressive JS framework, focus more to View part (Front end). Created by Evan You, Google Ex-employee, released in Febuary 2014. Uses Virtual DOM (same as React) – which changes first done virtually in JS data structure first, later compared with original data structure to see if there’s changes. You read it.

Installation

npm install vue
npm run dev

Ah pandai2lah. nanti sambung