Skip to content

Instantly share code, notes, and snippets.

View edjames's full-sized avatar

Ed James edjames

View GitHub Profile
@edjames
edjames / .bashrc
Created February 16, 2018 11:19
Digital Ocean .bashrc
# ~/.bashrc
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
HISTCONTROL=ignoreboth
@edjames
edjames / .bash_login
Last active February 18, 2019 16:51
Digital Ocean .bash_login
# ~/.bash_login
export PS1="\e[36;1m\]>\e[93;1m\] changeme \e[36;1m\]\W\e[0m\] "
alias d='docker'
alias dco='docker-compose'
alias da="direnv allow"
alias ..='cd ..'
@edjames
edjames / .bash_logout
Created February 16, 2018 11:13
Digital Ocean .bash_logout
# ~/.bash_logout
# when leaving the console clear the screen to increase privacy
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi
@edjames
edjames / workflow-cli
Created November 22, 2017 15:54
workflow-cli
#!/usr/bin/env ruby
require 'thor'
require 'readline'
begin
require 'tracker_api'
rescue LoadError
puts 'Please install the tracker_api gem.'
puts 'Exiting ...'
#!/bin/bash
echo "-------------------------------"
echo "Starting user-data execution..."
echo "-------------------------------"
cd /root
#
# Setup swap for better performance
### Keybase proof
I hereby claim:
* I am edjames on github.
* I am grokling (https://keybase.io/grokling) on keybase.
* I have a public key whose fingerprint is 8186 635A FD92 0FFF 896F D1B8 A55F 2A0A 4CF6 1080
To claim this, I am signing this object:
@edjames
edjames / gist:03d13a0f45987e0cf4a5
Created July 22, 2014 14:38
Multi-namespace cache handler
class MultiCache
include Singleton
attr_reader :rails_cache, :custom_cache
def initialize
@rails_cache = Rails.cache
@custom_cache = ActiveSupport::Cache::MemCacheStore.new(
'your-cache-ip-address', :namespace => 'rails4-namespace')
end
@edjames
edjames / memcached-dump.macdots_function
Last active August 29, 2015 14:01
List all keys in memcache
# .memcached-dump.macdots_function
# mac-dots custom function
# requires mac-dots version >= 0.7.5
# https://gist.github.com/edjames/9d5681d608b302dba855
# Usage:
# $> memcached-dump
memcached-dump() {
@edjames
edjames / gist:3938621
Last active October 11, 2015 23:48
Gource command for repo Star Wars
gource -1280x720 -o - --title "VZ-APP" --hide date,filenames,mouse --start-date '2014-08-01 00:00:01' --disable-bloom --logo app/assets/images/homepage/play_symbol.png --auto-skip-seconds 1 --seconds-per-day 0.25 --start-position 0.7 --font-size 6 | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 gource.mp4
gource -768x540 -o - --title "VZ-APP" --start-date '2014-08-01 00:00:01' --disable-bloom --logo app/assets/images/homepage/play_symbol.png --auto-skip-seconds 1 --seconds-per-day 0.5 --font-size 6 | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 gource.mp4
hide options: bloom,date,dirnames,files,filenames,mouse,progress,tree,users,usernames
@edjames
edjames / nginx_rails_3_1
Created February 7, 2012 11:12 — forked from shapeshed/nginx_rails_3_1
Nginx Config for Rails 3.1 with Unicorn and Asset Pipeline
upstream app {
server unix:/srv/app/current/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name www.app.com;
rewrite ^/(.*) http://app.com/$1 permanent;
}
server {