Tuesday, December 18, 2007

Using a SmartAX modem with a Linksys router for BSNL broadband

Modem -> Huaweii Sterlite SmartAX MT882 or similar
Router -> Linksys WRT54G Wireless Broadband Router or similar
Lan Card -> Some Ethernet card

This procedure is similar to the one here:
http://www.openfsg.com/index.php/Setup_the_FSG_behind_the_Talktalk_SmartAX_MT882_Modem/Router


Assume your modem (and LAN card) is already working with your BSNL broadband. You can find instructions to make it behave so elsewhere.
We will assume that default settings were used, i.e. - Username and password of "admin", Modem IP = 192.168.1.1

Lines like the one below show connections. Assume nothing else is connected. (Assume all devices are powered on).

Phone Line -- Modem -- Lan Card
From your modem configuration, if DHCP was enabled, disable it. Give a static IP of 192.168.1.100 and gateway 192.168.1.1 to your LAN card.
Nothing else needs to be changed.

Router's Port 1 -- Lan Card
Goto http://192.168.1.1 (now the router's config page).
This also has the username and password "admin" by default.
In Basic setup:
Internet Connection Type: 192.168.1.2
Subnet mask: 255.255.255.0
Gateway: 192.168.1.1
Static DNS 1: 192.168.1.1

...

Local IP Address: 192.168.2.1
Subnet mask: 255.255.255.0
...
DHCP Server: Disable

Save the changes.


Change the LAN card's static IP to 192.168.2.100 with gateway 192.168.2.1. The DNS can be the usual 61.1.96.69.


Phone Line -- Modem -- Router
Lan Card ----------------^

The internet should be accessible now.


To add a wireless node such as a laptop, in http://192.168.2.1 :
Goto Wireless -> Wireless MAC Filter
Enable it.
Choose Permit Only.
Click the Edit MAC Filter list and add the MAC address of the Lan Card on the Wireless node (laptop).
Save.

In the Wireless card settings, give a Static IP such as 192.168.2.150 with gateway 192.168.2.1. The DNS again can be the usual 61.1.96.69.


Things that might be handy:
The hardware Reset buttons on the router and modem. On the router (at least), press and hold the button for _at least_ 5 seconds when the device is ON. You can see some visible change in the lights on the front panel, after which point you can let go.

Wireless router bought

Bought a Linksys WRT54G Wireless Broadband Router for 2434/- from Binary World, 1st Cross, Malleshwaram (http://www.bwindia.com).
It has a 4 port Ethernet switch built-in and the wireless connectivity seems okay but it doesn't have a modem built-in (- you cannot connect your phone line directly to this), so I guess I still need to use my Huaweii router along with this.

Friday, December 14, 2007

Auto Slide Numbering in MS PowerPoint

A couple of macros for Microsoft Powerpoint XP to achieve correct slide numbering (given the presence of intermittent hidden slides) is available at http://dsl.serc.iisc.ernet.in/~abhi/ppt/Putslidenos.txt or below
under the GPL.

Steps:
1) Open the required presentation in Powerpoint XP.
2) Press Alt+F11 to open the MS Visual Basic editor.
3) Paste the entire putslidenos.txt file in the big window.
If the big window doesn't show up, right-click on VBAProject ..., and choose Insert->Module
4) Edit the constants (position, font, etc.) at the top as desired.
5) Close MS Visual Basic.
6) Save the .ppt.

7) Do whatever hiding etc. has to be done.
8) Select the first slide in the slide sorter (basically make sure nothing
on any slide is selected).
9) Choose Tools->Macro->Macros. Select PutSlideNos and click run. (Undo
still seems to work if the output wasn't nice.)
10) Save.

The first 6 steps are to be done only once. 7-10 is done after each edit (before the actual presentation).

Impt.: Note that with the default settings, the macro removes all textboxes of the form "number of number" before adding its own textboxes. If this might be a problem, change the settings as needed and/or save changed files into different files at step 10.



'
' Copyright 2007,2008 Abhijit P. Pai
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program. If not, see .
'
'User-settable constants

'~725 * ~540 seems to be the max x and y
'startx and starty are the starting x and y locations of the textbox
'showing the slide number
Const startx = 622#
Const starty = 495#
Const mywidth = 100#
Const myheight = 30#

Const myfontname = "Arial"
Const myfontsize = 10
Const starttext = "Slide "
Const midtext = " of "

