Archive for September, 2006

$productivity_tips[0] = “Become a script kiddy”

Written on September 30th, 2006 by
Categories: Information Insemination

Often times I’ve been asked while using Linux console / shell, why Linux is so hard that I need to memorize and type this and that command to get things running. Their argument is that in Windows they just need to click here and there, and walla, everything’s done. My usual answer would be, I’m just too used to the command line that it get me do many if not all  things faster rather than accomplishing the same task using GUI based programs. User friendly OS definition goes beyond pretty GUI interface and "next" buttons count..

After some time I found out that I need to get things done even faster, especially on repetitive tasks. For this I decided to harness a bit more of Linux shell’s power by writing scripts of some of my common task. The simplest example is the bash script that I use to scan for nearby wireless connections;

#!/bin/bash
watch -n 0.5 sudo iwlist ath0 scan

Basicly it’s just a command with the #!/bin/bash heading, just to identify itself as a bash script. To make things easy for me, I store my scripts in a folder, and make sure the folder is in my $PATH. In my case, i store it in ~/temp/bin . To add the folder to my $PATH, I just add this line to my ~/.bashrc;

PATH=/home/shakir/temp/bin:$PATH

My script’s filename starts with "xx" as prefix, and contains "." shall there be any scripts which share some common stuff. For example, the sample script above is named xxscan, and I also have scripts named xxip.home and xxip.office (this two scripts are used to set IP address for my laptop at home, and office respectively). Why would I do that anyway?

One of the nice feature of a Bash shell (default shell for most Linux distros) is the tab completion. Typing "xx" followed by double tapping <tab> key will list all the programs that start with "xx", which in this case would probably be just my scripts. Further typing "ip" and double tapping <tab> key will leave me with the xxip.home and xxip.office option.

I hope this tip helps and dont forget to chmod +x /path/to/your/script or your script will refuse to execute :) Please comment if you have any better ideas regarding to this, and hopefully I’ll be able to come out with $productivity_tips[1] soon :D

Google Apps for Your Domain

Written on September 24th, 2006 by
Categories: Information Insemination

The company I’m working with has been having some hard time with their emails, for the IPs we’ve been receiving from TMNut has been considered as spammer’s IP (hey Windows users, go patch your machine. Stop being spam zombies), thus for many times our emails out were blocked and never reach their destination. Someone reminded me that I have the invitation (it’s no longer invitation based anyway) for Google’s Google Apps For Your Domain. By this we get to register our domain’s email at Google, and enjoy what normally only Gmail users get. Google Talk, Google Calendar, and Google Page Creator also comes with the package. Migrating existing users is just as easy as creating a .csv file of the users to be created, and the steps are well explained in the admin page. Go get yourself an account at http://www.google.com/hosted

We’re provided CPanel by our webhosting company, and these simple steps are just all what it takes to migrate the emails to Google hosting;

  1. Login to CPanel (this one is for sure la)
  2. Go to Mail -> Modify Mail Exchanger (MX entry) -> Change an MX Entry
  3. Change the domain to any of these;

  • ASPMX.L.GOOGLE.COM
  • ALT1.ASPMX.L.GOOGLE.COM
  • ALT2.ASPMX.L.GOOGLE.COM
  • ASPMX2.GOOGLEMAIL.COM
  • ASPMX3.GOOGLEMAIL.COM
  • ASPMX4.GOOGLEMAIL.COM
  • ASPMX5.GOOGLEMAIL.COM

And that’s it. Enjoy..

p/s: I’ve uploaded photos of the previous HITB 2006, enjoy my photo gallery too :)

Welcome aboard, 3xb055

Written on September 13th, 2006 by
Categories: Information Insemination

Announcing the birth of (yet) another blog, be sure to check it out at http://www.3boss.org

If you haven’t heard about this l337 3xb055 group, then you should really head up to their website and read about their plans for world domination.

Ok, enough with the joke. No flame you people, okay. Just go to the site and see for yourself what’s there.

Command line download accelerator with axel

Written on September 3rd, 2006 by
Categories: Information Insemination

