Sunday, January 20, 2008

todos

Hey, it's been 19 days since new year and I haven't made all the resolutions yet so I decided to make them now. I don't make resolutions often but keeping them here might actually force myself to stick to them

0. Improve grades
I admit they are really really important, it just can't be over stated. So, it obviously goes on the first.

1. Learn regular expressions
From experience, I know that learning regular expressions is he only way to be able to use them. You find their uses only later after you know some of them. I just need to learn them.
2. Get better at social stuffs
It doesn't mean getting drunk every so often in a frat. I learnt that last semester altho I didn't do that. It's just meeting new people, getting away from all the programming works for sometimes and maybe even socialize with fellow programmers every so often.
3. Become a better writer, write often to blogs
I'm not committing myself to a certain time scale but it's a good skill to have and like my point 0 can't be over stated.
4. Improve my Laptop's power performance
I've been rather worried about it for sometime although it gives around 2 hours on battery but I generally don't use it on battery power. So, it often gets neglected. I've got this on my priority now.
5. Get better at managing stuff. A clean Room
Maybe I need to make a ticker or sth on my desktop for this. I need to develop this habit so that I can keep thing better organized and especially keep my room clean.

Suggestions are always welcome. I'll keep posting any updates if I have been on the track or derailed somewhere else. :)

Saturday, January 19, 2008

Busybox on Android

As good as android is, it does lack some of the rather interesting linux tools that could be of a great use like busybox. Its good to have a command line interface to play around often to get information that click around in gui which makes things a bit too slow sometimes.
While I did try to compile the busybox binary and loading onto the phone, that didn't quite work. So I got one from here.

http://benno.id.au/android/busybox
Then I copied the binary into the tools folder

after running the emulator with ./emulator, I ran the
./adb push busybox /data/busybox/busybox
I logged into the shell with
./adb shell
# cd /data/busybox
(you might need to set permissions here if you downloaded the file)
# ./busybox --install

remember to export the path
export PATH=/data/busybox:$PATH
voila! got my busybox applets!!

Tuesday, January 15, 2008

How to make your window Full Screen in gnome?

I have often had this problem of getting quite seriously distracted while coding and I always like to use as much screen real state to work on but then again, there are other applications that need it too and it can be a lot of distraction with gmail messages popping up and all sorts of nasty stuff happening. One option is to just go into some other desktop manager but I kind of like solving the problems at hand and gnome does provide me with some really good features that I've become used to.

I started wondering if I could make eclipse full screen so that I can just focus on the code and hopefully nothing else.


Then I came across this useful link http://www.enigmacurry.com/2007/02/17/gnome-kiosk-mode-make-any-app-fullscreen supposed to be a rant about the feature gnome lacked but updated to add this instruction.
There is a nice feature that lets users set keybindings.


Here are the steps:


1. Open gconf-editor using the trusty old Alt-F2 combination



Now go to /apps/metacity/window_keybindings/toggle_fullscreen and set the Key Binding


Also, if you're using Beryl instead of metacity, this option is reasonably easy to find in the beryl settings manager: "General Options"->"Shortcuts"->"General Options"->"Bindings"->"Toggle Window Fullscreen"


As you can see, I have set it to F11.


There is a somewhat easier way to do this too using the System>Preferences>Keyboard Shortcuts tool


Find the Toggle Fullscreen mode and set the key. As easy as that. I generally prefer the gconf-editor mode because it gives more control to whatever I type. I have unwittingly changed some shortcuts from the Keyboard Shortcuts tool couple of times already to know better now :).


So, finally my eclipse screen is full.. and hopefully without distractions :P




Powered by ScribeFire.

Wednesday, January 09, 2008

Checking integrity of cdrom drives

I had this problem for a while, so I wanted to take a look at it... how do i check the integrity of the drive.
I did this... to find that it was quite okay... the same can be done with md5sum but sha1sum is better sometimes

$ sha1sum KNOPPIX_V5.1.1CD-2007-01-04-EN.iso | grep cdc0e9181d9dd2f2fc71aa9c59391001c46afa3e
cdc0e9181d9dd2f2fc71aa9c59391001c46afa3e *KNOPPIX_V5.1.1CD-2007-01-04-EN.iso
but then again, after burning the cd, I wasn't too sure if it had data integrity. So, I had to check if it was working
I tried md5sum on /dev/cdrom but that was taking a lot of time.
Then I saw a description on http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Checking_the_integrity_of_a_LiveCD_or_LiveDVD

The process goes like this:
$ isoinfo -d -i /dev/cdrom
CD-ROM is in ISO 9660 format
System id: LINUX
Volume id: KNOPPIX
Volume set id:
Publisher id: KNOPPER.NET
Data preparer id: www.knopper.net
Application id: KNOPPIX LIVE LINUX CD
Copyright File id:
Abstract File id:
Bibliographic File id:
Volume set size is: 1
Volume set sequence number is: 1
Logical block size is: 2048
Volume size is: 356532
El Torito VD version 1 found, boot catalog is in sector 763
Joliet with UCS level 3 found
Rock Ridge signatures version 1 found
Eltorito validation header:
Hid 1
Arch 0 (x86)
ID 'KNOPPER.NET'
Key 55 AA
Eltorito defaultboot header:
Bootid 88 (bootable)
Boot media 0 (No Emulation Boot)
Load segment 0
Sys type 0
Nsect 4
Bootoff 312 786
See the things in bold? that's the data we're interested in: logical block size and volume size. So, we just output the data and md5sum that instead of just the /dev/cdrom

$dd if=/dev/cdrom bs=2048 count=356532 conv=notrunc,noerror | md5sum
356532+0 records in
356532+0 records out
730177536 bytes (730 MB) copied, 233.479 seconds, 3.1 MB/s
379e2f9712834c8cef3efa6912f30755 -

$ cat KNOPPIX_V5.1.1CD-2007-01-04-EN.iso.md5 | grep 379e2f9712834c8cef3efa6912f30755
379e2f9712834c8cef3efa6912f30755 *KNOPPIX_V5.1.1CD-2007-01-04-EN.iso
so it works...

another method is to redirect the dd output to the iso and run diff on it.