Skip to content

Instantly share code, notes, and snippets.

View rapind's full-sized avatar

Dave Rapin rapind

View GitHub Profile
@rapind
rapind / install_wale.sh
Last active December 3, 2016 21:06
Install WAL-E on Ubuntu 14.04 LTS
sudo apt-get install libevent-dev python-all-dev daemontools lzop pv postgresql-client python-pip
sudo pip install wal-e
# There's an issue with Ubuntu 14.04 and wall-e where you need to upgrade six.
# Not sure why.
sudo pip install --upgrade six
# Replace access_key and secret_access_key with your AWS keys.
# Replace project-name with your bucket name.
sudo mkdir -p /etc/wal-e.d/env
@rapind
rapind / user_policy.json
Last active August 29, 2015 14:12
S3 Bucket Access for User
{
"Statement": [
{
"Action": "s3:*",
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::project-name",
"arn:aws:s3:::project-name/*"
]
}
@rapind
rapind / remote-pairing-step-5.sh
Last active August 29, 2015 14:11
Remote Pairing Setup - Step 5
# Launch a shared tmux session.
wemux
@rapind
rapind / remote-pairing-step-4.sh
Last active August 29, 2015 14:11
Remote Pairing Setup - Step 4
# Install wemux
sudo git clone git://github.com/zolrath/wemux.git /usr/local/share/wemux
sudo ln -s /usr/local/share/wemux/wemux /usr/local/bin/wemux
sudo cp /usr/local/share/wemux/wemux.conf.example /usr/local/etc/wemux.conf
# Change the host_list value to your pair usernames (change to your usernames)
sudo vim /usr/local/etc/wemux.conf
host_list=(dave dayton)
# Save and quit (:wq)
@rapind
rapind / remote-pairing-step-3.sh
Last active August 29, 2015 14:11
Remote Pairing Setup - Step 3
# Copy your shh key to the server
scp ~/.ssh/id_rsa.pub dave@198.199.xx.x:
# Login to your account
ssh dave@198.199.xx.x
# Enable ssh access using your rsa key
mkdir .ssh
mv id_rsa.pub .ssh/authorized_keys
@rapind
rapind / remote-pairing-step-2.sh
Last active August 29, 2015 14:11
Remote Pairing Setup - Step 2
# Create our pair users
# You'll want to substitude your own usernames for dave and dayton
adduser dave
adduser dayton
# Add them to the sudo group
usermod -a -G sudo dave
usermod -a -G sudo dayton
@rapind
rapind / remote-pairing-step-1.sh
Last active August 29, 2015 14:11
Remote Pairing Setup - Step 1
# Log into your VPS and enter the provided password when prompted.
ssh root@[YOUR VPS IP]
# Update the system. This will take a little while to complete.
apt-get update
apt-get safe-upgrade
# Install essential build tools, git, tmux, vim, and fail2ban.
apt-get install build-essential git tmux vim fail2ban
@rapind
rapind / test.html
Last active August 29, 2015 14:08
Tell the parent frame your size after loading.
<script>
window.onload = function() {
parent.postMessage('height:' + document.body.scrollHeight, "*");
};
</script>
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC2EG5UiCIn4e/iECf3K5IwJsXwtSz0qZ1fXXlvUVvF4hHfsWOeX4vXqtX4jLiu1h1Zpyqa0bJeXtkQDF3U/aT+Ez/Y6qBBo5ONdkAsNHWdmYvfkcQ+HBCd3HSd3nGjR1xTShZbEWakCt/yO+tSw7HWgIgQYVPJ+kHvfkBvw10Z7aLc3+WM0Hg8BmQIl6YKLKzhEQjdq1x81Q6OKMO5Vqmb61eE8TSr+ISEqzUjg9gAkT3qyF0CegXw0b3/wIpvhtCpYh9QpWi87JqMfWqNvARH4ciIcj+T/6HeB+aOVhtYv5Q+X84GcyNBErbYqFfzbomAgeqzv2Ag+kIUfNrJSfwF rapind@rapindesk
@rapind
rapind / spirals_on_a_plane.rb
Last active December 22, 2015 11:59
Recursion is so 2012.
# The only true solution to the "Turn this array into a snake" test.
class Array
def motherfucking_spiral
[ 1, 2, 3, 4,
12, 13, 14, 5,
11, 16, 15, 6,
10, 9, 8, 7 ]
end
end