'set this to True if you want to remove the old numbering before you add the new one, else False
Const RemoveBeforePutting = True

'End User-settable constants
'-------------------------------------------------------------

Sub PutSlideNos()

If RemoveBeforePutting = True Then Call RemoveSlideNos

'total number of slides
a = ActiveWindow.Presentation.Slides.Count

'total number of hidden slides
b = 0
For i = 1 To ActiveWindow.Presentation.Slides.Count
If ActivePresentation.Slides(i).SlideShowTransition.Hidden = -1 Then b = b + 1
Next i
nonhidden = a - b

j = 0
For i = 1 To ActiveWindow.Presentation.Slides.Count
ActiveWindow.Presentation.Slides(i).Select
j = j + 1

'-1 means true for this property
If ActivePresentation.Slides(i).SlideShowTransition.Hidden = -1 Then
j = j - 1
GoTo nexttry
End If

ActiveWindow.Selection.SlideRange.Shapes.AddTextbox(msoTextOrientationHorizontal,startx, starty, mywidth, myheight).Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1,Length:=0).Select
ActiveWindow.Selection.TextRange.Text = starttext + Trim(Str(j)) + midtext + Trim(Str(nonhidden))
With ActiveWindow.Selection.TextRange.Font
.Name = myfontname
.Size = myfontsize
End With
nexttry:
Next i

ActiveWindow.Presentation.Slides(1).Select
End Sub



Sub RemoveSlideNos()
For i = 1 To ActiveWindow.Presentation.Slides.Count
ActiveWindow.Presentation.Slides(i).Select
j = 1

While j
If ActiveWindow.Presentation.Slides(i).Shapes(j).TextFrame.HasText Then
t = ActiveWindow.Presentation.Slides(i).Shapes(j).TextFrame.TextRange.Characters.Text
If t Like starttext + "[0-9]*" + midtext + "[0-9]*" Then
ActiveWindow.Presentation.Slides.Item(i).Shapes.Item(j).Delete
End If
End If

j = j + 1
thecount = ActiveWindow.Presentation.Slides.Item(i).Shapes.Count
If j > thecount Then GoTo endwhile
Wend


endwhile:
Next i
ActiveWindow.Presentation.Slides(1).Select

End Sub

Tuesday, November 13, 2007

Monday, October 29, 2007

Rahmaan at IISc

IISc Gymkhana.
19th Jan, 2008.
A. R. Rahmaan.

You need a student identity card, of course.

Update: Event canceled. :-(

Sunday, October 28, 2007

Are we Making A Difference

"We will write only when we have a story worth telling. A story worth telling is one that might be the solution to a problem, and not the problem by itself."
Here: http://arewemad.net/

Saturday, October 20, 2007

Wikipedia: citation needed

The "citation needed" syndrome (look it up; also http://xkcd.org/285/ and
<CtrlAltDestroy> Here is my impression of Wikipedia.
<CtrlAltDestroy> "There are five fingers on the human hand [citation needed]"
lifted from a certain quote site) seems to have engulfed even the Wikipedians from Bengalooru...
Compare the current http://en.wikipedia.org/w/index.php?title=Bangalore&oldid=165645750#Media
to the older
http://en.wikipedia.org/w/index.php?title=Bangalore&oldid=96076951#Media

Friday, September 28, 2007

Imaginary scores

(11:27:14 PM) Srikanth: dude your BB guesses are getting more and more interesting
(11:39:52 PM) Srikanth: we should probably start up an imaginative answer section :)
(11:40:07 PM) Abhijit: yeah.. scores should be a+bi
(11:40:11 PM) Abhijit: instead of the usual a
(11:40:20 PM) Abhijit: what a concept !

(Blogged for copyrighting, IPR, patenting etc..)

Wednesday, September 26, 2007

Once bitten, twice shy

