Wednesday, July 20, 2011

Applying for a passport: Tips

Here are some tips for anyone applying for a passport in India. (Note: Some of these tips are specific to Bangalore.)
  • Apply for passport online at www.passportindia.gov.in
    • I found some bugs in the online form; so I downloaded the editable pdf (called eForm) from the site and filled it up. You need Adobe Acrobat Reader for this (Evince etc. might not work).
    • Print out the application receipt; it has all the main details of the application, and has to be shown at the entrance.
  • Book an appointment slot online at your preferred Passport Seva Kendra (PSK). Slots become available for online booking at 8 am. Login at 7.56 am and start trying. [Thanks to Prasad, for the update on the new times!]
  • Documents required:
    • Use the site to find out. But, dont stop there. Call the toll-free number to check if the rules have changed recently. 
      • E.g. I was asked for two adress-proofs, instead of one. I had to go back home, just for that. If you are using an annual bank statement as proof, ensure it has the seal and signature from the bank. I used the annual statement that comes by post, which is printed on the bank letter-head, and has no explicit seal or handwritten signature. (They finally accepted it, but only reluctantly. Also, in the spirit of bargaining, they kept the original statement itself, rather than a photocopy.)
  • At the PSK
    • Try to get a 9 am appointment. Later slots tend to get crowded by slowpokes from earlier slots, and it all snowballs.
    • Try to go earlier than the mentioned reporting time. There is a single queue at the entrance, where people are redirected to counters, and the earlier you get to a counter, the earlier you get a token, and the earlier you will come in the rest of the queue.
    • Do not carry laptops/USB sticks, or other electronics (cell phones were allowed when I was there), as you might have to leave them outside.
    • Steps
      • Go to counter (there are separate ones for Tatkaal and Normal; ask at entry, the Tatkaal counter might be less crowded). Get your documents checked. Get the token number. It will be printed on a small sheet. Keep this safe; you need it till the end.
      • Go inside, and wait for your token's turn. Large displays will indicate when it is your token's turn, and also the counter to go to.
      • First, you go to an A-counter, get the docs checked and pay the money. You get two copies of the receipt, one for you, and one that goes with the file. Keep both safe.
      • Then you again wait, looking at the displays, and go to a B-counter, where your documents are checked again. Finally you go to a C-counter, where your documents are checked again. The official stamps your old passport (if any), and tells you to leave.
      • Look for a counter where you get the acknowledgement for the passport application. Show your copy (the Applicant's Copy) of the receipt and get the acknowldegement. Go to the exit, return the token to the security guy, and leave.
    • I was there from 11am till 4pm. I got hungry, and ate a burger there. I had some stomach problems after that. You might want to take some food and water when you go there.
    • It can be a long wait. You could carry a book or something to kill the time, but you have to watch the displays alertly. I dont know what happens if you miss the chance.
    • When I was coming out the PSK at 4pm, the police were carting away two-wheelers parked in the 'No Parking' area in front of the PSK. Ensure you park your vehicle in a safe place before you enter the PSK.

Monday, July 11, 2011

Marriage Registration Procedure

In India, in order to register your marriage, do this:
  • Get the following (with photocopies)
    • identity proof (for both husband and wife)
    • age proof (for both husband and wife)
    • address proof (for both husband and wife)
      • only one of these needs to be within the jurisdiction of the registrar office you are going to.
    • marriage proof (photograph of the ceremony, or the wedding invitation)
    • Three witnesses
      • Any 3 witnesses will do, but there should be at least one from the husband's side, and one from the wife's side.
      • They should come with their photo ID.
    • 5 Photos
      • Should be a joint photo of husband and wife.
      • B5 size (double of passport size) 
  • Find out the location of the Sub-registrar office in the area of your residence (there might be problems of jurisdiction; call and confirm if that office is the right one).
  • Call them and confirm that the list above is correct and sufficient.
  • Find out when the office opens, and go there early (usually 10 to 10.30 am).
  • You will have to spend some time filling forms. (They are also available online. You could print them out, fill them at home, and take them there. But the rules/forms might have changed in the meantime. So, don't expect that things will go smoothly.)
  • Submit all forms and documents; wait while they make the marriage certificate.
  • They will ask for "Charges/Fees", but may not give the receipt; be careful about that. You could ask beforehand if they are going to give you a receipt for the whole amount that they quote as "charges".

Friday, July 8, 2011

Location of LaTeX packages

Directories where latex looks for packages:
/usr/local/share/texmf/ls-R...
/var/lib/texmf/ls-R-TEXMFMAIN...
/var/lib/texmf/ls-R-TEXLIVE...
/var/lib/texmf/ls-R...

Command to update tex about where to look for packages : texhash <new locn>

To add a .sty file where latex can find it, do
$ kpsewhich -var-value=TEXMFHOME
/home/gtholpadi/texmf
$ cp mystyle.sty /home/gtholpadi/texmf/tex/latex/local
"tex/latex/local is usually reserved for stuff installed on individual machines" (from here).

Wednesday, June 29, 2011

Using Zotero

  • Install Zotero add-on in Firefox.
  • Go to Zotero Preferences.
    • Set username, password under 'Sync'.
    •  Untick 'Sync automatically', 'Sync attachment files...'
    • Set Data Directory Location under 'Advanced'.
  • Copy citation from web page into clipboard; Choose 'Import from clipboard'.
  • Add note; add attachment (stored copy of file).
  • In the note, add a line containing labels or search terms for which this paper should be found.
  • Drag and drop paper into 'Research'; delete the entry under 'Import Wednesday...'.
  •  Read paper; edit note.
  • Click the sync button.

Sunday, May 22, 2011

Using tar and gzip

To tar a list of files/directories, do
tar -cf mytar.tar file1 file2 dir3 file4
To add more files to this, do
tar -rf mytar.tar file5 dir6 dir7
To list the contents of the tar, do
tar -tf mytar.r
To delete files from the tar, list the contents, do
tar --delete -f mytar.tar file1 dir2
using the exact path as given in the `list contents' step.

To compress the tar, do
gzip -c mytar.tar > mytar.tar.gz
To decompress the file, do
gunzip -c mytar.tar.gz > mytar.tar

To extract files from the tar, do
tar -xf mytar.tar file2 dir3
To extract everything, do
tar -xf mytar.tar

To simultaneously tar and compress, do
tar -czf mytar.tar.gz file1 dir2 file3
To simultaneously decompress and extract, do
tar -xzf mytar.tar.gz
(Note: Additions, using tar -rf, are not allowed for compressed tar files)

Friday, May 20, 2011

Using wget

Full Site
To download a full website, do
wget -c -w 15 --mirror -p -k -P /path/to/dir http://my.website.com -a my.log
This will download the entire website, waiting 15 seconds between retrievals. It will copy everything needed to show the page correctly (-p), convert links for local viewing (-k), store the files in /path/to/dir (-P), and write (append) messages to my.log (instead of the console). If stopped in between, run this command again, and it will start where it left off (-c).

Add --spider at the end to do a dry run first.
Add --random-wait to vary the wait time (for sites that block automated downloading).
Add --limit-rate=20k to limit download speed to 20 kilobytes per second (an example politeness limit; use your discretion).

Courtesy: this, this and this.

Small part of site
To download a small part (e.g. a given page and its first-level links) to the current directory, do
wget -c -w 3 -a my.log -r -l 1 -p -k http://somesite.com/interesting/link.html
This will download the page link.html and all links in it (-r), but will not recurse further to links of links (-l 1).

A URL list
To download a list of files specified by URLs, do
wget -c -w 15 -i urls.txt
This will download all URLs listed in the file urls.txt.

Thursday, April 21, 2011

Backup and Restore using rsync

I backup my data onto a second hard disk in my PC, like this:

rsync -av --delete /disk1/my/data /disk2/backup > backup.log 2> backup.err

This creates a folder called data in /disk2/backup and copies the contents of the folder /disk1/my/data to it.

If I rerun this command, it will copy only the changed files/directories from /disk1/my/data into /disk2/backup/data.

Restore is simple; /disk2/backup/data is like a mirror. Just browse and copy back whatever is needed.

Note: Using /disk1/my/data/ (with the trailing slash) instead of /disk1/my/data does not cause the directory data to be created. The contents of data are copied directly into backup.

For a one-time copy to an external hard disk, I did this:

rsync -avW --no-compress --delete --modify-window=2 /path/to/src  /path/to/dst > bakup.log 2> bakup.err


Compression is useful for network transfers but can be skipped for local copying. The 'modify-window' option was required since the destination was on an NTFS drive, and there could be time stamp issues when copying from ext3 to NTFS. The 'W' option (copy whole files) might speed things up since partial file transfer need not be supported.