Skip to content

Instantly share code, notes, and snippets.

@emileswarts
emileswarts / colours
Created March 14, 2012 13:22
Display terminal colours
for i in {0..255}; do printf "\x1b[38;5;${i}mcolor${i}\n"; done
@emileswarts
emileswarts / gist:2192600
Created March 25, 2012 09:44
Check disks
sudo lshw -C disk
@emileswarts
emileswarts / gist:2198261
Created March 25, 2012 16:57
Add external screen
xrandr --output VGA-0 --auto --left-of LVDS
@emileswarts
emileswarts / gist:2286149
Created April 2, 2012 18:34
Xrandr workaround
xrandr --output VGA-0 --auto --left-of LVDS --auto
xrandr --output LVDS --mode 1366x768
@emileswarts
emileswarts / modprobevbox.sh
Created April 13, 2012 11:22
Add vbox module to kernel
sudo modprobe vboxdrv
@emileswarts
emileswarts / internet.sh
Created May 11, 2012 12:48
Test internet connection speed
wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do git branch --track ${branch##*/} $branch; done
Show installed gems
bundle show
Generate scaffold
bundle exec rake db:migratls generate scaffold User name:string email:string
Install gems defined in Gemfile. Skip production group
bundle install --without production
Install db tables and fields
@emileswarts
emileswarts / print.sh
Created May 25, 2012 16:44
Print cups Brother
lp -d Brother_MFC_9465CDN testfile.txt
@emileswarts
emileswarts / append.sh
Created July 9, 2012 20:23
Append to file
cat localfile | ssh user@host "cat >>remotefile"