A [side] effect of playing psychological pranks on people (see: http://abhijitpai.blogspot.com/2006/09/orkut-birthday-reminder-psychology-test.html) is that this time, I didn't get a single wish scrap on Orkut on my B'Day, and just one belated. Or perhaps the Orkut fad has waned (- I did get a lot more phone calls).

Typo in a permalink

I try to correct any error - typographical, grammatical or otherwise on my blog whenever it is brought to my notice (- not that this has happened many times ;) ). But a typo in a "permalink" (first pointed out by Srikanth) of a post on which people have already commented seems impossible to rectify. (Look [carefully]: http://abhijitpai.blogspot.com/2007/09/mrsit-changed-timings.html)

Tuesday, September 11, 2007

MSRIT - Changed timings

No, college (MSRIT) does not start at 8:30 a.m. instead of the usual 9.

The working hours are still 9 to 4:30, but, from the 10th of September, classes are now 55 mins (instead of 1 hour), there's a tea break from 10:50 to 11:05, and lunch is 12:55 to 1:45 (50 mins instead of the earlier half-hour).

Nice. And there seems to be some connection with the latest-joined batch joining under autonomous rules.

Saturday, September 08, 2007

Getting Vim to print increasing numbers

One of the many things I was yet to learn how to do with Vim was to generate simple increasing sequences, which could be used if I had to do something like:

From:
hello x y z

To:
hello1 x y z
hello2 x y z
...
hellon x y z


Simple copy-paste would give me n identical hello x y z lines. Then I'd have to manually enter the subscripts. So, I decided to write Vim commands that would let me print numbers from 1 too 100 in my document. The commands are as follows:

:let x=1
:map :execute "normal a" . x . " ":let x=x+1


:let i=1
:while i<=100
: execute "normal " . "\<F8>"
: let i=i+1
:endwhile

The first two lines let me get the next number after the current cursor position when I press F8. The last four give an effect of 100 presses of F8.

Should work with Vim 6.3 and above.

Refs:
http://vimdoc.sourceforge.net/htmldoc/usr_41.html

Sunday, August 05, 2007

Interesting trivia about the history of ERNET

  • ERNET started with a dial-up network in 1986-87.
  • Initially, UUCP mail was only service started by ERNET.
  • First leased line of 9.6 kbps was installed in Jan’1991 between Delhi and Mumbai.
  • ERNET was alloted Class B IP address 144.16.0.0 by InterNIC in 1990. Subsquently, Class C addresses were alloted to ERNET by APNIC.
  • All IITs, IISc Bangalore, DOE Delhi and NCST Mumbai were connected by 9.6 kbps leased line by 1992.

  • In 1992, a 64 kbps Internet gateway link was commissioned from NCST Mumbai to UUNet in Virginia near Washington D. C..
...
From:
http://www.ipv6.ernet.in/deepaksingh.ppt (c. 2005).


Also:
IP Ranges:
NCSI 144.16.72.129 to 144.16.72.189
IISC 144.16.64 to 144.16.95
From:
http://144.16.72.147/gsdl/collect/tracol/index/assoc/HASH014d.dir/doc.doc (Dated: 2000-2001)

Saturday, June 23, 2007

"Sleep"ing in Win XP (batch files)

All examples using choice(.com) which would be among the first hits on a search don't work because Windows XP doesn't come with choice.com by default. Solutions are to get it from Win9x, a (WinNT/2003Server) resource kit, or off the MS site; or to use QBasic or a ping trick such as: ping 127.0.0.1 -n %1% -w 1000> nul

But the best solution I could find that works straight out of the box is:

@echo off
echo Starting!
echo Wscript.Sleep 10000> sleep.vbs
start /w wscript.exe sleep.vbs
echo Done!
del sleep.vbs
Off:
http://www.ericphelps.com/batch/samples/sleep.txt

As mentioned there:
1) Millisecond accuracy.
2) No 100% utilization of CPU i.e. no for(i = 1 to 1 billion) loops.

Wednesday, June 13, 2007

Foolishness and recovery

(Warning: Some background knowledge about the working of CVS is needed to understand this paragraph.) One of the few ways to kick yourself in the foot with CVS is to create a new file (in this case, a .java); forget to add it to the CVS; commit the other files; and then try to test if the build works by deleting the whole folder and checking out again there.

Short story short, three hours of hard (copy-paste) work was going to go down the drain. The file had gone; I had to recover it.

Google. The first result was this supposedly oft-used program called DiskInternals Uneraser available from http://www.diskinternals.com/. The program took quite some time to scan the partition and then did find the deleted .java and .class file, but said it needed the paid version (~10$) to actually recover them. Searching for a crack (using a GNU/Linux box, of course) was in vain. Some site actually made me download a .zip and then had a file in it which read:
S/N: Evalution

