Skip to content

Instantly share code, notes, and snippets.

@jamesvulling
jamesvulling / gist:1531036
Created December 29, 2011 01:38
Migrating SVN from a hosted service without using svnadmin
# create a local repository and add necessary hooks
svnadmin create /tmp/localsvn
echo '#!/bin/sh' > /tmp/localsvn/hooks/pre-revprop-change
chmod +x /tmp/localsvn/hooks/pre-revprop-change
# sync between the new repo and the existing repo
svnsync init file:///tmp/localsvn https://www.existingsubversion.com/svn/
svnsync sync file:///tmp/localsvn
# export from the local repo
@jamesvulling
jamesvulling / gist:1680127
Created January 26, 2012 00:58
SVN log history filtered for a specific user
svn log | egrep 'r[0-9]+ \| username \|'
@jamesvulling
jamesvulling / gist:2846885
Created May 31, 2012 22:41
Bash loop over contents of file
#!/bin/sh
EXPECTED_ARGS=1
if [ $# -ne $EXPECTED_ARGS ]
then
echo "Usage: `basename $0` {filename}"
exit 1
fi
@jamesvulling
jamesvulling / gist:2860336
Created June 2, 2012 22:49
Show Subversion commits for a single user
# shows basic commit info (date, revision, comment)
svn log | sed -n '/username/,/-----$/ p'
# shows modified files in addition to basic info
svn log --verbose | sed -n '/username/,/-----$/ p'
@jamesvulling
jamesvulling / gist:3291896
Created August 8, 2012 03:50
Installing Boto for managing AWS
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python get-pip.py
sudo pip install -U boto
@jamesvulling
jamesvulling / gist:4194636
Created December 3, 2012 12:12
Find non-ascii characters in a text file
grep --color='auto' -P -n "[\x80-\xFF]" file.txt
@jamesvulling
jamesvulling / one-liners.sh
Created March 25, 2013 03:29
Handy shell one-liners
# pipe file search to rm
find . -name '*.txt' | xargs rm
find . -name '*.txt' -exec rm {} \;
@jamesvulling
jamesvulling / gzip-comparison.sh
Created September 8, 2017 01:49
Check for gzip compression
#!/bin/bash
curl https://www.amazon.com --silent --write-out "%{size_download}\n" --output /dev/null
curl https://www.amazon.com --silent --write-out "%{size_download}\n" --output /dev/null -H "Accept-Encoding: gzip,deflate"