Skip to content

Instantly share code, notes, and snippets.

View rook2pawn's full-sized avatar
💭
Receiving the Love of God in Christ

david wee rook2pawn

💭
Receiving the Love of God in Christ
View GitHub Profile
@rook2pawn
rook2pawn / tmpfs stuff
Created July 27, 2011 10:14
tmpfs stuff on /etc/fstab
tmpfs /media/ramdisk tmpfs size=128M,nr_inodes=10k,mode=777 0 0
none /home/rook/.macromedia tmpfs noexec,uid=1000,gid=1000,mode=700,size=156m 0
0
none /home/rook/.adobe tmpfs noexec,uid=1000,gid=1000,mode=700,size=156m 0 0
in about:config
browser.cache.disk.parent_directory = /media/ramdisk
@rook2pawn
rook2pawn / bash
Created July 27, 2011 10:16
bash prompt show remaining batt power and current time
PS1="\$(acpi -b | perl -ne 'print \$1.\" \".+(join \":\",(localtime)[2,1]),\"> \" if /(\\\d{1,}%)/')"
@rook2pawn
rook2pawn / xinput
Created July 27, 2011 10:17
xinput to turn off trackpad
xinput --list
xinput --list-props 11
(where 11 is the item that match the touchpad)
xinput set-int-prop 11 "Device Enabled" 8 0
xinput set-int-prop 11 "Device Enabled" 8 1
@rook2pawn
rook2pawn / screen
Created July 27, 2011 10:18
screen tips
control a + d to detach
screen -S <name of screen> --> starts a new screen with a name
screen -r <name of screen> --> recalls a screen with name
ctrl+a k --> kills current window
to reattach an attached screen on a closed ssh session , screen -rd
@rook2pawn
rook2pawn / xmonad.hs
Last active September 27, 2015 13:27
xmonad.hs
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Layout.Spacing
main = xmonad =<< xmobar myConfig
myConfig = defaultConfig {
modMask = mod4Mask,
layoutHook = spacing 5 $ Tall 1 (3/100) (1/2)
}
@rook2pawn
rook2pawn / .xinitrc
Last active September 27, 2015 13:28
xinitrc
# Stuff to execute no matter the wm here
setterm -blank 0 -powersave off -powerdown 0
xset s off
xmodmap $HOME/.xmodmap
xsetroot -cursor_name left_ptr
#./wallpaper.sh &
#xkbset exp =m
exec xmonad
@rook2pawn
rook2pawn / .xmodmap
Last active September 27, 2015 13:28
xmodmap
remove Lock = Caps_Lock
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock
@rook2pawn
rook2pawn / wifi dhclient
Created March 25, 2012 18:05
wifi dhclient connection
<wlan0> whatever your device name is… type ifconfig to get your list
ifconfig wlan0 up
iwconfig wlan0 key SECRET_WIFI_KEY
iwlist wlan0 scanning
iwconfig wlan0 essid WIFI_NAME
dhclient wlan0
ping google.com
@rook2pawn
rook2pawn / .vimrc
Last active May 3, 2016 01:34
My .vimrc
set hidden
set nobackup
set nowritebackup
set noswapfile
set enc=utf-8
set termencoding=utf-8
set fenc=utf-8
set encoding=utf-8
set number
set numberwidth=4
@rook2pawn
rook2pawn / router.js
Last active August 29, 2015 14:00
Simple Chain Router
var methods = require('methods')
var routes = {}
var setter = function(method) {
return function() {
var args = [].concat.apply({},arguments).slice(1);
routes[method.toUpperCase()][args[0]] = args.slice(1);
}
}
var next = function() {
routes[this.req.method][this.req.url][++this.index](this.req,this.res,next.bind({req:this.req,res:this.res,index:this.index}));