I searched some more and found:
http://www.ntfsundelete.com/
A nice piece of gratis software from a company known as Atola Technologies, this product did the job well. It scanned through the disk faster, had a better interface than the DiskInternals Uneraser, and managed to try to recover the files without any payment of any sort. It turned out that the .java file couldn't be recovered fully, but the .class file could. But I did need the source. Then comes another gratis software cavaj (downloadable from http://www.bysoft.se/sureshot/cavaj/) to the rescue. Cavaj gracefully created the .java from the class file, and this .java was almost compilable. Just a one line change, and I had my file back!

Friday, May 25, 2007

Quote for the day

The coding starts and the coding stops but the bug-fixing goes on forever - Abhijit Pai.

Thursday, May 17, 2007

Ubuntu 7.04 ships home

Got my free Ubuntu CD's today in my postbox.
Release date: 19th April, 2007.
Order date: 21st April, 2007.
Delivery date: 17th May, 2007.

Monday, May 07, 2007

Hoarding war between airlines

A great snap (taken in Delhi).
Courtesy and Copyright: Deccan Herald (Bangalore Edition, 7th May 2007, Page 10)

Hoarding

Wednesday, April 18, 2007

Seasons

Two days before Sankranthi (Jan 14th 2007 if I remember correctly), there was a noticable shift in temperature indicating the change of season from winter to summer.
And now, two days before Vishu/Bihu/Baisakhi, on the 11th of April, it rained for the first time this year at Bengalooru. The first evening it didn't rain so heavily, but the second evening had people witnessing an amazing amount of lightning strikes, thunder and a somewhat heavy downpour. There was so much lightning that I manage to capture some of it.

Look here:
http://www.youtube.com/watch?v=w3z_n4A_2n8

http://www.youtube.com/watch?v=IOv2S6Ipdk0


As a technical note, I used VirtualDub to time-crop, remove the audio and slow down and rotate the video to 1/3 of the original speed it would have played at otherwise.

