23 Jan 2012
Command | Description |
---|---|
csf -s | Start the firewall rules |
csf -f | Flush/Stop firewall rules (note: lfd may restart csf) |
cat ~/.ssh/id_rsa.pub | ssh -i aws.pem ubuntu@ip_address "cat - >> ~/.ssh/authorized_keys" |
// export | |
mysqldump -h localhost --port 3306 -u username -p"password" --routines database > dump.sql | |
// import | |
mysql -h localhost --port 3306 -u username -p"XXX" --default-character-set=utf8 database < dump.sql | |
// import with progress | |
pv dump.sql | mysql -h localhost --port 3306 -u username -p"XXX" --default-character-set=utf8 database | |
// note when using passwords with "$": escape passwords needed |
curl -k -g -X POST -d "payload={\"text\":\"my important bot notification\", \"channel\":\"#monitoring\", \"username\":\"computer-bot\", \"icon_emoji\":\":computer:\"}" https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XxXxXxXxXXXxxXXXxxx |
23 Jan 2012
Command | Description |
---|---|
csf -s | Start the firewall rules |
csf -f | Flush/Stop firewall rules (note: lfd may restart csf) |
server { | |
listen 80; | |
server_name .example.co.uk.dev; | |
access_log /usr/local/var/log/nginx/example.co.uk-access.log; | |
error_log /usr/local/var/log/nginx/example.co.uk-error.log error; | |
root /var/www/example.co.uk/public; | |
index index.php index.html; |
#!/usr/bin/env ruby | |
require 'syslog' | |
require 'net/http' | |
require 'aws-sdk' | |
Syslog.open | |
AWS.config({ | |
:access_key_id => '<iam user key>', | |
:secret_access_key => '<iam user secret>' |
rsync -ave "ssh" --rsync-path="sudo rsync" USER@REMOTE_SERVER:/remote/file/path/ /local/file/path |