Combining several djvu files into one:

Type this linux command (in the directory where the old files are located):

djvm -c newfile.djvu oldfile1.djvu oldfile2.djvu oldfile3.djvu

- in this way. Learn from

What if there are hundreds of such files to be joined?

I presume that the files are written in the way:
00001.djvu, 00002.djvu,……,00057.djvu,…., 00143.djvu, 00144.djvu, index.djvu.
And these files are to be joined.

So write up a C++ program:


using namespace std;

int main()
int x;
cout<<"0000"<<x<<".djvu ";
cout<<"000"<<x<<".djvu ";
cout<<"00"<<x<<".djvu ";


The out put would be what we will have to copy-paste after $\texttt{djvm -c newfile.djvu }$.

Combining Several Pdf files into one

Let file1.pdf,file2.pdf and file3.pdf be three pdf files you want to join. Go to the folder they are in (cd folder_location). Then type the following:

pdfjoin file1.pdf file2.pdf file3.pdf --outfile ~/Desktop/newfile.pdf

This will produce a file called newfile.pdf in the ~/Desktop folder (you can replace this with any folder you want), which will contain contents of file1.pdf, file2.pdf and file3.pdf in order.

A/V Sync Correction

I am discussing here the special case where the a/v sync out is zero at the beginning and varies smoothly as the movie goes on.

Tools needed:
1. Some converter that converts your mpeg (or any format in which your problem file is) to avi. I use Xilisoft Video Converter for that.

2. An audio extractor that extracts the audio from video files, especially one that can do so from an avi file; possibly you'd have amongst the ones you choose AoA Audio Extractor.

3. The central machine: avifrate, this software can change the bitrate of an avi file (you might choose some other tool if you like, I, however, use this one). Download it free here

Now, the algorithm is below:

1. Convert the problem file (say file.mpg ) to avi (file.avi).

2. Extract audio from file.avi. Name it, say, file.mp3.

3. Let the length of the avi video file be $x$ seconds (convert minute/sec to sec), and that of the audio file be $y$ seconds.

4. Fire up avifrate and load file.avi.

5. In the current frame rate field, you should find a reasonable number, say $z$. Now calculate with some exact figure up to 4 places after the decimal point the number

\begin{align} z'=(z\cdot x)/y. \end{align}

Now, put the $z'$ in the New Frame Rate field of your avifrate. Click apply. And you are done! Check the modified avi file now.

Some linux commands:

1. To find out the uuid(universal unique identifier) of the hard drives, type in root mode


Explorer crashes in Windows XP


Install ShellExView from this page and install; then start the application.

Click on type in the header, and find that there are elements with type="context menu". Disable all of those (not others). The crashing problem that is aggravated on right clicking should not be seen after that.

If the problem is temporarily solved, just enable one by one from, say, down the list. And keep on testing at each step. You should shortly be able to identify the culprit.

Comment: It worked for me.

Bangla Fonts

Sometimes in linux you can't read bangla news papers, for which I suggest reading this site, though it will not completely solve it, but will really let you read them.

Install padma font.

Latex packages in Ubuntu:

mathrsfs.sty is found in texlive-latex-recommended

How to install .sty file in a texlive system?

Download the files, for example, from, and put it in a suitable folder (in my case it is most often /usr/share/texmf-texlive/tex/latex/). The whole procedure may take some irksome effort, though, it will probably bear fruit, and will save a good deal space since you don't install the package directly, which would be some 40MB or more! Go to, then type your file name, for example xypic. Then follow the link given in the line

"You can also visit mathrsfs's CTAN directory  to browse the source or download the material for installation by hand. "

Then download the zip file and unzip it into a folder. Read the README file, which you will find inside, and do exactly what it tells you to do. Then run in terminal the command

sudo mktexlsr

Good Latex commands

  1. To write below and above an arrow: In amsmath it is also possible top use \xrightarrow and \xleftarrow that extend automatically: img16.png is generated by A\xleftarrow{n+\mu-1}B \xrightarrow[T]{n\pm i-1}C.
  2. xymatrix
    1. \xymatrix{ A \ar[d]_f \ar[r]^f

& B \ar[dl]|{i_B} \ar[d]^g \\ B \ar[r]_g & C }