Time-cropping is done using Video->Select Range (don't worry about the end-offset not totalling to start-offset + length - just set the latter two correctly in milliseconds and it should work fine).

Audio removal is done by just selecting Audio->No Audio.

Slowing down is done by changing Video->Frame Rate->Source rate adjustment and selecting Change to ... frames per second where ... would be 15,10 etc. depending on how slow you want the video to be (if the input video is at 30 fps, say).

Rotation of the video (to the right by 90deg) is done by choosing it in Video->Filters->Add->Rotate.

Friday, April 06, 2007

Bank account for the day

[Useless post; for the author to show-off]

In the pic:
One bruised Savlon and Betadine smeared elbow.
One good-looking complimentary watch with a cracked glass.
One oft-worn non-expensive full sleeves shirt now which now needs conversion to half sleeves.
One 2-wheeler mirror (partly visible) broken where is was screwed to the rest of the 2-wheeler.

Bank account for the day

Maybe I should try slowing down at the turns.

Friday, March 30, 2007

AJAX Rot-13 demo

[Technical]

If you don't know what AJAX is:
http://en.wikipedia.org/wiki/AJAX
http://www.w3schools.com/ajax/default.asp

The demo just uses AJAX and CGI (perl) to Rot-13 convert whatever you type in the input field as you keep typing/changing it. The host machine is quite slow, so there might be a considerable delay before you see any change to the output when you're typing.
http://people.csa.iisc.ernet.in/abhijitpai/ajaxdemo.htm

The code of the ajaxdemo.htm and rot13.cgi are pasted below for reference. W3schools holds copyrights of a sizeable portion of the code; but I do think they intended learners to actually use their code; so, I did.

rot13.cgi



#!/usr/bin/perl
use CGI qw(:standard);

$data=param("str");
print "Content-type: text/html","\n\n";

#open(F,">>xx") or die("");
#print F $data;
#print F "\n";
#close(F);

for($i=0;$i<length($data);$i++)
{
$n1=ord(substr($data,$i,1));
if($n1>ord('z') || $n1<ord('A') || ($n1>ord('Z') && $n1<ord('a')))
{next; #C's continue
}

if($n1<=ord('Z'))
{
substr($data,$i,1)=chr(
(
ord(substr($data,$i,1))-ord('A')+1+13
)%26
+ord('A')-1
);
}
else
{
substr($data,$i,1)=chr(
(
ord(substr($data,$i,1))-ord('a')+1+13
)%26
+ord('a')-1
);
}
} #end of for loop
print $data;



ajaxdemo.htm



<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
<title>Ajax demo</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
</head>

<body>

<script type="text/javascript">
function getxobj()
{
var xmlHttp=null;
try
{
// Firefox, Mozilla 1.0(+?),Netscape 7(+?) Opera 8.0+, Safari 1.2(+?)
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{ //IE 6+
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{ //IE 5.5+
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
return xmlHttp;
}

//global
var x;

function mystatechangedfn()
{
/*
0 The request is not initialized
1 The request has been set up
2 The request has been sent
3 The request is in process
4 The request is complete
*/
if(x.readyState==4)
{
//print in perl (after Content-type), echo in php
document.getElementById("myform").resul.value=unescape(x.responseText);
}
}




function docalc()
{

x = getxobj();
x.onreadystatechange=mystatechangedfn;
var url="rot13.cgi?str="+escape(document.getElementById("myform").inpu.value);
//alert(url);
//3rd argument is true if the call is asynchronous.
x.open("GET",url,true);
x.send(null);
}

</script>

<!-- action is needed for xhtml 1.1 compat. -->
<form id="myform" action="">
<!-- onkeydown, call can be with (this.value), but even if not
I can access it as document.getElementById("myform").inpu.value -->
<p>
Input: <input type="text" onkeyup="docalc();" name="inpu" />
Output: <input type="text" name="resul" />
</p>
</form>

<!-- <p>Suggestions: <span id="txtHint"></span></p>
In code: document.getElementById("txtHint").innerHTML="Blah";
-->


<p>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml11"
alt="Valid XHTML 1.1" height="31" width="88" /></a>
</p>

</body>
</html>


Monday, March 26, 2007

The brilliance of BSNL

My BSNL land line is currently "dead". If I try calling it, I hear the ringing tone. None of my phone-sets ring though; and the caller ID displays are blank. What's brilliant ? The net connection through the same line still works; and it's that line which I'm currently using to type in this post. And it's not a "almost there" internet connection as well. I ran a test at BandwidthPlace and it showed 661.1 kilobits per second, which is about the speed I usually get. (Of course, the phones etc. are connected properly.) This problem had occured earlier too, and had then got sorted out automatically in the course of time (without me complaining).

Update: Phone is fine now after 3+ weeks - apparently "the computer had not registered the complaint" the first time we registered one.

Sunday, March 18, 2007

Abhijit P Pai, B. E.

My degree certificate arrived home at 10:55 a.m. today by Speed Post. It's a laminated sheet, but it's thinner than the marks cards VTU gives. Thankfully, it arrives in a (somewhat) thick blue file which ensured that no damage was done to it in transit.
The rank list (and convocation date) was announced on Feb 7th 2007 was generally known by around Feb 14th. The convocation was on the 25th of Feb in Belgaum, and ordinary (non-rank-holding) students in Bengalooru had started getting their degrees by March 10th.

Saturday, March 10, 2007

Reclaim your GNU/Linux

[Technical]

One of the most common problems that people face with multiple OS's - Windows and GNU/Linux is that the boot loader (Grub) disappears upon re-installing Windows.
This also happens if you have Tux installed in a second hard-disk which you later decide to make your sole hard disk.

For LILO, earlier, with certain versions of Mandrake etc., I used to go through all steps of the installer but the last part where it copies the files (asking it not to make any changes to the partitions), by which time LILO is written on the MBR, after which I boot to Tux and modify its settings.


This is the solution for Grub which works on FC5 (and possibly all other FC distros):
http://www.fedoraforum.org/forum/showthread.php?t=975

For point 4 there, just choose the "Continue" button so that it autodetects.

After this, if the system reports that certain parts only have been mounted into /mnt/sysimage, you might not be able to install Grub on the MBR successfully.

So, vi /mnt/sysimage/etc/fstab or /etc/fstab if you have chroot'ed as mentioned there.
Correct it so that only partitions and drives which actually are present correctly are mentioned.
In the first column of each row, if you have something like "LABEL=/", correct it to the actual device name - i.e. something like "/dev/hda6".
Reboot and repeat; if your hard disk is still ok, most probably the autodetection will come out clean.

Wednesday, March 07, 2007

Change of CPU

One more trip to S. P. Road, this time to Rajshri Computers Inc. for:

Asus M2N-MX Motherborad - Rs. 3650 + 4%
Athlon 64 X2 Dual Core 3600+ Microprocessor - Rs. 4350 + 4%
Transcend JetRam 533 Mhz 1GB (240 pin) DDR2 SDRAM - Rs. 3400 + 4%
Frontech ATX Cabinet with SMPS - Rs. 1400 + 4%
for a total of 13,312/-

Update: I didn't test it then and it didn't work when I got it back home. The fan was rotating for about two seconds and then stopping each time I pressed the Power button.
One more trip to S. P. Road. The heatsink-fan hadn't been inserted correctly. When he corrected that, he found no display still - that was because the RAM module was faulty (shared display RAM, remember); a replaced RAM chip and finally something on the screen.

It's working quite fine now.

Thursday, March 01, 2007

DVD writer bought

I bought a Sony DRU-170C DVD writer (Sony DVD RW AW-G170A) from Metro Computers, P. R. Lane, (off S. P. Road) today for 1820/- (Rs. 1750 + 4% V.A.T.).

Notes:
a) Can write almost every DVD format conceived including DVD-RAMs. (At least, the specs give me that impression.)
b) 4 screws provided.
c) Black on my beige cabinet. (I asked a couple of shops and they didn't have white DVD?RWs at all), (this cabinet will go soon.)
d) No printed manual - on the CD only.
e) One year limited warranty seems to be available only in the US and Canada.
f) Nero Essentials only provided on the CD (apart from the manual) - yet to see what software this comprises.
g) No P-ATA or digital audio cable provided.

