Skip to content

Instantly share code, notes, and snippets.

fssh () {
hosts="$1 $(getent hosts $1)"
for h in ${=hosts}; do ssh-keygen -R $h; done
ssh-keyscan -tdsa,rsa ${=hosts} >> $HOME/.ssh/known_hosts
ssh $*
}
[m19:/var/www/apps/eb/current/log]0% sudo tcpdump host 208.66.27.58
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
10:57:50.853183 IP 27.66.208.web-pass.com.57426 > m19.seriousops.com.http: S 1930439315:1930439315(0) win 65535 <mss 1460,nop,wscale 3,nop,nop,timestamp 86790863 0,sackOK,eol>
10:57:51.796816 IP 27.66.208.web-pass.com.57426 > m19.seriousops.com.http: S 1930439315:1930439315(0) win 65535 <mss 1460,nop,wscale 3,nop,nop,timestamp 86790872 0,sackOK,eol>
10:57:52.798235 IP 27.66.208.web-pass.com.57426 > m19.seriousops.com.http: S 1930439315:1930439315(0) win 65535 <mss 1460,nop,wscale 3,nop,nop,timestamp 86790882 0,sackOK,eol>
10:57:53.799858 IP 27.66.208.web-pass.com.57426 > m19.seriousops.com.http: S 1930439315:1930439315(0) win 65535 <mss 1460,sackOK,eol>
10:57:54.801096 IP 27.66.208.web-pass.com.57426 > m19.seriousops.com.http: S 1930439315:1930439315(0) win 65535 <mss 1460,sackOK,eol>
10:57:55.802573
diff --git a/config/deploy.rb b/config/deploy.rb
index eccacbd..a0b2a72 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -116,3 +116,9 @@ namespace :memcached do
sudo "/etc/init.d/god start"
end
end
+
+namespace :info do
@slumos
slumos / roseq
Created November 18, 2009 01:16
#! /bin/zsh
function usage {
print "$0:r max [min]" 1>&2
}
max=$1
min=${2:-1}
if [ -z $max ]; then
function l {
if [[ $# -eq 1 && -f "$1" ]] then
case "$1" in
*gz) zmore "$1" ;;
*png|*pdf) qlmanage -p "$1" >& /dev/null ;;
*) $PAGER "$1" ;;
esac
else
ls -CFL $*
fi
#! /usr/bin/env ruby
$: << '/ops/lib/ruby'
TARGET_HOST=''
TARGET_USER=''
TARGET_PASS=''
TARGET_DB=''
require 'rubygems'

Rolling with Homebrew (rather than MacPorts)

First, we have to install Homebrew. Once it's installed, we can do pretty much everything else via Homebrew. By default Homebrew will install to /usr/local. It's possible to choose a different directory but everything I've read so far says it's a PITA. I'm sticking with the default.

ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"

Getting your development environment running requires a few servers. You could get by with as little as Postgres and Memcached but it'll be better if you have Nginx and RabbitMQ as well. Eventually you'll probably want Redis and Artie as well.

TODO: instructions for Redis and Artie

$ l # => ls
$ l /dir # => ls /dir
$ l file.txt # => less file.txt
$ l file.gz # => less with auto-decompress (bzip too)
$ l file.png # => quicklook file.png
$ l file1 file2... # => ls file1 file2...
#! /bin/sh
# fetch - figure out how to get some url and do it
find_prog () {
prog=$1
ret=1
OIFS=$IFS
IFS=:
for d in $PATH; do
if test -f $d/$prog && test -x $d/$prog; then
#! /bin/zsh
function usage {
echo "usage: $0 pubkey host"
exit 1
}
if [[ $# -ne 2 ]]; then
usage
fi