the output being img13.gif

Other good references being found at

mplayer error message:

If mplayer shows something like MPlayer Error Message - Error Opening/Initializing Video Out Device, then do this:
Look in the file .mplayer/gui.conf in your home directory. Check for a line
vo_driver = "whatever_is_written"
try changing it to vo_driver = "xv"

To install a library development file

Sometime you will get, while compiling a package from the source file, especially during the ./configure step, errors like

 configure: error: The following required libraries were not found:
    libXpm libjpeg libpng libgif/libungif libtiff
Maybe some development libraries/packages are missing?
If you don't want to link with them give
    --with-xpm=no --with-jpeg=no --with-png=no --with-gif=no --with-tiff=no

This means you have to install the development files for these libraries like libXpm. What you do is,

 sudo apt-get install libXpm-dev libjpeg-dev

Joining flv files

mencoder -forceidx -of lavf -oac pcm -ovc copy -o output.flv input1.flv input2.flv

USB Hard Drive not showing up

In my case, the hard drive not showing up was Seagate Backup Plus 1TB USB 3 hard drive.

The output of the command


included the following part

T:  Bus=01 Lev=01 Prnt=01 Port=04 Cnt=02 Dev#=  5 Spd=480 MxCh= 0
D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0bc2 ProdID=a013 Rev=01.00
S:  Manufacturer=Seagate
S:  Product=Backup+ BK
S:  SerialNumber=NA5CJJAN
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#= 0 Alt= 1 #EPs= 4 Cls=08(stor.) Sub=06 Prot=62 Driver=uas

Now see the part "Driver=uas". If I inserted my older USB Hard Drive, in the part of the output of usb-devices corresponding to the older hard drive I would get "Driver=usb-storage". That indicates that the problem lies in the driver called "uas".


lsmod | grep uas

You will see the uas module in the output.

Now shutdown, unplug the Backup Plus, and boot into Ubuntu again. Then run

sudo rmmod uas

And check again by lsmod | grep uas. This time you should not find the uas module at all. Then plug in the Backup Plus, and it does mount this time. So far so good.

But now if you restart, the Backup Plus does not mount automatically. After restarting run

lsmod | grep uas

and you will see the module uas coming up in the output. This is because the initram loads the module uas each time you boot into Ubuntu. So you have to not only remove uas by running rmmod, but also update initram. To do so, shutdown, unplug Backup Plus, boot into Ubuntu, run sudo rmmod uas, and then run the following command to update initram.

sudo update-initramfs -u -k <type your latest kernel version>

For example, in my case it was

sudo update-initramfs -u -k 2.6.38-16-generic

Here "-u" means that you are updating the initramfs ("-c" would mean creating a new initramfs, "-d" removing the existing one, etc.), and "-k" specifies the version of the kernel.

Acknowledgement: I learnt about initramfs from V. Nandagopal of TIFR, Mumbai.

Making xdvi the default application for dvi files

1. sudo gedit /usr/share/applications/xdvi.desktop

2. In gedit, type the following

[Desktop Entry]
Exec=xdvi %f

Wired connection drops in Ubuntu

The wired connection used to drop and resume automatically.

The solution seems to be the following.

Download the official realtek driver.
Then remove the r8169 module from the linux kernel.

# rmmod r8169

<Quick install with proper kernel settings>
Unpack the tarball :

# tar vjxf

Change to the directory:
# cd

If you are running the target kernel, then you should be able to do :
# ./ (as root or with sudo)

You can check whether the driver is loaded by using following commands.
# lsmod | grep r8168

Something like the following should come in the response:
 r8168                 513120  0

Finally, blacklist the r8169 driver add the following to /etc/modprobe.d/blacklist.conf:

#blacklist r8169 driver
blacklist r8169


Edit me to add new tips.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License