I also picked up some blank DVDs from Ankit Computers, S. P. Road:
150/- for a ten-pack (with hard plastic cover) of Master 16X 4.7 GB DVD-Rs.
85/- for a Moser Baer 4X 4.7 GB DVD+RW.

Friday, February 16, 2007

Flash memory stress test

My 128 MB Rundisk 2.0 flash drive somehow chose to remain in the pocket of my shirt when it was put for wash. Needless to say, it spun for over 1 hour 15 minutes in soapy dirty water, and I noticed it along with some unidentifiable shredded pieces of paper when I was hanging it out to dry.
Surprisingly though, it still manages to work just like before. I've dropped the drive multiple times from over 4.5 feet before, and put it inside my bag where it lay between all sorts of other hard non-electronic devices and managed rough handling that even my bag couldn't. But this, really, is some sort of a benchmark that it has managed to come clear of.

Sunday, February 11, 2007

BSNL's removed the upload cap too

[For ISP enthusiasts]

Background: I've a BSNL Dataone Home 500 connection.

(Feb 11th 12:50 p.m. - Upload to YouTube)

The indicator on the website was showing 52-53 KiloBytes/sec.(steady over minutes). I timed and found that 1 Megabyte gets uploaded in ~19 seconds (- If the 64 kbps upload cap was still on, it would have taken at least 120 seconds). This means BSNL has removed the upload cap too.

Note: Download tests from http://www.bandwidthplace.com/speedtest since Jan 1st, 2007, when BSNL removed the cap, have shown me results of 1 Mbps lots of times (~128 KBps for download), and at most other times, show respectable values between 270 Kbps and 1 Mbps. Earlier, whenever the connection was available, I almost always used to get the promised 256 kbps / 64 kbps speeds (~31 KBps download speeds).

Thursday, February 08, 2007

Scripting e-mail sending

[Technical]

For a long time, I was trying to find a way of sending e-mail from the command line, so that I could script/cron it. The alternative available was to write a Perl script to do the same, but I was too lazy to do so.
After trying hard and failing to understand sendmail, and not even finding a proper copy installed anywhere on the IISc LAN, I tried acheiving the result with Pine and failed too.

Mutt proved to be the saviour.

Steps (- substitute all italicized content appropriately):
1) Create a file henceforth called in with the following content:
To: bob@domain.com
Subject: Test message
Dear Alice,
...
Bob

You can add other fields such as BCC: etc. as well. Only the To: field is compulsory, the subject and body are not.

2) Run:
mutt -a attachmentfilename1 -a attachmentfilename2 -H in </dev/null

That's it.

Monday, February 05, 2007

February the Fifth, 2007

Most shops were closed, even those which were open were half-closed. Pizza Hut Basaveshwaranagar was a funny sight, its glass outer walls completely covered from the outside with thick opaque paper, an A2 size framed garlanded color photograph adorning the closed entrance; it had tried to do its best. The police security was tight in the areas that mattered. Many rowdy sheeters had been arrested or detained the day before, this time before they could cause any damage. Every vehicle on the road bore a KA registration. Recently tarred roads were a boon for the desparate few trying to get home, as also a playground for the bold few who wanted to test drive their vehicles. Schools had closed early; offices had driven their employees home. The political parties this time had all agreed violence wasn't the right option.
The Cauvery tribunal had passed its final order.

