Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh Kraemer joshkraemer

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am joshkraemer on github.
  • I am joshkraemer (https://keybase.io/joshkraemer) on keybase.
  • I have a public key ASCllDHLpiNl7sf_chuJShruHKSGXrghWfMQPMfTHuWfiQo

To claim this, I am signing this object:

@joshkraemer
joshkraemer / upgrade_pg.sh
Last active Aug 29, 2015 — forked from ibussieres/upgrade_pg.sh
Upgrade from Postgres 9.1 to 9.3 on Ubuntu 14.04
View upgrade_pg.sh
echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 postgresql-contrib-9.3 -y
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS hstore;'"
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'"
sudo su - postgres -c "service postgresql stop"
sudo su - postgres -c '/usr/lib/postgresql/9.3/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.3/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.3/main/ -O "-c config_file=/etc/postgresql/9.3/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"'
@joshkraemer
joshkraemer / gist:2719249
Last active Oct 4, 2015
MySQL and MAMP Installation
View gist:2719249
Here are the steps on how to get MySQL working with MAMP and Rails Projects:
Note: If you already have MAMP installed and you update the mysql2 gem, you'll need to run steps 4-6 to change the gem version that is linked to MAMP.
1.) Download and install MAMP (if it's not already installed) - http://www.mamp.info/downloads/releases/MAMP_PRO.zip
2.) Add these lines to your .bash_profile file. Be sure to remove any existing lines that reference MAMP.
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
export PATH="/Applications/MAMP/Library/bin:$PATH"
@joshkraemer
joshkraemer / .bash_profile
Created Feb 22, 2012
AWS Local Machine Bash Configuration
View .bash_profile
# Load Amazon EC2 API tools
source ~/.ec2/setup_env.sh
@joshkraemer
joshkraemer / useful-terminal.sh
Created Feb 8, 2012
Useful Terminal Commands
View useful-terminal.sh
# Recursively find all files named config and replace a string using sed. The -i flag requires a blank suffix '' to work on Mac.
find . -name config -type f -print | xargs sed -i '' 's/git@github.com:CollegePlus/git@github.com:collegeplus/g'
# Recursively find all files with a certain file extension and replace a string using perl.
find . -name "*.fileext" -print | xargs perl -i -p -e 's/STRINGTOFIND/STRINGTOREPLACE/g'
# Display filesystem of mounted volumes
df -T | awk '{print $1,$2,$NF}' | grep "^/dev"
# Recursively force files lowercase with rename
@joshkraemer
joshkraemer / unicorn
Created Feb 7, 2012
Unicorn init.d script
View unicorn
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: unicorn initscript
# Description: unicorn
### END INIT INFO
@joshkraemer
joshkraemer / mime.types
Created Oct 31, 2011
Nginx Configuration Optimized for Unicorn Rails Apps
View mime.types
# /etc/nginx/mime.types
# Global Nginx mime.types file
types {
text/html html htm shtml;
text/css css;
text/xml xml rss;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
You can’t perform that action at this time.