axel has been digged, and so I spent some time to try how cool could this said software be. axel is a command line based download accelerator, which would probably replace my favorite downloader, wget in some if not all situations.

As usual, gentoo’s emerge saves my day;

shakir@herugrim ~ $ sudo emerge axel
Calculating dependencies… done!
>>> Emerging (1 of 1) net-misc/axel-1.0b to /
>>> Downloading http://mirror.oscc.org.my/gentoo/distfiles/axel-1.0b.tar.gz
–20:17:20–  http://mirror.oscc.org.my/gentoo/distfiles/axel-1.0b.tar.gz
           => `/home/gentoo/distfiles/axel-1.0b.tar.gz’
Resolving mirror.oscc.org.my… 210.187.27.207
Connecting to mirror.oscc.org.my|210.187.27.207|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 43,293 (42K) [application/x-gzip]

100%[============================================================>] 43,293       117.62K/s

20:17:20 (117.47 KB/s) – `/home/gentoo/distfiles/axel-1.0b.tar.gz’ saved [43293/43293]

>>> checking ebuild checksums ;-)
>>> checking auxfile checksums ;-)
>>> checking miscfile checksums ;-)
>>> checking axel-1.0b.tar.gz ;-)
>>> Unpacking source…
>>> Unpacking axel-1.0b.tar.gz to /var/tmp/portage/axel-1.0b/work
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/axel-1.0b/work/axel-1.0b …

[.............................]

Gentoo’s emerge (command line interface to gentoo’s package/software management system) is just a little example of how Linux, and Open Source in general can extend one’s life by reducing the headache caused by overpriced softwares yet comes with tricky licensing scheme. With thousands of freely available softwares, installable with just a single command (ok, GUI installer / package management system is also available but I’m not showing it here. That’ll just make me seems less l337, hehe ), the money (and time, effort, etc2) saved can be used to live life to the fullest, and to worry less over the afterlife for not being a software pirate.
To test the software, I tried downloading Linux kernel from www.kernel.org

shakir@herugrim ~ $ wget http://www.kernel.org/pub/linux/kernel/v2.2/linux-2.2.26.tar.bz2
–20:19:18–  http://www.kernel.org/pub/linux/kernel/v2.2/linux-2.2.26.tar.bz2
           => `linux-2.2.26.tar.bz2′
Resolving www.kernel.org… 204.152.191.5, 204.152.191.37
Connecting to www.kernel.org|204.152.191.5|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 15,754,692 (15M) [application/x-bzip2]

 3% [>                                        ] 510,017       16.19K/s    ETA 07:38
shakir@herugrim ~ $ axel http://www.kernel.org/pub/linux/kernel/v2.2/linux-2.2.26.tar.bz2
Initializing download: http://www.kernel.org/pub/linux/kernel/v2.2/linux-2.2.26.tar.bz2
File size: 15754692 bytes
Opening output file linux-2.2.26.tar.bz2.0
Starting download

[  0%]  ………. ………. ………. ………. ……….  [  29.4KB/s]
[  0%]  ………. ………. ………. ………. ……….  [  42.9KB/s]
[  0%]  ………. ………. ………. ………. ……….  [  54.3KB/s]
[  0%]  ………. ………. ………. ………. ……….  [  51.3KB/s]
[  1%]  ………. ………. ………. ………. ……….  [  62.2KB/s]
[  1%]  ………. ………. ………. ………. ……….  [  58.7KB/s]

Everybody should agree that we have a clear winner here. The most prominent drawback of axel to me is that it couldn’t resume a partially downloaded file, and feature-wise, wget seems to get the extra points. Here’s a quick one to see how many options does each programs roughly have;

shakir@herugrim ~ $ wget –help | wc -l
129
shakir@herugrim ~ $ axel –help | wc -l
14

I must say that really is a lot of difference.. My friend has also mentioned aget in his blog but although I haven’t tried that out, the software seems to be cool, and useful. Combine these tools in your shell scripts, put it in a cron job to help you solve your day to day jobs / problems and start being a lazy guy; doing almost nothing for the rest of the day…