Pizza Hut closed

By the time I took this photo the next day morning, the thick cardboard paper had turned into black tarapaulin. I did see a few employees sneaking inside in the afternoon; how can they do without their daily bread ?

Saturday, February 03, 2007

The making of the Passport

28th Dec 2006 (evening) - Book date online for passport office visit.

2nd Jan 2007 - Appointment for 2:51 p.m.
2:30 p.m. - Reach Passport Office, Brunton Road.
2:30 - 2:45 p.m. - Sit outside the building (in the compound).
2:45 p.m. - People allowed to enqueue (appointment is a farsical term, but at least the queue will be short).
3:25 p.m. - Verification and payment done for me. (They do accept even D.D. though they say they take only cash!)

8th Jan 2007 (afternoon) - Call from Basaveshwaranagar Police Station to come with documents and 2 photos.
5 p.m. - Reach police station.
5:30 p.m. - All form filling/verification done by them, and I've signed on it.
5:30-7:30 p.m. - Wait for Inspector to arrive.
7:45 p.m. - Done with his signature.
Note: No bribes asked, nor paid.

13th Jan 2007 - The light on the status page changes from red to green, indicating "Your Police Verification report has been received by us, and your file is in line for further processing.".

30th Jan 2007 -
"You have been allotted a passport number and the file has been line for printing of your passport.The anticipated date of dispatch of your passport by post is 8/2/2007". It shows some of my personal details and says "Applicants are requested to check their personal details indicated above for any errors... "

2nd Feb 2007 - "
Your Passport has been issued and sent to you by speed post on 01/02/07 vide Registration number EE317657664IN"
Afternoon - Postman comes with my passport; I'm not at home, so I've been asked to collect it at 9 a.m. on the next day from the post office.

3rd Feb 2007
Morning -
I forget to go to the post office.
12:15 p.m. - I remember and go, but I'm told the postman has left for his round.
3 p.m. - Ding dong. Yay!

Friday, February 02, 2007

Journo Snippets

A Rs. 25 (export-quality stickered) medium-sized apple only looks expensive until you spend Rs. 40+tax on a mediumly large piece of not-really fresh Black Forest cake at Cafe Coffee Day.
A Rs. 70 zip fastener change on a jacket still has no competitors though, especially if it turns out to be just as it was before the change after moving a couple of days ahead in the temporal dimension, my handling notwithstanding.

Sunday, January 28, 2007

Snippets

