Follow instructions from here https://github.com/behackett/presentations/blob/master/pycon_2012/Lesson%201.0.pdf
https://docs.mongodb.com/v3.2/tutorial/install-mongodb-on-os-x/
$ which mongod
/opt/mongodb/bin/mongod
| import boto3 | |
| # Enter the region your instances are in, e.g. 'us-east-1' | |
| region = 'eu-west-1' | |
| # Enter your instances here: ex. ['X-XXXXXXXX', 'X-XXXXXXXX'] | |
| instances = ['i-21d32eac', 'i-08a54cc8'] |
Follow instructions from here https://github.com/behackett/presentations/blob/master/pycon_2012/Lesson%201.0.pdf
https://docs.mongodb.com/v3.2/tutorial/install-mongodb-on-os-x/
$ which mongod
/opt/mongodb/bin/mongod
| # cat /etc/os-release | |
| NAME="Amazon Linux AMI" | |
| VERSION="2015.09" | |
| ID="amzn" | |
| ID_LIKE="rhel fedora" | |
| VERSION_ID="2015.09" | |
| PRETTY_NAME="Amazon Linux AMI 2015.09" | |
| ANSI_COLOR="0;33" | |
| CPE_NAME="cpe:/o:amazon:linux:2015.09:ga" | |
| HOME_URL="http://aws.amazon.com/amazon-linux-ami/" |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "Stmt1470826626000", | |
| "Effect": "Allow", | |
| "Action": [ | |
| "sqs:ListQueues", | |
| "sqs:GetQueueAttributes", | |
| "sqs:ReceiveMessage" |
| --- | |
| - hosts: "tag_role_webserver:&tag_env_{{env}}" | |
| become: true | |
| vars_files: | |
| - "../vars/env_{{env}}.yml" | |
| - "../vars/secure_{{env}}.yml" | |
| - "../vars/env_{{env}}_splunk.yml" | |
| vars: | |
| ansible_role: "webserver" | |
| datadog_api_key: "<key>" |
| $ vim ~/.bashrc | |
| ## Ansible | |
| export AWS_ACCESS_KEY_ID='AWS_ACCESS_KEY_ID' | |
| export AWS_SECRET_ACCESS_KEY='AWS_SECRET_ACCESS_KEY' | |
| export ANSIBLE_HOSTS=/<dir>/ec2.py | |
| export EC2_INI_PATH=/<dir>/ec2.ini | |
| export ANSIBLE_CONFIG=/<dir>/ansible.cfg | |
| export ANSIBLE_SSH_CONTROL_PATH='~/.ssh/%%h-%%r' |
| $ pm2 startup ubuntu | |
| [PM2] You have to run this command as root. Execute the following command: | |
| sudo su -c "env PATH=$PATH:/opt/node-v4.3.1-linux-x64/bin pm2 startup ubuntu -u jenkins --hp /home/jenkins" | |
| Now run the command as root as it says here http://pm2.keymetrics.io/docs/usage/startup/. | |
| Then run | |
| $ pm2 save |
| $ vim ~/.ssh/config | |
| ### | |
| Host *.sunrise-dev.local | |
| user mezbaur | |
| ProxyCommand ssh -q -A mezbaur@cd_bstn nc %h %p | |
| IdentityFile ~/.ssh/mezbaur | |
| LogLevel QUIET | |
| StrictHostKeyChecking no |
| # http://boto.readthedocs.org/en/latest/sqs_tut.html | |
| # my aws settings | |
| AWS_ACCESS_KEY_ID='' | |
| AWS_SECRET_ACCESS_KEY='' | |
| # creating my example queue | |
| import boto.sqs | |
| conn = boto.sqs.connect_to_region("eu-west-1", aws_access_key_id=AWS_ACCESS_KEY_ID, aws_secret_access_key=AWS_SECRET_ACCESS_KEY) | |
| q = conn.create_queue('david-test') |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |