Skip to content

Instantly share code, notes, and snippets.

View kennethkalmer's full-sized avatar

Kenneth Kalmer kennethkalmer

View GitHub Profile
#!/bin/bash
#
# Find all the rails projects from this directory down and clear their log
# files to save some space.
#
base=`pwd`
for path in `find $base -type f -path '*/config/environment.rb'`
do
<style type="text/css">
#left {
float: left;
width: 200px;
}
#right {
margin-left: 200px;
}
</style>
<div>
@kennethkalmer
kennethkalmer / grep-postfix-message-ids-osx.sh
Created October 23, 2008 13:41
Grep for a pattern through a Postfix mail log, collect the message ids into a temporary file and then grep for all occurrences of the ID's in the maillog.
#!/bin/sh
# OSX friendly version by jeff donovan
#
# Grep for a pattern through a Postfix mail log, collect the message ids into a temporary
# file and then grep for all occurrences of the ID's in the maillog.
# This is a very intensive operation since it requires 1+N greps through the entire log file,
# where N is the number of unique ID's returned from the first grep.
#
# Usage sample:
alias webshare='python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"'