Skip to content

Instantly share code, notes, and snippets.

View armiller's full-sized avatar

Anthony Miller armiller

  • Linkedin
  • Sunnyvale, CA
View GitHub Profile
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
man "$@"
@armiller
armiller / test.rb
Last active September 7, 2016 14:34
Recursive test for node attributes
require 'chef/sugar'
def loop_hash(hash, keys = [], &block)
hash.each do |k, v|
if v.is_a?(Hash)
loop_hash(v, keys.push(k), &block)
keys.pop
elsif block
p = keys << k
yield(p.clone, v)
@armiller
armiller / .bashrc
Last active July 20, 2016 23:18
test kitchen remote
alias kitchen='$HOME/git/chef-repo/osuosl-cookbooks/workstation/files/default/kitchen/bin/kitchen'
export KITCHEN_GLOBAL_YAML='$HOME/git/chef-repo/osuosl-cookbooks/workstation/files/default/kitchen/kitchen.global.yml'
@armiller
armiller / recipe.rb
Created March 25, 2016 19:35
install packages from file
::File.open('/root/packages', 'r') do |f|
f.each_line do |l|
package l.strip
end
end
@armiller
armiller / unicorn.rb
Created March 23, 2016 18:17
Example unicorn configuration file
# set path to application
app_dir = File.expand_path("../..", __FILE__)
shared_dir = "#{app_dir}/shared"
working_directory app_dir
# Set unicorn options
worker_processes 2
preload_app true
timeout 30
@armiller
armiller / gist:da6ec42f11bb89be5602
Last active September 16, 2015 23:59
git aware prompt
export GITAWAREPROMPT=/home/armiller/.bash/git-aware-prompt
source "${GITAWAREPROMPT}/main.sh"
export PS1="\${debian_chroot:+(\$debian_chroot)}\[\033[01;32m\]\u@workstation\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'tpope/vim-fugitive'
"Plugin 'tpope/vim-endwise'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/nerdcommenter'
@armiller
armiller / .bash_profile
Created June 23, 2015 13:40
mac .bash_profile
homebrew=/usr/local/bin:/usr/local/sbin
export PATH=$homebrew:$PATH
#ruby=/usr/local/opt/ruby/bin
export PATH=$PATH:/usr/local/opt/go/libexec/bin:/Users/Knifeninjas/Library/Haskell/bin
##
# Your previous /Users/Knifeninjas/.bash_profile file was backed up as /Users/Knifeninjas/.bash_profile.macports-saved_2012-10-17_at_21:40:28
##
if [ -f ~/.bashrc ]; then
{
"Prompt Before Closing 2" : 2,
"Selected Text Color" : {
"Green Component" : 0.5624475,
"Red Component" : 0.4779736,
"Blue Component" : 0.5573205
},
"Rows" : 100,
"Ansi 11 Color" : {
"Green Component" : 0.4205398,
@armiller
armiller / .bashrc
Created June 23, 2015 13:37
Mac .bashrc
export CLICOLOR='1'
function irc () {
ssh -t truth "screen -dr"
}
#export PATH=/usr/local/bin:$PATH
NORMAL="\[\e[0m\]"