Weblog of an Aspiring Computer Scientist
Random header image... Refresh for more!

Category — PITA

IQ < 0

This is seriously stupid. Have a look at what something called ELCOT does to test the durability of their laptop

June 27, 2008   No Comments

SAT 2: Recovering from the “Shriphani Conjecture”

The Shriphani Conjecture states that:

“If something is judged by you to be impossible, then it is sure to happen to you.”

Well here goes. Two days ago I chanced to look at my Toefl iBT profile on ets’ website and clicked on the “View Scores” button and wonders of wonders, 117 on 120. So I am safe I said and moved on to read Einstein’s special theory of relativity.

Today I sat for SAT 2. A comedy scene took place at the center.

Scene 1:

(Enter Shriphani Palakodety and Mother)

Shriphani Palakodety: Hmm… from what I gather by looking at the contents of the bag, I seem to have forgotten to get my calculator.

Mother: WHAT !!

SP: Yeah, I am without the electronic device that seems to be so needed to write this exam.

M: We paid more than a 100 dollars for that calculator!

SP: It will be useful at some later date.

M: It won’t be serving the purpose we got it for !! You made us go through a lot of trouble to get hold of this calculator

SP: Relax ! I can write the exam.

M: You wasted money ! That calc. was for your SAT

(I still think that calc. is for playing minesweeper and figuring out why the look-to-us-if-you-want-to-learn-about-open-source-and-linux company doesn’t have a linux version of their calculator-pc syncing software. I still managed to copy the binaries using pyserial to play games on my calc)

SP: Sorry.

M: hmph

So I went in and wrote my name, encircled the dots and came out. I did leave quite a few. I will probably cross 2250 easily. I should have taken the calc. DAMN !

October 6, 2007   1 Comment

jammed dirname.py on top of mount.py

Trouble’s struck !!. Ubuntu’s libATA has stopped functioning and my partitions are now seen as IDE subsystems once again. Hence we have a conflict between udev rules and device names leading to automount getting <censored>. I seriously can’t be bothered by this. Considering that I try to behave as much as a sysadmin as possible, I tried to whip up a script that would mount the device specified as I have no idea what filesystems my 3 identical (in appearance) external drives have on them. I think one has reiserfs, another has ext3 and the third has fat32 on it. I tried to find out the command that would let me know about the fs I have on my external drive without actually mounting it. fdisk didn’t help and I was stuck with waiting for the new kernel 2.6.20-16-generic to be fixed. Later that day I did:

man -k locate

The first line in there was:

blkid (8)            - command-line utility to locate/print block device attributes

Was this command the solution to my troubles? It indeed was. I then whipped up a script in no time. Here it is:

 #!/usr/bin/python

#mountcreatingdir.py

#Author:Shriphani Palakodety

import commands

index = 1

while True:

 dir = "/mnt/usbdisk" + str(index)

 string = commands.getoutput('mkdir %s' % dir)

 if string == "":

  continue

 else:

  index = index + 1

 device = raw_input('Enter the name of the device you want to mount: ')

 a = commands.getoutput('blkid %s' % device)

 import string

 number = string.find(a, " T")

 print number

 requirement = a[number+6:]

 s = commands.getoutput('mount -t %s %s %s' % (requirement, device, dir))

 print s

That’s about it.

May 15, 2007   No Comments