start new:
tmux
start new with session name:
tmux new -s myname
| # http://aws.amazon.com/amazon-linux-ami/ | |
| # http://aws.amazon.com/amazon-linux-ami/faqs/ | |
| # Boot up a machine with at least 1.5 to 2 GB Ram | |
| # login | |
| chmod 600 key.pem | |
| ssh -i key.pem [email protected] | |
| # update |
This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)
Sister Document - Restore MySQL from Amazon S3 - read that next
this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc
| #!/bin/bash | |
| # from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
| # and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
| ############################################### | |
| # To use: | |
| # wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh | |
| # chmod 777 install-redis.sh | |
| # ./install-redis.sh | |
| ############################################### | |
| echo "*****************************************" |
##Auto-deploy with php and github on an Ubuntu Amazon EC2 box
Fork from other gist Build auto-deploy with php and git(hub) on an EC2 AMAZON AMI instance - Covers a basic Ubuntu isntall
When ever it says www-data below, it's the user Apache runs under. So if your apache user is called something else, change it to that.
##Install git
sudo aptitude install git-core
| from time import strftime,gmtime,time | |
| import urllib2 | |
| import hmac | |
| import hashlib | |
| import base64 | |
| import string | |
| def publishAmazonSnsMsg(Subject,TopicArn,Message,AWSAccessKeyId,privatekey): | |
| #http://docs.amazonwebservices.com/AWSSimpleQueueService/2008-01-01/SQSDeveloperGuide/ | |
| amzsnshost = 'sns.us-east-1.amazonaws.com' |
| function Value(value) { | |
| switch (typeof value) { | |
| case "number": return {N: String(value)} | |
| case "string": return {S: value} | |
| } | |
| if (value) switch (typeof value[0]) { | |
| case "number": return {NS: value.map(String)} | |
| case "string": return {SS: value} | |
| } |
| # Create your superuser | |
| $ mongo | |
| > use admin | |
| > db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]}) | |
| > exit | |
| # Alias for convenience (optional and at your own risk) | |
| $ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile | |
| $ source ~/.bash_profile |
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: redis-server | |
| # Required-Start: $syslog | |
| # Required-Stop: $syslog | |
| # Should-Start: $local_fs | |
| # Should-Stop: $local_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: redis-server - Persistent key-value db |