Skip to content

Instantly share code, notes, and snippets.

View mshuler's full-sized avatar
💭
ヽ(´ー`)ノ

Michael Shuler mshuler

💭
ヽ(´ー`)ノ
View GitHub Profile
@mshuler
mshuler / riak-updown
Created November 14, 2012 19:54
start/stop Riak dev instances
#! /bin/bash
## start/stop Riak dev instances
## http://docs.basho.com/riak/latest/tutorials/fast-track/Building-a-Development-Environment/
set -e
RIAK_HOME=$HOME/riak-1.2.1
RIAKDEVDIR=$RIAK_HOME/dev
DEVDIRS=(dev1 dev2 dev3 dev4)
@mshuler
mshuler / fetch_certdata
Created June 23, 2012 15:40
Fetch Mozilla certdata.txt via CVS
#!/bin/sh
#wget http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1 \
# -O /tmp/certdata.txt
VCS=cvs
REPODIR=~/repos/$VCS/mozilla_certdata
CVSROOT=":pserver:[email protected]:/cvsroot"
CERTDATA="mozilla/security/nss/lib/ckfw/builtins/certdata.txt"
VCS_COMMAND="$VCS -d $CVSROOT checkout $CERTDATA"
@mshuler
mshuler / minimize
Created December 7, 2010 23:18
~/bin/minimize - strip all comments and blank lines - I use on conf files a lot..
#!/bin/sh
if [ $1 ]; then
if [ -f $1 ]; then
/bin/egrep -v '^(\s+#|#)|^(\s+$|$)' $1
else
echo " $1 is not a regular file"
exit 1
fi
else
echo " $0 needs a filename to strip.."
@mshuler
mshuler / github-mirror.sh
Created November 23, 2010 01:33
example github mirror from launchpad
#!/bin/sh
# OpenStack bzr to github mirror
#
# Requirements:
# git >= 1.7.0, bzr >= 2.0.0,
# git-bzr-ng, python-fastimport, patched bzr-fastimport
#####
# Set up unpackaged source:
# mkdir ~/src
@mshuler
mshuler / wp_comments csv export
Created October 5, 2010 20:36
export wordpress commenter info
SELECT comment_author, comment_author_email, comment_content, comment_parent
INTO OUTFILE '/tmp/comment_export.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM wp_comments;
@mshuler
mshuler / tailirclog_espeak.sh
Created August 13, 2010 15:47
script to tail and strip irclogs for piping to espeak
#!/bin/sh
# script to tail and strip irclogs for piping to espeak:
# don't forget -t for a TTY if calling script remotely via ssh, ie:
# ssh -t host.example.com ~/bin/tailirclog_espeak.sh debian-devel | espeak
if [ ${1} ]; then
CHAN=${1}
LOG=$( find ${HOME}/irclogs/ -name \#*${1}.log )
if [[ ! -f ${LOG} ]]; then
echo; echo "cannot find logs for #${CHAN}"; echo
else