View install_nginx_ppa.sh
# add source | |
cat >> /etc/apt/sources.list <<EOF | |
# Nginx | |
deb http://nginx.org/packages/ubuntu/ disco nginx | |
deb-src http://nginx.org/packages/ubuntu/ disco nginx | |
EOF | |
# add signing key | |
curl http://nginx.org/packages/keys/nginx_signing.key | sudo apt-key add - |
View setup-autossh-tunnel.sh
#!/bin/bash | |
# Install: | |
# curl -O https://gist.githubusercontent.com/2called-chaos/4285767/raw/setup-autossh-tunnel.sh | |
# chmod u+x setup-autossh-tunnel.sh | |
# ./setup-autossh-tunnel.sh | |
SSH_USER="mysql_tunnel" | |
SSH_SERVER="db.example.net" | |
SSH_PORT="22" |
View each_with_position.rb
################################## | |
### SCROLL DOWN FOR AN EXAMPLE ### | |
################################## | |
module Enumerable | |
# your each_with_position method | |
def each_pos &block | |
EachWithPosition.each(self, &block) | |
end | |
end |