adduser brad
gpasswd -a brad sudo
sudo usermod brad -aG www-data
su brad
mkdir ~/.ssh
vim ~/.ssh/authorized_keys
add key etc.
sudo find /var/www -type d -print -exec chmod 775 {} \;
sudo find /var/www -type f -print -exec chmod 644 {} \;
sudo chown -R yourname:yourgroup *
.ssh/config
Host bradleyflood
Hostname bradleyflood.com
User brad
chmod 700 ~/.ssh
chmod 600 ~/.authorized_keys
scp /path/to/image.jpg [email protected]:/var/www/bradleyflood.com/html/img/_private
sudo service apache2 restart
a2ensite /etc/apache2/sites-available/bradleyflood.com.conf
a2dissite 000-default.conf
etc.
curl -v --silent http://www.bradleyflood.com/ 2>&1 | grep 'crazyegg'
- curl https://example.com/ -k -v
ln -s /path/to/source/file /path/and/name/of/symlink
- Eg
ls -s ~/www/dev/project /MyProjectShortcut
gzip -c path/to/file | wc -c
zip -r www.zip /var/www
unzip www.zip
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./dev-https.key -out ./dev-https.crt -subj "/CN=local.bradleyflood.com"
Enable debug: export GIT_TRACE=true
Easily push new branches by:
git config --global push.default current
git push -u
(or fishpush
byabbr -a push 'git push -u'
:)
mysql -u db_user -p -h mydb.myaccount.ap-southeast-2.rds.amazonaws.com db_name