This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dd if=/dev/zero of=11gb-file.bin bs=1GB count=11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module DataBagHelper | |
| #wrapper methods to insulate from change :) | |
| def node_run_list | |
| node.run_list.role_names.reverse | |
| end | |
| def current_data_bag_items |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'system_timer' | |
| class JobWrapper | |
| attr_accessor :timeout, :job, :name | |
| # slowjob1 = SlowJob.new(15,'slowjob1') | |
| # wrapper = JobWrapper.new(10,slowjob1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #http://beerpla.net/2010/06/10/how-to-display-just-the-http-response-code-in-cli-curl/ | |
| if test -z "$1" | |
| then | |
| echo "No URL provided." | |
| exit | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| varnishlog | grep RxURL | egrep -v '/(assets|images|javascripts|stylesheets)/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #example to remove PageNotFoundError from logs for cleaning up | |
| sed '/ApplicationController::PageNotFoundError (ApplicationController::PageNotFoundError):/,/^\W*$/d' production.log.cleaned.app01 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export EDITOR=/usr/bin/vim | |
| export PATH=${HOME}/scripts/git_ps_tools:${PATH} | |
| #using ReinH's ps_tools and rvm-prompt | |
| export PS1="\[\033[01;32m\]\u\[\033[00m\]\[\033[01;31m\]\$(git_br)\[\033[01;32m\]\[\033[00m\]:\[\033[01;36m\]\$(git_pwd)\[\033[00m\]\[\033[1;34m\]:$(~/.rvm/bin/rvm-prompt)\[\033[00m\]\$ " | |
| [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BETTER: http://aperiodic.net/screen/quick_reference | |
| screen -r | |
| Ctrl - a d => detatch | |
| screen -list | |
| screen -S 31517.pts-1.mxm-util -X kill | |
| http://haruska.com/2009/09/29/remote-pair-programming/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo 'CPU hogs' | |
| ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10 | |
| echo '#############' | |
| echo 'IO' | |
| iostat | |
| echo 'The mems' | |
| vmstat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openssl x509 -text -in cert-2012.crt |