Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@AndrewRussellHayes
AndrewRussellHayes / allDos2unix
Created January 8, 2015 16:09
convert all files in dir from dos to unix
for file in `find /dirpath/* -type f`; do dos2unix $file $file; done
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@AndrewRussellHayes
AndrewRussellHayes / mount-run_dropbox
Last active August 29, 2015 14:10
dropbox container run cmd
docker run -t -i -v /HayesCloud/dockerhost/:/dockerhost dropbox
docker run -t -i -v /Users/andrew/tmp/HayesCloud/dockerhost/:/dockerhost dropbox
docker run -t -i -v /Users/andrew/tmpdrp/Dropbox/:/home/Dropbox dropbox
docker build -t dropbox .

Keybase proof

I hereby claim:

  • I am andrewrussellhayes on github.
  • I am andrewhayes (https://keybase.io/andrewhayes) on keybase.
  • I have a public key whose fingerprint is 0C5B 4F11 699B A97A 7319 3EBF 3A49 4D3D 0618 274D

To claim this, I am signing this object:

# There was a day where I have too many color schemes in iTerm2 and I want to remove them all.
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one.
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files.
$ cd /tmp/
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist .
$ plutil -convert xml1 com.googlecode.iterm2.plist
$ vi com.googlecode.iterm2.plist
@AndrewRussellHayes
AndrewRussellHayes / git_mergetool.sh
Last active August 29, 2015 14:10
git mergetool
+--------------------------------+
| LOCAL | BASE | REMOTE |
+--------------------------------+
| MERGED |
+--------------------------------+
Local : The branch merging INTO
Base : The most recent shared version. This is where diffget
@AndrewRussellHayes
AndrewRussellHayes / caseless_grep.sh
Created November 27, 2014 03:07
case insensitive grep .. its the '(?i)' part
egrep -H -n -R -S --exclude-dir=private -e "(?i)andrew" *
@AndrewRussellHayes
AndrewRussellHayes / docker_img_rm.sh
Created November 27, 2014 01:37
remove images behind dangling containers
docker rm `docker ps --no-trunc -aq`
@AndrewRussellHayes
AndrewRussellHayes / dangling_containers.sh
Created November 27, 2014 01:36
find dangling containers
docker images -q --filter "dangling=true" | xargs docker rmi