Skip to content

Instantly share code, notes, and snippets.

View newhavengill's full-sized avatar

Justin Gill newhavengill

View GitHub Profile
@newhavengill
newhavengill / TripleDESTest.java
Created May 2, 2012 03:47
Simple TripleDES Encrypt/Decrypt Test
import java.security.MessageDigest;
import java.util.Arrays;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;
/**
* Simple TripleDES Encrypt/Decrypt Test
@newhavengill
newhavengill / rails-log
Created August 20, 2013 00:59
rails error. who is calling postgres? who?
$ bundle exec rails server
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/gill/.rvm/gems/ruby-1.9.2-p320/gems/bundler-1.1.4/lib/bundler/rubygems_integration.rb:147:in `block in replace_gem': Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is not part of the bundle. Add it to Gemfile.) (LoadError)
from /Users/gill/.rvm/gems/ruby-1.9.2-p320@global/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:7:in `<top (required)>'
from /Users/gill/.rvm/gems/ruby-1.9.2-p320@global/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/gill/.rvm/gems/ruby-1.9.2-p320@global/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
@newhavengill
newhavengill / jdk8-jdk7-toggle
Last active September 1, 2016 04:24
Add jdk8 and toggle between jdk7 and jdk8
## I'm running Mavericks. No Java and no Maven anymore
## Download jdk8 --> https://jdk8.java.net/download.html
## then add the following to your ~/.profile and source
export JAVA_7_HOME=$(/usr/libexec/java_home -v1.7)
export JAVA_8_HOME=$(/usr/libexec/java_home -v1.8)
export JAVA_HOME=$JAVA_7_HOME
## Command line alias so we can switch to java6 or Java7

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

I was encouraged to fork this and modify it to my heart's content to match my own needs. Thanks to @kevinelliott

Note: I manage my dotfiles and vimrc with Homeshick. My environment is hyper customized and is not for everyone's taste.

@newhavengill
newhavengill / apache2-custom.conf
Created January 2, 2015 16:51
Apache2 local config on Yosemite
# Apache configuration
#
# To install on an OS X machine do this:
#
# Open /etc/apache2/httpd.conf
# set DocumentRoot "/Users/newhavengill/www/docs"
# set <Directory "/Users/newhavengill/www/docs">
#
# To use .htaccess in each site make edit to allow all
# set AllowOverride All
@newhavengill
newhavengill / homeshick.sh
Created January 15, 2015 17:30
Set up dotfiles and vimrc
#!/bin/bash
castles="newhavengill/dotfiles"
prompt_castle() {
if [[ $2 = y ]]; then
def="[Yn]"
else
def="[yN]"
fi
@newhavengill
newhavengill / bash_profile
Last active August 29, 2015 14:24
Basic server settings
# PS1='\[\033[31m\]\w\[\033[0m\] $ '
# PS1='${debian_chroot:+($debian_chroot)}\[\e[34m\]\u\[\e[0m\]@\h:\[\e[36m\]\W\[\e[0m\]\$ '
# PS1='\n[\!] `if [ $? = 0 ]; then echo \[\e[32m\]^_^\[\e[0m\]; else echo \[\e[31m\]O.O\[\e[0m\]; fi` (\j) \[\e[36m\]\W\[\e[0m\]\n\$ ~> '
PS1='\n[\!] `if [ $? = 0 ]; then echo \[\e[32m\]^_^\[\e[0m\]; else echo \[\e[31m\]O.O\[\e[0m\]; fi` \u@\h:\[\e[36m\]\w\[\e[0m\]\n\$${debian_chroot:+($debian_chroot)} \j> '
export EDITOR=vim
alias ll='ls -l'
alias la='ls -la'
@newhavengill
newhavengill / simple-espn-parser.java
Last active December 26, 2015 21:52
Simple ESPN Video API Parser. GSON. No POJO
package com.espn.data;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o