Breadcrumbs

Breadcrumbs are those little things you figure out and want to remember the next time you need it. Here are a list of breadcrumbs that I find myself frequently needing.

  • Redirecting URLs with mod_rewrite

    If you’ve ever needed to move a web page’s location or change it’s URL but didn’t want to break external links to it as well [...]

  • mod_security missing from Debian

    Due to some licensing issues, mod_security was removed from Debian. To get it back you can do this. Etch users add this line to your [...]

  • Mac backup with rsync

    I needed to backup my wife’s MacBook to our home server and have it be “1 click” easy so she’d use it. I used ssh and rsync [...]

  • Fix GPG error with debian volatile

    If you’re having trouble adding debian’s volatile source, this should fix it. gpg –keyserver wwwkeys.eu.pgp.net –recv-key [...]

  • Deleting old log files

    If you need to create a script to delete old logs based on number of days, you can use this: find /path/to/logs/ -mtime +90 | xargs rm -rf …and [...]

  • Quickly find/replace stuff in files

    I had to replace a string in a bunch of files and wanted to do it quickly. 1. cd to the directory where your files live. 2. Run this: for i in *; do [...]

  • Convert DOS eol to UNIX eol

    To convert a DOS text file (end-of-line = ^M^J) to a Unix text file (end-of-line = ^J). # apt-get install sysutils (if using Debian) $ dos2unix [...]

  • Configure VI to return to last line in Debian

    To have VI(M) in Debian to act like it does in Redhat, create a file named .vimrc (Note the dot) in your home directory and add this to it: syntax on [...]

  • Increasing 3ware performance in Linux

    hdparm -t /dev/sda with my new RAID5 array was shockingly slow. I added this to my startup: blockdev –setra 19969 /dev/sda Much quicker /Happy dance

  • Installing java on Debian – the easy way

    The easiest (and the best way) to install java on Debian is as follows: 1. Verify that “contrib” is listed in your /etc/apt/sources.list [...]

  • Recover Deleted Partitions

    Ever need to recover a lost partition? Here’s how: 1. Go to http://www.cgsecurity.org/wiki/TestDisk_Download and download Testdisk. 2. Run [...]