Skip to content

Instantly share code, notes, and snippets.

View rapind's full-sized avatar

Dave Rapin rapind

View GitHub Profile
@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 / 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-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-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-5.sh
Last active August 29, 2015 14:11
Remote Pairing Setup - Step 5
# Launch a shared tmux session.
wemux
@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 / 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 / postgresql.conf
Last active August 29, 2015 14:12
Update PostgreSQL archiving / WAL for WAL-E backups
# WAL-E Backups
# Goes in the bottom of your postgresql.conf
wal_level = archive
archive_mode = on
archive_command = 'envdir /etc/wal-e.d/env /usr/local/bin/wal-e wal-push %p'
archive_timeout = 60
@rapind
rapind / edit_postgresql.sh
Last active August 29, 2015 14:12
Edit postgresql.conf
sudo vi /etc/postgresql/9.3/main/postgresql.conf
@rapind
rapind / restart-postgresql.sh
Created December 26, 2014 13:32
Restart PostgreSQL
sudo service postgresql restart