Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@asmega
asmega / index.sh
Created January 16, 2012 11:23
delete locally merged git branches
git branch --merged develop | grep -v 'master$' | grep -v 'develop$' | xargs git branch -d
# find all local branches merged in to develop
# dont delete master or develop branches
# then do it
@asmega
asmega / index.sh
Created January 16, 2012 11:32
delete remote merged git branches
git branch -r --merged develop | sed 's/ *phil\///' | grep -v 'master$' | grep -v 'develop$' | grep -v '^ dave' | grep -v '^ kevinbrowne' | xargs -I% git push phil :%
# mostly likely change the first part to master. use this branch to test if things have been merged in
# sed part. use this to remove the name of your remote in my case phil. most likely to be origin
# grep any branches you want to keep
# last part. change name to your remote
# you can do a dry run by removing the last section
@asmega
asmega / time_machine.sh
Created January 16, 2012 13:05
modify linux system date time for time machine capabilities
sudo date -s "2 MAR 2012 18:00:00"
@asmega
asmega / rvm_passenger.sh
Created January 28, 2012 19:54
passenger with rvm
# apt-get
# build-essential gcc libreadline6-dev libxslt-dev libxml2-dev zlib1g-dev libcurl4-openssl-dev libpcre3-dev
# http://www.blog.bridgeutopiaweb.com/post/install-rvm-passenger-nginx-and-rails-3-on-ubuntu-lucid-lynx/
rvm install 1.9.2
rvm 1.9.2 --passenger
@asmega
asmega / postgres
Created January 28, 2012 20:25
postgres
# users, roles
create user blah with password 'blah';
drop user blah;
# db creation
create database DATABASE with owner OWNER;
@asmega
asmega / index
Created April 6, 2012 11:49
scan a document in lineart mode
scanimage --mode Lineart --resolution 600 > test.pnm
scanimage --mode Lineart --batch-prompt --batch-count 2 --resolution 600
convert out1.pnm out2.pnm out.pdf
@asmega
asmega / gist:3201828
Created July 29, 2012 21:04
resize image
mogrify -resize 256x256
@asmega
asmega / gist:3394155
Created August 19, 2012 10:24
update mlocate locate database for mac
sudo /usr/libexec/locate.updatedb
@asmega
asmega / gist:3394164
Created August 19, 2012 10:28
mac restart postgres potgresql
# since it isnt in my path
/Library/PostgreSQL/9.1/bin/pg_ctl restart -D /Library/PostgreSQL/9.1/data
@asmega
asmega / gist:3749336
Created September 19, 2012 12:14
show hidden dotfiles in mac finder
defaults write com.apple.finder AppleShowAllFiles -bool YES