Skip to content

Instantly share code, notes, and snippets.

@mathewpeterson
mathewpeterson / checkout_files_by_ext_to_branch.sh
Created January 6, 2011 21:48
this will checkout every file matching an extension from another branch into the currently checked-out branch
for file in `find . -type f | grep -i "\.EXT"; do git checkout OTHERBRANCH "${file}"; done
@mathewpeterson
mathewpeterson / .screenrc
Created April 20, 2011 14:34
Pretty neat .screenrc file
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "
#terminfo and termcap for nice 256 color terminal
# allow bold colors - necessary for some reason
attrcolor b ".I"
# tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# erase background with current bg color
defbce "on"
@mathewpeterson
mathewpeterson / files_changed_in_svn.sh
Created June 9, 2011 21:00
Get the files that were changed in trunk in the svn repo since revision for user
#!/bin/bash
SVN_USERNAME=$1
SVN_REVISION=$2
svn log -v -r $SVN_REVISION:HEAD | awk "/^r[0-9]+ / {user=\$3} /trunk/ {if (user==\"$SVN_USERNAME\") {print \$2}}" | sort | uniq
@mathewpeterson
mathewpeterson / svn_log_files.sh
Created July 15, 2011 19:21
Get a list of list of files commited to svn's trunk branch by a particular author from a particular revision.
#!/bin/bash
SVN_USERNAME=$1
SVN_REVISION=$2
svn log -v -r $SVN_REVISION:HEAD | awk "/^r[0-9]+ / {user=\$3} /trunk/ {if (user==\"$SVN_USERNAME\") {print \$2}}" | sort | uniq
@mathewpeterson
mathewpeterson / create_unhashed_links.rb
Created August 13, 2011 03:10
Creates links that are unhashed to the Gitorious repositories.
#!/bin/bash
perl -e 'printf "00:16:3E:%02X:%02X:%02X\n", rand 0xFF, rand 0xFF, rand 0xFF'
@mathewpeterson
mathewpeterson / get_files.sh
Created October 21, 2011 19:39
Get files from folder a and copy them to folder b.
#!/bin/bash
SRC_PATH=''
DEST_PATH=''
FILES_LIST=`cat $1`
for file in $FILES_LIST
do
cd ${DEST_PATH} && cp -R ${SRC_PATH}/${file} ${file}
@mathewpeterson
mathewpeterson / gitconfig
Created October 27, 2011 16:45
useful gitconfig settings
[alias]
update = !git fetch origin && git rebase origin/master
addall = !git add -A && git status
done = !git fetch && git rebase origin/master && git checkout master && git merge @{-1} && git push
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
ir = !git rebase -i origin/master
unstage = reset HEAD
[color]
ui = auto
@mathewpeterson
mathewpeterson / gitconfig
Created October 27, 2011 19:55
useful gitconfig settings
[alias]
update = !git fetch origin && git rebase origin/master
add-all = !git add -A && git status
done = !git fetch && git rebase origin/master && git checkout master && git merge @{-1} && git push
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
ir = !git rebase -i origin/master
unstage = reset HEAD
log-branch = log origin/master..
undo-commit = reset --soft HEAD^
branch-name = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD`
@mathewpeterson
mathewpeterson / .config
Created January 10, 2012 01:38
linux-3.0.4-xen config
#
# Automatically generated make config: don't edit
# Linux/x86_64 3.0.4 Kernel Configuration
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set