Tag Archives: how to

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 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 :-)