Category Archives: Tech

Well, I return to blogging after a long time and this one is on a request from  one of the very few people who bother to read the crap here  :D And this mostly-plagiarized post is, perhaps unfittingly,  dedicated to him and the good times and long bulla-sessions, we have had on IITK campus. It has indeed been an honour to know you GS :)

So, first I reveal a small trick which I found out today. Not a great discovery but a very useful one. My /home partition drive suddenly swelled to 100% and I was clueless as to what happened. It took help from another friend to figure out to use the du command to understand where has the space been consumed. But, the question was which flags and options to be used along with it. And, I think I have found out a pretty decent way to do that. Here’s the command:

    bash$ du -h --time --max-depth=1 --time-style=full-iso /.../sample_dir

Let me briefly describe what this does. It outputs the hard-disk size, modification date and time of all the sub-directories at first hierarchical level inside the directory sample_dir. The file-sizes are in easy-to-understand units :) In this way, you can figure out which directory looks suspicious by its file-size and then go on to inspect that particular sub-directory. Ofcourse, I succeeded in finding that out the culprit Adobe Acrobat (~/.adobe/Acrobat/), which swelled to around 6.5 GB (it’s not a typo :D ), mainly due to simple word searches in an e-book and such things :O:O

Next is somewhat more common problem and something that took me around 1.5 years to figure out — the pain that Firefox causes when you have something around 30-40 tabs opened and surf for atleast around 12 hours a day :P :D I continued with it for want of a better browser and could hardly find one which seemed more convincing and also easy to install. Many of my “Windows-friends” insist that I should simply give up on Linux and start using Windows. Sample this:

    A windows devotee: well agar tu windows use karta toh problem hi nahi hoti
    me (cutting him short): toh main 1-1.5 saal mein bhi nahi jaan paata ki problem kya hai. infact yeah u r rt … main actually kabhi yeh sense hi nahi kar paata ki thr is a problem :D :D

I confess I’m not that big a nerd to be knowing the details of either Windows or Linux well, but a priori it seems to me that Linux is the choice to go for, anyday ;) Anyways, so firefox would take hell lot of time to start and also become unresponsive quite frequently. On my tweaking-spree today, I decided to check the file-size change that happens to ~/.mozilla just like ~/.adobe, when one is using Firefox and I again found out its size to be somewhat larger than expected. In particular, I located 2 files places.sqlite and urlclassifier3.sqlite (I’m using Firefox 3.0.10 presently), which seemed to be of uncharacteristically large size; 35 and 33 MBs respectively. I googled up and after reading similar rantings on few forums landed up on this gentleman’s page. What he tells is that, to the best of my understanding, there is pretty appreciable amount of web-garbage that accumulates in those 2 files, over time. And it contributes towards slowing firefox down. The way to circumvent this problem, whenever it begins to rear its ugly head, is to close your firefox and clean these files up. Close down your firefox (else it locks these files). From your command line access, navigate to the directory which is your firefox profile and do the following there.

    bash$ for z in `ls *.sqlite`; do sqlite3 $z VACUUM; done

And for those who surf heavily like me, if still your places.sqlite is quite large, do the following:

    bash$ sqlite3 places.sqlite
    SQLite version 3.5.9
    Enter ".help" for instructions
    sqlite> delete from moz_places where hidden=1 and url like 'http%';
    sqlite> .quit
    bash$

This shall remove all the old URL addresses that you haven’t used at all in the recent past and shall further purge the file. For me, it reduced the size of ~/.mozilla by around 12 MB.

Most of this post is, as always, for personal reference and I claim no originality whatsoever.

Signing off,

