All the Bootstrap tools you could ever need

http://speckyboy.com/2013/05/01/bootstrap-toolbox/ has pretty much every Twitter bootstrap tool you could ever see yourself needing. I mostly appreciate the bootbox and hover dropdown projects listed there. There are also some customizers which are quite useful!


Redirect all http port 80 traffic to a different port

This applies to a local port on localhost that your destined port 80 traffic will be routed too instead: iptables -t nat -I OUTPUT -p tcp –dport 80 -j REDIRECT –to-ports 8123 Make sure you do something like the following (where you specify the interface) if you don’t want requuests to localhost also sent out the proxy: iptables -t nat -I OUTPUT -o eth0 -p tcp –dport 80 -j REDIRECT –to-ports 8123


Increase PHP file upload size allowance

from here Basically, you need to increase the size of the following values above what you want your maximum value to be (except for upload_max_filesize which you can keep at exactly what you want the limit to be). Here, we want our max file size to be 10MB. memory_limit = 32M upload_max_filesize = 10M post_max_size = 20MOf course these go in your php.ini file which is usually in something like “/etc/php5/apache2/php.

Continue reading ↦

Grep Recursively

So damn useful: grep -r “texthere” . from [](http://stackoverflow.com/questions/1987926/how-do-i-grep-recursively)


Run a script after tunnel has connected/disconnected

Add something like the following to your client.conf file: script-security 2 # run /etc/openvpn/up.sh when the connection is set up up /etc/openvpn/up.sh Obviously, up.sh must be executable. Also, if you expect the command to fail but still want Openvpn to start correctly (it will die if the script returns anything other than 0), then tack on an “exit 0? at the end of your script. Thx to askubuntu.


Bind an address to your loopback (like its actually there!!!)

To set bind an addy to loopback (any incoming traffic destined for that ip address (in this case, 80.0.2.1) get pushed to lo: ip addr add 80.0.2.1⁄32 broadcast + dev lo Now when you ping for that host, your loopback will actually be the one responding. For work, I’m actually on a client machine that knows about a server (has it in its routing table) which needs to have this set up in order to respond.

Continue reading ↦

Upgrading to CM 10.1.2 (from 10.0.0) aka Android 4.2.2 on my Skyrocket

1) Download the new CM rls, new radio for ATT (UCMC1 for jb), and new gapps. 2) Install all of them with recovery software (I did CM, Radio, Gapps in that order) 3) A few apps like Gmail and Google Music had problems launching so I uninstalled and reinstalled from Google Play. 4) ???? 5) Profit. Some links that help: http://forum.cyanogenmod.com/topic/75214-cm-1012/ http://forum.xda-developers.com/showthread.php?t=1785999 http://forum.xda-developers.com/showthread.php?t=2228292


Change a string in a directory full of files

grep -rl matchstring somedir/ | xargs sed -i ’s/string1/string2/g’ Ok so yeah. This uses grep to find a string in files in a directory and then executes sed to change a string in all of them. A beautiful super simple command…thx vasir!


Converting a diff to a proper script

Have a file on reviewboard that you want to download and run? 1) Go to download diff. Either copy the contents (with a bunch of +’s in front of everyline) to a file called “code.diff” or pastie the contents and grab them with wget. 2) Run the following…you may need to check that there are no empty lines without a + in front of them (possibly at the end of the fle)

Continue reading ↦

Keep a ssh session/tunnel open forever

The following command will initiate a ssh tunnel and daemonize itself restarting the connection if it drops for any reason: autossh -f -M 20000 -i /home/user/id_rsa -D 12345 [email protected] -N More examples of using autossh to do this can be found here