Docker Cheat Sheet
NOTE: 534 stars, 106 forks. I love you all. Please contribute tips and edits back to this cheat sheet -- email's will.sargent@gmail.com and you can treat gists like git repositories and send git diffs.
desc "show changelog" | |
task :changelog do | |
latest = `git tag |tail -1`.chomp | |
system "git log --pretty=format:'* %s %b [%an]' #{latest}..HEAD" | |
end |
git merge #{from_branch} -s recursive -X theirs --commit -m 'merge #{from_branch} to #{rails_env}' |
NOTE: 534 stars, 106 forks. I love you all. Please contribute tips and edits back to this cheat sheet -- email's will.sargent@gmail.com and you can treat gists like git repositories and send git diffs.
# IE is still braindead so still use favicon.ico | |
convert -resize x16 -gravity center -crop 16x16+0+0 -flatten -colors 256 input.png output-16x16.ico | |
convert -resize x32 -gravity center -crop 32x32+0+0 -flatten -colors 256 input.png output-32x32.ico | |
convert output-16x16.ico output-32x32.ico favicon.ico | |
# Then, HTML needs to specify size="XxY" as largest size due to browser bugs | |
<link rel="shortcut icon" href="/favicon.ico" sizes="32x32"> |
$ orchard hosts create | |
Orchard username: nateware | |
Password: | |
Default host running at 107.170.120.216 | |
$ orchard docker ps | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
$ orchard docker run ubuntu echo hello world |
# Create vagrant image | |
vagrant init ubuntu12_64 http://files.vagrantup.com/precise64.box | |
vagrant up | |
vagrant ssh | |
# Fork aws/opsworks-cookbooks on github | |
# https://github.com/aws/opsworks-cookbooks | |
# Clone locally | |
git clone git@github.com:yourusername/opsworks-cookbooks.git | |
cd opsworks-cookbooks |
hadoop fs -rmr temp | |
MAHOUT_HOME/bin/mahout org.apache.mahout.cf.taste.hadoop.similarity.item.ItemSimilarityJob --input ~/Workspace/beerstats/beer-ratings-by-userid.csv --output ratings-pearson --similarityClassname SIMILARITY_PEARSON_CORRELATION | |
hadoop jar mahout-examples-0.8-job.jar org.apache.mahout.cf.taste.hadoop.item.RecommenderJob --input ~/Workspace/beerstats/beer-ratings-by-userid.csv --output beer-ratings --similarityClassname SIMILARITY_LOGLIKELIHOOD --maxSimilaritiesPerItem 50 | |
import boto | |
from boto.dynamodb.exceptions import * | |
from boto.dynamodb.batch import * | |
import pprint | |
class Leaderboard: | |
def __init__(self, game_mode): | |
self.conn = boto.connect_dynamodb() | |
self.table = self.conn.get_table("leaderboard_" + game_mode) |
#!/usr/bin/env python | |
# Compare a file on S3 to see if we have the latest version | |
# If not, upload it and invalidate CloudFront | |
import fnmatch | |
import os | |
import boto | |
import pprint | |
import re |
# Ruby/Sinatra ELB health check example - GET /healthchk | |
get '/health' do | |
# any DB connection errors below will throw exceptions | |
Timeout.timeout(5) do | |
nkeys = Redis.current.dbsize | |
status = DB.fetch("show engine innodb status").first[:Status] | |
end | |
end |