P.S.: I’m yet to figure out how to make Flash and videos work in firefox ;) :(:(

I was vying for a text-based email client ever since I came back to IITK this semester. I knew that there was something called Pine that had been in use for quite sometime now. But then I came to know that now its developers, the team at the University of Washington have stopped developing Pine in favour of a new one Alpine. Ubuntu users can install alpine using Synaptic package manager. For others you may install it after downloading from here. For the rest of this post, I assume that it has been successfully installed on your system. I describe here how to configure Alpine so as to make it working for you. I do it specially for people connecting to internet through some institution’s internet and that too perhaps using proxy’s. Moreover, this post is specially for the benefit of IITK junta, since I had to spend quite a bit of time to configure it, specially for some subtle things.

As soon as the installation is done, you will find a .pinerc file in your parent directory (where your .bashrc is :) ) Open the .pinerc file and make the following changes at the relevant places:

# Over-rides your full name from Unix password file. Required for PC-Alpine.
personal-name=Your name here
#as you would like it to appear in your outgoing emails.


# Sets domain part of From: and local addresses in outgoing mail.
user-domain=iitk.ac.in
# I think it is pretty clear as to what does it mean, you have to put the part after #the '@' of your email address.


# List of SMTP servers for sending mail. If blank: Unix Alpine uses sendmail.
smtp-server=smtp.cc.iitk.ac.in/user=yourloginID@iitk.ac.in/novalidate-cert
# The SMTP sever is the one which manages your outgoing mails. For IITK people its #smtp.cc.iitk.ac.in, but in addition to that you have to tell alpine what if your #login ID  on that sever, so put your institute-email address in full over there. The #novalidate-cert tells alpine not to enquire about the security certificates of the #server, as far as I know.


# Path of (local or remote) INBOX, e.g. ={mail.somewhere.edu}inbox
# Normal Unix default is the local INBOX (usually /usr/spool/mail/$USER).
inbox-path={newmailhost.cc.iitk.ac.in/user=yourloginID/ssl/novalidate-cert}INBOX
#newmailhost.cc.iitk.ac.in is the IMAP server of IITK. you should put your #institution's IMAP server or the server which receives your incoming messages. And #as similar to SMTP server's case above, you have to write down your username, this #time only your login ID without the '@domainname' suffixed to it. ssl is for secure #shell encryption while communicating the message between the IMAP server
#and your system and novalidate-cert is the same as above. INBOX is the name of the #folder you would like your messages to be saved to. Its a good idea to keep the name #of the folder same as #that on the IMAP server.


# Over-rides default path for sent-mail folder
default-fcc={newmailhost.cc.iitk.ac.in/user=yourloginID/ssl/novalidate-cert}INBOX.Sent
# This is specially for IITK junta. If you would like the messages you send using #alpine to be accessible from locations other than your own PC, then this is the way. #It saves your outgoing messages to the corresponding Sent folder on the IMAP server. #For others, you can also figure out the folder which stores your outgoing messages #on the mail server and mention its pathname here for alpine to locate it. If you #don't exercise this option, all your outgoing messages are saved in the default #'sent-mail' folder on your local system. Also, for the messages that you wish to be #saved somewhere else,you #can override the default folder by giving the path to the #new folder in 'Fcc' column while composing the message.


# Over-rides default path for postponed messages folder
postponed-folder={newmailhost.cc.iitk.ac.in/user=yourloginID/ssl/novalidate-cert}INBOX.Drafts
#As similar to above, this is to save your drafts, unsent messages, postponed messages #in the corresponding folder on the mail server so as to be accessible from any #location other than your PC too. If you don't exercise this option at all, the #default is a folder named 'postponed-msgs' on your local system.
# Add these customized headers (and possible default values) when composing
customized-hdrs=From: Your name here <yourloginID@iitk.ac.in>,Reply-To: <yourloginID@iitk.ac.in>
#If you don't exercise this option and the username on your local account is different #from your login ID, then by default Alpine uses yourlocalusername@domainname in the #headers of your outgoing messages, which you might not want it to do.


# List of directories where saved-message folders may be. First one is
# the default for Saves.
folder-collections=mail/[],
"IMAP folders" {newmailhost.cc.iitk.ac.in/user=yourloginID/ssl/novalidate-cert}INBOX.[]
#This is again an optional one. It is to fetch your directories that might have your #messages on the mail server.

I think that pretty much sums up all the necessary modifications required by the .pinerc file, for Alpine to start working. Some further comments are in order:

1) You can customize Alpine much more than this and even use some other facilities like access to newsgroups, but as of now, I haven’t figured out how to do so. You may try doing such things at your own risk.

