Skip to content

Instantly share code, notes, and snippets.

View tovbinm's full-sized avatar
⌨️
<typing sounds>

Matthew Tovbin tovbinm

⌨️
<typing sounds>
View GitHub Profile
@tovbinm
tovbinm / install_riak_with_homebrew.bash
Created May 2, 2012 21:43 — forked from tinomen/install_riak_with_homebrew.bash
riak needs erlang R13b04 and homebrew now defaults to R14
# first install erlang using the R13b04 formula
brew install https://github.com/mxcl/homebrew/raw/810d52f4a386ea9e2b837030120ffd69cad73722/Library/Formula/erlang.rb
# now you are free to install riak
brew install riak
@tovbinm
tovbinm / Command line
Created May 4, 2012 21:39
Modify hosts file on Android device
adb remount
adb push ~/android.hosts /system/etc/hosts
@tovbinm
tovbinm / gist:2598838
Created May 5, 2012 00:51
Stop iptables
#!/bin/sh
echo "Stopping firewall and allowing everyone..."
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
@tovbinm
tovbinm / haproxy.cfg
Created May 30, 2012 01:02
HAProxy config for Riak
global
user haproxy
group haproxy
daemon
maxconn 2048
defaults
log global
option dontlognull
balance roundrobin
@tovbinm
tovbinm / gist:2975295
Created June 22, 2012 21:26
Tabbar for emacs
git clone https://github.com/dholm/tabbar /usr/local/share/emacs/site-lisp/tabbar
Add then:
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/tabbar")
(require 'tabbar)
(tabbar-mode t)
to ~/.emacs.d/lisp/my-emacs.el
@tovbinm
tovbinm / gist:2975579
Created June 22, 2012 22:37
Emacs from command line on Mac
If you want to easily run emacs from the command line on mac (and not open a new instance of emacs each time), put the following in your .bash_profile:
alias emacs="DYLD_LIBRARY_PATH=/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources:\$SDROOT/lib open -a /Applications/Emacs.app \"$@\""
And in your .emacs file:
(setq ns-pop-up-frames nil)
@tovbinm
tovbinm / gist:2975609
Created June 22, 2012 22:47
Remove the “Last login” message from the Mac OS X Terminal
Remove:
touch .hushlogin
Get it back:
rm .hushlogin
@tovbinm
tovbinm / gist:2990642
Created June 25, 2012 19:15
Fixing Home, End, Page Up, and Page Down in Leopard’s Terminal
Terminal -> Preferences -> Settings -> Keyboard tab
Home - \001 (or press Ctrl+a)
End - \005 (or press Ctrl+e)
Page Up - \033[5~
Page Down - \033[6~
@tovbinm
tovbinm / gist:2993133
Created June 26, 2012 03:41
Set Useragent in Firefox on Linux
Add "user_pref("general.useragent.override", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120427 Firefox/15.0a1");"
to prefs file: /usr/lib/firefox/defaults/pref/channel-prefs.js
@tovbinm
tovbinm / Disable
Created July 12, 2012 07:06
SSD Trim Support on Mac OS Lion - For non SandForce 2 controllers ONLY!!! - Check here - http://en.wikipedia.org/wiki/SandForce#SSDs
sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00).{9}(\x00\x51)|$1\x41\x50\x50\x4C\x45\x20\x53\x53\x44$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
sudo kextcache -system-prelinked-kernel
sudo kextcache -system-caches
sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage