Skip to content

Instantly share code, notes, and snippets.

@coldclimate
coldclimate / gist:11288076
Last active August 29, 2015 14:00
This time last week
var last_week = new Date();
last_week.setDate(last_week.getDate() -7);
03-Jun-2014 17:02:21 Jekyll output:
03-Jun-2014 17:02:21 Configuration file: _config-live.yml
03-Jun-2014 17:02:21 Source: /home/bamboo/bamboo-agent-home/xml-data/build-dir/CAMPAIGNDIGITAL-CANDDI-GRUNT
03-Jun-2014 17:02:21 Destination: /home/bamboo/bamboo-agent-home/xml-data/build-dir/CAMPAIGNDIGITAL-CANDDI-GRUNT/_site
03-Jun-2014 17:02:21 Generating...
03-Jun-2014 17:02:21 jekyll 2.0.3 | Error: No such file or directory - /home/bamboo/bamboo-agent-home/xml-data/build-dir/CAMPAIGNDIGITAL-CANDDI-GRUNT/_site/sitemap.xml
03-Jun-2014 17:02:21 Warning: Command failed:  Use --force to continue.
03-Jun-20
### Keybase proof
I hereby claim:
* I am coldclimate on github.
* I am coldclimate (https://keybase.io/coldclimate) on keybase.
* I have a public key whose fingerprint is 8696 1302 2C89 6D7E 8E53 4256 DE45 8702 1053 08E4
To claim this, I am signing this object:
@coldclimate
coldclimate / gist:7eee74748750ab51c6e7
Created November 29, 2014 18:15
Hello World in Rails
vagrant@vagrant-ubuntu-trusty-64:/vagrant/helloworld$ history
1 sudo apt-get update
2 sudo apt-get install ruby
3 ruby -v
4 sudo apt-get install rubygems
5 gem install rails
6 sudo gem install rails (cancelled - wondered if I should use the version in the tutorial)
7 sudo gem install rails -v 4.2.0.rc1 (also failed)
8 sudo gem remove rails
9 sudo gem install rails (might as well just check)

AWS CLI Profiles

Use named profiles if you have to connect using more than one set of credencials. No more editing .aws_config http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-multiple-profiles

(sub tip: don't set a default and thus never accidentally conenct to the wrong place) aws --profile=prod ec2

Monitoring S3

There is no CloudWatch integration with S3. Roll you own by bolting together readin S3 and pushing it into CloudWatch (or other monitoring tools). Use awk to slice out the columns you are interested in.

@coldclimate
coldclimate / gist:740230020f9c8cc077b7
Created December 14, 2014 19:39
Getting @github pages to work on ubuntu 14.04 vagrant box
1 sudo apt-get update
2 sudo -i
3 gem install bundler
4 sudo gem install bundler
5 cd /vagrant/
6 vi Gemfile
7 bundler install
8 vi Gemfile
9 bundler install
10 vi Gemfile
{
'invocation': {
'module_name': u 'ec2_vpc',
'module_args': ''
},
u 'vpc_id': u 'vpc-42b1d027',
u 'changed': False,
u 'vpc': {
u 'dhcp_options_id': u 'dopt-331f0551', u 'region': u 'us-east-1', u 'cidr_block': u '10.181.208.0/22', u 'state': u 'available', u 'id': u 'vpc-42b1d027'
},
@coldclimate
coldclimate / Instructions
Created October 17, 2015 13:26
Installing Supervisord on Centos 66
Based on http://www.alphadevx.com/a/455-Installing-Supervisor-and-Superlance-on-CentOS
Vgrnt box used: https://github.com/tommy-muehle/puppet-vagrant-boxes/releases/download/1.0.0/centos-6.6-x86_64.box
sudo yum install python-setuptools
sudo easy_install supervisor
supervisord --version
echo_supervisord_conf | sudo tee /etc/supervisord.conf
sudo mkdir -p /etc/supervisord/conf.d/
sudo vi /etc/init.d/supervisord
@coldclimate
coldclimate / gist:2507f829581f9aa7220d
Created January 30, 2016 12:04
Get HAPorxy stats from the command line
# adapted from https://tech.fawk.eu/111/
echo "show stat" | nc -U /var/lib/haproxy/stats
@coldclimate
coldclimate / gist:464e6e5174d9a5ffcc6a
Created March 24, 2016 08:51
Get a list of all access keys on an AWS account
for USERNAME in `aws iam list-users | jq -r '.Users[].UserName'`
do
KEYS=$(aws iam list-access-keys --user-name $USERNAME | jq '.AccessKeyMetadata[].AccessKeyId')
echo $USERNAME, $KEYS
done