2) As you will slowly figure out for yourselves and from however small stint that I have had with it, all I can say is that Alpine rocks!!! You can even read in text from the files (yeah only text files as far as I know) on your local systems into your messages, not merely attach them. You are able to sort out mails faster and search for them faster and doesn’t require much use of the mouse. Overall, for people like me who are quite lazy to write and reply to mails otherwise, its a much faster and better way out.

3) I acquired all the above knowledge after applying my own brain along with help from the various sources over the net which I forgot :( . My primary purpose behind writing this post is for my own future reference along with some possible help for IITK junta.

Sayonara :)

Pardon me if my heading has been superfluous … but I guess that is infinitesimaly close to truth of my new comp … Yeah I purchased a new comp this Saturday, and now I hope the posts to this blog will increase somwhat ;) My father deserve all the thanks for the financial aspect of it while a dear friend Anurag Mishra is the one who looked after the technical aspect. I mean it was him who told me what and from whom to buy. I am almost cyber illiterate :P The configuration is as follows:

ASUS M2N MX SE Motherboard + = 10000/-
Athlon 64 X2 5200+ 2.6 GHz

Kingston DDR2 RAM 667 MHz 2 * 512 MB 1150*2 = 2300/-

Seagate Sata2 250 GB = 3050/-

Samsung 20x Sata DVD+RW = 1450/-

XFX 8500GT 512 MB = 5400/-

Samsung CRT 17″ SyncMaster 794MG = 4700/-

Microsoft Wired Keyboard + Mouse set = 750/-

APC 500VA = 2200/-

iBall Glory ATX = 1450/-

Total (including an external Cabinet Fan) = 31450/-

I guess this might be of use to some of u, but plz note that I am not at all recommending any of these to you as of yet and no legal responsibility lies wd me in case of any unpleasant event caused due to purchasing any or all of these products.

Getting back to comps, I installed ubuntu Feisty Fawn 7.04 on my new comp and for the present have kept it single-boot only.

Signing off for now,

Lovy

I am trying to do some stuff in LaTeX, in which I wanted to insert figures into my amsart documentclass … Naturally, I could not find that in any standard book and went bout googling for it … still there was not a site which explained it in full although Piet van Oostrum’s documentation about picins was quite helpful. I am writing out here one possible way of doing the same which worked for me, there are other ways too like using wrapfig package. The .sty file can downloaded from here, and put it where your LaTeX compiler looks for packages, then in your .tex file do the following things:

documentclass{article}%I have seen it working wd amsart also
 . . .
usepackage{... , picins, ...}%where ... indicates other packages

then write the following command wherever you need you figure to be there

parpic(width,height)(x-offset,y-offset)[Options][Position]{Picture}

All parameters except the Picture are optional. The picture can be
positioned left or right, boxed with a rectangle, oval, shadowbox,
dashed box, a caption can be given which includes it in the List of
figures.

If the width and height are not given [in which case also no offsets
can be given] or if they are given as 0pt, the actual size of the
Picture is used.

Options can be (default is l):
l – put picture on left side of the paragraph
r – put picture on right side of the paragraph

f – frame the picture
d – put a dashed frame aroud the picture
o – put an \oval around the picture
s – put a shadowbox around the picture
x – put a 3D box around the picture
Max one of each group can be given

Position:
l – put the picture left in the box
r – put the picture right in the box
t – put the picture in the top of the box
b – put the picture in the bottom of the box
Default is centering. It only makes a difference if the width and
height given are bigger than the actual picture. If offsets are
given Position is not used.

Picture can be any LaTeX construct.

I have just now “tested” that the \piccaption option for writing caption to such an inline figure doesn’t work properly and isn’t properly typesetted. The other options mentioned in Piet’s documentation viz. \piccaptioninside, \piccaptionoutside, \piccaptionside and \piccaptiontopside doesn’t work at all on my computer. Also, even without captions, this seems to be an only somewhat satisfying solution and does throw lots of problems like improper alignment of text … text over text, text over figure, problems with size adjustment of figure and so on.

Please note that I have borrowed most of the material from Piet’s documentation itself and have written here so that it might appear on search results more easily. Please comment freely as if this information was of some use to you and if you would like to tell us of some new improvements in a non-technical language, of course :-)