Heard on a reputable English news channel - "Channel 4 has admitted that the racial controversy has saved Big Brother from becoming the most boring television show ever."
(http://news.bbc.co.uk/2/hi/entertainment/6297969.stm)

From http://en.wikipedia.org/wiki/Who_Wants_to_Be_a_Millionaire%3F#Other_countries:
'Ukraine: As in Russia, there is no "Ask the Audience" because the audience gives wrong answers in order to deceive contestants.'


Source: http://en.wikipedia.org/wiki/Bharat_Ratna
Zero people have got the Bharat Ratna in the last 6 years.
Nice.

From http://en.wikipedia.org/wiki/Priyadarshan#Accusations_of_plagiarism
Other films accused of plagiarism are Vandanam (39 Steps), Boeing Boeing (Boeing Boeing), and Vettom(French Kiss). His latest film Bhagum Bhag seems to be a conceptual lift of "Run Lola Run".

Friday, January 19, 2007

Pranked

[Irrelevant to the general public]

Last night, just after I had turned off the computer (which would almost always mean I was turning in for the day), I got a SMS message from a good friend:
"Hi, I Know this may seem shocking n surprising 2 u.But ur invited 4 my engagement on 29th of next month. Venue- Hotel kamath,jlb road Bangalore. Plz do come.."

She was out of station and was supposed to be back only the next day or after that. So, when the SMS came, it was already something out-of-the-ordinary (- to put things more in context, she doesn't really go out of station every two days). She's around 22, most probably from a family tending to be conservative, and her marriage was far-fetched, yet possible. I knew that there was no serious plan of her being married off yet, but I did know parents of other girl peers were looking for suitable grooms for their daughters.
The first thing one thinks of after having received hundreds of SMS's is "Ok, this is another prank.".
The other half of my partially sleep inebriated brain thinks, "Yes, this is possible.".

I fire off an SMS asking whether she's got back to Bangalore. She says she got back home 5 minutes ago.

So, I do my syntax analysis - check the SMS for large gaps after the starting message before the oh-so-climactic giveaway - there are none.

I do my first level semantic analysis - Is she talking about herself .. yes.. Is 29th is a valid date ..yes.. next month is a valid month.. Kamath.. valid hotel.. Bangalore.. possible.

She'd been to Tirupathi and (some) Hindus do visit temples before they do auspicious things - case in point: visits of the Bachchans and Aishwarya before the (future) marriage of Abhishek and Aishwarya. The possible part of my brain thought about the possibility of the two families going there together, the auspicious date turning out to be early, and them getting back abruptly to immediately commence the preparations.

(You can stop laughing now.)

Now, I've to decide the next question to ask. I don't surely know whether the lucky? guy is of her choice or her parents, though I believed the latter was more likely at that point. Asking "Who's the guy?" wouldn't be correct. I couldn't have also asked "Really?", "How come?" or act totally surprised, because of reasons which would take about three paragraphs to explain. So, I ask whether the guy is from Bangalore. She says he's from Switzerland and is a doctor. Doctor, I'd immediately buy at that point. Swiss - a little too far fetched.

The prank part of my brain tells me to finally run a second level semantic check - there had to be something missing. I read the SMS again, put it in the brain memory and began its execution parallelly, and begin thinking of a reply to the next SMS - by the time I get the return value from this process - asking if she would go to Switzerland after marriage; the other process tells me the flaw.
...


Applause to the person who formulated the SMS.
Special applause to the person who sent the SMS to me at exactly the best ever instant she could have in time (whether or not it was inadvertant).

Random quote I conjured up: It's an art to play a good prank; though, like art, sometimes what you paint turns out better than you thought it would.

Thursday, January 18, 2007

Solitaire Bug

My brother has played enough Solitaire for a rare (easter-egg like) occurence / bug to surface today.

This is an un-edited cropped screenshot saved as a JPEG.
The Five of Diamonds has been moved somewhat with the mouse (click-and-drag) to show that there are no cards beneath it. Note: There are no other closed cards.

Missing 2!

The Two of Diamonds is missing.

Tuesday, January 16, 2007

Think before you partition

[Technical]

This is how Fdisk's report of my secondary (as of now) hard disk read:

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1216 9767488+ b W95 FAT32
/dev/hda2 1217 6079 39062047+ 5 Extended
/dev/hda3 6080 7991 15358140 83 Linux
/dev/hda4 7992 8150 1277167+ 82 Linux swap / Solaris
/dev/hda5 1217 6079 39062016 b W95 FAT32

Now, I had to create a new NTFS partition to run PostGRESQL from Windows.
This is impossible in the current scenario because a (almost any) system can support a maximum of 4 primary partitions and exactly 1 extended partition. Anyone good with partitioning will recognize this scenario a big headache (to convert this into a proper partition table with no space wasted; I don't believe in partition resizing tools - better slow than data loss). All I've left to do now is to move data from my 30 GB partition into my 10 GB one, tar and move my Linux home folder, and then trash and recreate the whole extended partition and install FC5 again.

Thursday, January 11, 2007

Downloading streaming video in Firefox

Video Downloader - Download videos that are streamed by YouTube and Google Video, among many others.

Link: https://addons.mozilla.org/firefox/2390/

What if the video is on some other page; say, a blog ?

1) View the source of the page.
2) Search for video.google
3) Remember the part
docId=-2801785420316066705 (where the number will be different, most probably).
4) In your browser, go to:
http://video.google.com/videoplay?docid=-2801785420316066705
(substiture the number from above).
5) Click on the VideoDownloader button near the bottom right corner of the Firefox window.
6) In the popup which appears, choose the type of video you want to save, and save it.

Friday, January 05, 2007

Blog vs. Journal

From http://www.diarist.net/guide/blogjournal.shtml:

... traditional weblog is focused outside the author and his or her site. A web journal, conversely, looks inward — the author's thoughts, experiences, and opinions.

-- Ryan Kawailani Ozawa

A weblog (blog) is a webpage where a weblogger (blogger) 'logs' all the other webpages she finds interesting.

-- Jorn Barger, Weblog Guru