20110413

Clear ASA Configuration

rommon #1>confreg 0x41
rommon #2>boot
ciscoasa > en [when asked for password just press enter]
ciscoasa # conf t
ciscoasa (config)# config-register 0x01
ciscoasa (config)# copy run start
ciscoasa (config)# reload

20101028

Rename files with spaces to dash

find . -maxdepth 1 -type f | rename 's/ /-/g'

20100318

Removing leading zero using awk

Had to extract data from rrdtool and feed it to Zabbix. Problem was I kept getting leading zero variables. This removes any leading zero:

rrdtool fetch lighttpd.rrd AVERAGE -s -60s \
| grep -v nan \
| grep -v Requests \
| awk '{printf "%d",$2}' \
| awk '{print $1 + 0}'

to test it yourself:

echo 000000105 | awk '{ print $1 + 0}'

20091226

20091224

Debian/Ubuntu Perl Building

apt-get install dh-make-perl
dh-make-perl --cpan Your::CPAN::Package --install

20091106

Installing Google Chrome for Debian/Ubuntu Linux

Follow this link:
64bit: http://www.google.com/chrome/intl/en/eula_dev.html?dl=unstable_amd64_deb
32bit: http://www.google.com/chrome/intl/en/eula_dev.html?dl=unstable_i386_deb

20090828

Unix: Old dog, new tricks part 2

Say you want to add a '.old' to every file in your current directory. At the end of each expression ($) a '.old' will be set:

rename 's/$/.old' *

Or you want to make the filenames lowercase:

rename 'tr/A-Z/a-z/' *

Or you want to remove all double characters:

rename 'tr/a-zA-Z//s' *

Or you have many JPEG files that look like "img0000154.jpg" but you want the first five zeros removed as you don't need them:

rename 's/img00000/img/' *.jpg

rename will accept any regex and any perl operator

git stuff

Setting up gitweb with lighttpd
git Quick Reference Guide
git by Example
git Magic (Great intro)

20090724

Installing Movable Type 4.261

Had to setup a new MovableType 4 (MT4) to test out the new Social Networking thingy called Motion. Got stuck with "mt-static" not found even though I've supplied the correct url, path and even reconfigured apache thinking it was the problem. Finally, a damn fine solution that's not even in MT's documentation site:

1. cp mt-config.cgi-original mt-config.cgi
2. Supply the correct path/url to CGIPath and StaticWebPath
3. Supply the information under DATABASE SETTINGS
4. If you haven't done it yet, create your database

Open http://domain/cgi-bin/mt/mt.cgi or http://domain/mt/mt.cgi depending on how you're setup.

It should ask you for your account details, password, and shit.