Archive for November, 2007

Books…

Written on November 26th, 2007 by shakir
Categories: Information Insemination, Nerd Public Journal?

I went to One Utama MPH to get myself the last available copy of the LPI Linux Certification In A Nutshell book, to not fail my LPI 20x exam, again :( Though I prefer Exam Cram series more for the purpose, this book seems to be the only option that I have, as other books doesn’t cover LPIC 2 exams. I’ve also bought the CSS book just to add to my Pocket Reference series of collection.

Though I’m not into it,  LPIC 1 Exam Cram 2 was also not available. I blame Ditesh for the shortage :)

I was also looking for Python Cookbook, and Django or Pylons books, but they were all not on the shelves. With this I pledge anyone who has these books to come forward and help me with that, haha.

# The LPI manual provided by the savannah project doesn’t really cover LPI syllabus, and so if you’re planning to pass your LPI exams, don’t just rely on them. Experience speaks :D

# There was only 7 Python books at One Uutama MPH by the time I was there. How sad.

Huawei E600 For Sale

Written on November 22nd, 2007 by shakir
Categories: Nerd Public Journal?

I’ve been a happy user of this Huawei E600;

till I got a brand new Dell XPS M1330, which doesn’t have PCMCIA slot for me to plug this data-card.

I need to get myself USB based 3G card, and so if anyone have cheap Huawei E220 for sale, or wants to get my Huawei E600, please contact me.

# The E600 unit is a replacement unit  that I’ve just recently got from the warranty, so it’s basicly brand new, but without warranty :)

RSS feed for blogger.com

Written on November 20th, 2007 by shakir
Categories: Information Insemination

Just found out that blogger.com provides RSS feeds for blogs they host. Just add someblog.blogspot.com/rss.xml to your favorite RSS reader.

They also provide ATOM feed, which is available at someblog.blogspot.com/atom.xml

Now my @$$ is saved for not missing to read my friend’s latest blog, anymore :D

p/s:If you’re looking for a simple way to add RSS feed icon for your blogspot blog, I’ve made a short howto here for that.

Enable vim syntax highlighting

Written on November 15th, 2007 by shakir
Categories: Information Insemination

Console / shell is a black and white world in (K)Ubuntu, and so lets add some color to it. Let’s start with the infamous vim (installable with the vim-full package), by adding these  lines to ~/.vimrc (also to enable line numbering, and disable auto indent)

set noautoindent
set number
:syntax enable

I also miss my greenish bash prompt in Gentoo, and so I add these to the end of my ~/.bashrc

PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '

Ok, enough with the eye candy, time to get back to work.

“DeprecationWarning: SessionMiddleware is moving to beaker.middleware in 0.8″ error in (K)Ubuntu

Written on November 14th, 2007 by shakir
Categories: Information Insemination

I’ve been getting this error when running paster for my Pylons project:


shakir@herugrim ~/Misc/workspace $ paster serve –reload development.ini
Starting subprocess with file monitor
/var/lib/python-support/python2.5/pylons/wsgiapp.py:249: DeprecationWarning: SessionMiddleware is moving to beaker.middleware in 0.8
  app = SessionMiddleware(app, config.global_conf, **config.app_conf)
/var/lib/python-support/python2.5/pylons/wsgiapp.py:254: DeprecationWarning: CacheMiddleware is moving to beaker.middleware in 0.8
  app = CacheMiddleware(app, config.global_conf, **config.app_conf)
Starting server in PID 8550.
serving on 0.0.0.0:5000 view at http://127.0.0.1:5000

On my quest to solving it, I uninstall Pylons (its whole bunch of dependencies);

sudo apt-get remove python-pylons

and install it back again, but this time using easy_install;

sudo easy_install Pylons

Yeay, I’m now good to proceed. Happy coding to me :D

Prefix WhoIs in Python

Written on November 10th, 2007 by shakir
Categories: Information Insemination

Part of a project I’m into requires me to dig for some details on IP addresses. Normal whois query (default to whois.apnic.net) don’t give me the information that I really need for, and upon searching I came to the Prefix Whois Project. They have came up with whob, and from the website I get to know that I can even get part of whob‘s functionality by just to query for whois from their server. Let’s try with our favorite’s TMNut Screamyx DNS

 

shakir@herugrim ~ $ whois -h whois.pwhois.org 202.188.0.133
IP: 202.188.0.133
Origin-AS: 4788
Prefix: 202.188.0.0/19
AS-Path: 6079 4788
AS-Org-Name:
Org-Name: Asia Pacific Network Information Centre
Net-Name: APNIC-CIDR-BLK
Cache-Date: 1195082506
Latitude: 3.167000
Longitude: 101.700000
City: -
Region: -
Country: MALAYSIA

I’ve just started to learn, and like Python, and let’s see my Python example to extract the whois info;

import commands

def main():

    whoisServer = "whois.pwhois.org"
    IPAddr = "202.188.0.133"

    status, output = commands.getstatusoutput('whois -h ' + whoisServer + " " + IPAddr)

    result = {}

    for i in output.splitlines():
        stripped = i.split(':')
        result[stripped[0]] = stripped[1]

    print result

if __name__ == "__main__":
    main()

Nikon D40x in Ubuntu Linux

Written on November 6th, 2007 by shakir
Categories: Information Insemination, Nerd Public Journal?

I’ve been using Nikon D40X on my previous trip to Jakarta (and Bandung). For this I need to update my previous script as there are few differences, as the following:

  • I set the camera to use RAW format rather than jpeg
  • Data transfer is through the laptop’s built in MMC card slot, rather than USB
  • I’m now a (K)Ubuntu user :)

First step, is the software part. As RAW format is not really usable for "presentation", I need to convert it to another format, say JPEG. For this I’m gonna need  ufraw. Let’s install it;

 

sudo apt-get install ufraw
sudo apt-get install gimp-ufraw #optional

 

Using ufraw-batch (included in the ufraw package), I came up with this self explanatory, lightly commented bash script;

 

#!/bin/bash

#Set some variables
MOUNT_DIR=/media/mmc
MOUNT_DEV=/dev/mmcblk0p1
PHOTO_DIR=/home/shakir/Photos/temp/D40X
#Copy files from the MMC card
sudo mkdir $MOUNT_DIR
sudo mount -o uid=shakir,gid=shakir $MOUNT_DEV -t vfat $MOUNT_DIR
mv -v /media/mmc/dcim/100nd40x/* $PHOTO_DIR
sudo umount $MOUNT_DIR
sudo rmdir $MOUNT_DIR
cd $PHOTO_DIR
mkdir jpeg
#Convert RAW files to low quality JPEGs
for i in `ls *.nef`; do
        ufraw-batch –out-type=jpeg –out-path=jpeg/  \
          –compression=70 –size=600,600 –overwrite $i
        mv -v $i nef/
done
mkdir nef
mv *.nef nef/

 

The script would generate a low quality / resolution JPEGs, based on the un-processed RAWs. The JPEGs are useful to actually help me deciding which photos are meant for deletion, and which to keep. Later I would manually go to the selected RAW files folder, and;

ufraw *.nef

to edit the RAW files. This final step would give me the files that I mean to keep;

ufraw-batch --out-type=jpeg --out-path=jpeg/ --compression=100 --overwrite *.nef

I bring back no souvenirs but these photos;