documents/dev/SSH cheat sheet.md
Table of Contents
SSH cheat sheet
Append to remote file
cat index.html | ssh dominick@dominickpham.com 'cat >> /home/dominick/test.txt'
rsync watch
ODESZA_PATH_LOCAL='/Users/dominip/Work/odesza/'
ODESZA_PATH_REMOTE='ubuntu@52.38.67.205:/home/ubuntu/server/'
ODESZA_PATH_AWS_KEY='ssh -i ~/Drive/AMZN/aws-odezsa.pem'
ODESZA_FS_LATENCY='1'
alias rsodesza='rsync -avz --exclude=node-sass/ --exclude=.git/ -e "$ODESZA_PATH_AWS_KEY" --progress $ODESZA_PATH_LOCAL $ODESZA_PATH_REMOTE --delete'
alias rswodesza='rsodesza; fswatch -r -l $ODESZA_FS_LATENCY $ODESZA_PATH_LOCAL | while read f; do rsodesza; done'
alias reloadodesza='rsodesza && odesza "source /home/ubuntu/.nvm/nvm.sh; pm2 restart 0"'
through files, write empty
for FILE in *.sync.js; do echo "" >| $FILE; done
chmod files and folders
For files
sudo find ./ -type f -exec chmod 644 {} \;
For folders
sudo find ./ -type d -exec chmod 755 {} \;