This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'rails', '3.2.8' | |
gem 'pg' | |
gem 'retryable-rb' | |
gem 'mime-types', :require => 'mime/types' | |
gem 'nokogiri' | |
gem "newrelic_rpm" | |
gem "addressable" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@precise64:~/openresty$ sudo docker rm purple_chicken | |
Error: Cannot destroy container purple_chicken: stat /var/lib/docker/containers/5509334f5b65bb61aba0a03109942137a76973078ed04e66fef4d80467a66fa1/rootfs: stale NFS file handle | |
vagrant@precise64:~/openresty$ sudo ls -l /var/lib/docker/containers/5509334f5b65bb61aba0a03109942137a76973078ed04e66fef4d80467a66fa1/ | |
ls: cannot access /var/lib/docker/containers/5509334f5b65bb61aba0a03109942137a76973078ed04e66fef4d80467a66fa1/rootfs: Stale NFS file handle | |
total 32 | |
-rw------- 1 root root 2661 Nov 1 21:39 5509334f5b65bb61aba0a03109942137a76973078ed04e66fef4d80467a66fa1-json.log | |
-rw-r--r-- 1 root root 1627 Nov 1 21:39 config.json | |
-rw-r--r-- 1 root root 4197 Nov 1 21:39 config.lxc | |
-rw-r--r-- 1 root root 83 Nov 1 21:39 hostconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@precise64:~/docker-registry$ docker ps | |
ID IMAGE COMMAND CREATED STATUS PORTS | |
vagrant@precise64:~/docker-registry$ docker run -d -p :5000 samalba/docker-registry | |
1e7136e663a6 | |
vagrant@precise64:~/docker-registry$ docker ps | |
ID IMAGE COMMAND CREATED STATUS PORTS | |
1e7136e663a6 samalba/docker-registry:latest /bin/sh -c cd /docke 2 seconds ago Up 1 seconds 49156->5000 | |
vagrant@precise64:~/docker-registry$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@precise64:~$ docker ps | |
ID IMAGE COMMAND CREATED STATUS PORTS | |
274ebe0573de sinatrademo:latest /bin/bash 3 minutes ago Up 3 minutes 49158->4567 | |
vagrant@precise64:~$ wget localhost:49158 | |
--2013-06-23 12:36:41-- http://localhost:49158/ | |
Resolving localhost (localhost)... 127.0.0.1 | |
Connecting to localhost (localhost)|127.0.0.1|:49158... connected. | |
HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers. | |
Retrying. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_memory_usage | |
memory_usage = `ps -p #{Process.pid} -o rss=`.chomp | |
puts "Memory usage: #{memory_usage}" | |
end | |
print_memory_usage | |
a = ['a'] * 10000000 | |
print_memory_usage | |
a = nil | |
GC.start | |
print_memory_usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
- Unfortunately, Microsoft has added a clever new | |
- "feature" to Internet Explorer. If the text of | |
- an error's message is "too small", specifically | |
- less than 512 bytes, Internet Explorer returns | |
- its own error message. You can turn that off, | |
- but it's pretty tricky to find switch called | |
- "smart error messages". That means, of course, | |
- that short error messages are censored by default. | |
- IIS always returns error messages that are long |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Date | |
# Samples a random time | |
# | |
# Parameters | |
# This takes up to three parameters, that is a range of `years`, `months` and | |
# `days`. Each defining the boundries of the sample date. | |
# | |
# Examples | |
# `Time.random({ years: 1..2 })` will produce a date between one and two |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/fesplugas/rbenv-installer/ | |
https://github.com/sstephenson/ruby-build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
rubyversion=1.9.2-p290 | |
rubysrc=ruby-$rubyversion.tar.bz2 | |
checksum=096758c3e853b839dc980b183227b182 | |
destdir=/tmp/install-$rubyversion | |
sudo apt-get -y install libssl-dev | |
gem list -i fpm || sudo gem install fpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef rake | |
if [[ -f Rakefile ]]; then | |
sum=`md5 -q Rakefile **/*.rake | md5` | |
if [[ ! -f .rake_tasks.$sum~ ]]; then | |
rake -s --tasks | cut -d ' ' -f 2 > .rake_tasks.$sum~ | |
fi | |
compadd $(cat .rake_tasks.$sum~) | |
fi |