Skip to main content

Posts

Split djvu into jpg files

In order to convert a djvu file into a collection of jpg files two tools are needs. One is djvulibre and the other is Imagemagick. Install these first. One way to convert would be to follow these instructions from http://en.wikisource.org/wiki/Help:DjVu_files To extract images from a DjVu file, you can use ddjvu ddjvu -page=8 -format=tiff myfile.djvu myfile.tif If you done all the pages (without -page=** ) you can split the multi-page tiff into single pages png (or any other format) convert -limit area 1 myfile.tif myfile.png But if the djvu has more than 8 pages then all these pages would be included into the tiff. When Imagemagick tries to convert that tiff and splits it into jpgs then it runs out of cache with the following error. convert: unable to extend cache file.tif': @ error/cache.c/OpenPixelCache/4175. It could be remedied but I do not know how. The solution might to limit the memory map http://www.imagemagick.org/script/architecture.php#tera-pixel But instead a bash...

Make all output formats available in Kdenlive

In Kdenlive more often than not I had found that many render options are grayed out. Particularly the flv formats. It would say "unsupported video codec" when the mouse is hovered over each crossed and grayed out item. This means that these codes are unavailable in the system. Most probably all codecs are correctly installed but some are in the restricted section hence not installed by default. For example, the extra codecs. To install them first we have to turn on the "multiverse" and "Medibuntu" repos. See  medibuntu .org  to find out how to add that repo. (Medibuntu is not needed for what we are going to install now, but add it anyways as it has lot of good useful codecs). Then we can proceed to install all possible extra codecs needed by Kdenlive. Depending on the system or OS version the following must be installed libavcodec-extra-52 libavdevice-extra-52 libavfilter-extra-0 libavformat-extra-52 libavutil-extra-49 libpostproc-extra-51 libswscale-...

Latex in chat gmail and pidgin

We write equations in latex to collaborators but most of them have to be read and interpreted in latex. It is only too natural to have some interpreter which converts the latex code into graphical output in the communication mediums like email client and chat clients. I would describe three possible ways to share equations with collaborators. Gmail - To send equations in email had always been hassle. Either we had to send the raw latex codes or send copy paste of the output from some latex compiler. Now, latex codes could directly be compiled in gmail . Install, gmailtex http://alexeev.org/gmailtex.html . The site provides all information needed to get it working. I prefer the greasemonkey script method because no fonts etc. needs to be installed. But since it fetches fonts online you need to have good internet connections. For slow connections stick to local install methods. Note - Just remember to turn off rich text formatting for gmailtex to be able to compile. Gmail chat - htt...

Vertical scroll not working HP Pavilion dm3 Notebook Touchpad in Natty/Ubutnu

This is a generic issue and not tied with HP Pavilion dm3 Notebooks. Many notebook touchpads do not have a working edge scroll first time with Ubuntu. The key is to pass a option to the psmouse module. lsmod See if psmouse is running. If not running check here /lib/modules/`uname -r`/kernel/drivers/input/mouse Do a ls. If no psmouse.ko is present then it has to be recompiled with latest kernel headers. I would not go into that. Assuming psmouse is present. Then unload it by rmmod psmouse Then inject the following line sudo echo "options psmouse proto=imps" >> /etc/modprobe.d/psmouse.conf It might give an error if the file is not present. Then sudo echo "options psmouse proto=imps" > /etc/modprobe.d/psmouse.conf Reload the psmouse module modprobe psmouse The vertical scroll should work now.

Reinstalling GRUB Legacy after windows reinstall

After Windows reinstall the windows would overwrite the GRUB. If using Ubuntu 9.10 or later or have the GRUB2 installed then see here - 1. https://help.ubuntu.com/community/Grub2 2. https://help.ubuntu.com/community/DualBoot/Grub If using older GRUB legacy version then the situation is a little bit tricky but not hard. There are two ways to do this. A) Use older LiveCD, possibly of Jaunty. 1. Make a bootable USB. Use unetbootin and not the Startup disk creator otherwise you will have the error vesamenu.c32: not a com32r image ( https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/686041 ) 2. Boot into LiveCD. 3. Run grub sudo grub 4. Find where Grub is. grub> find /boot/grub/stage1 (hd0,5) This may or may not be the correct partition where grub resides. If there is /boot partition in addition to a root partition then there might two locations where grub is installed for e.g. /dev/sda5/boot/grub and /dev/sda6/boot/grub. The one that contains the menu.lst is the one that is ...

An essay on time : Saugata Chatterjee

Time is something we experience every day. Curiosity about the nature of time dates pre-civilization times, more than 30,00 years ago, when men drew the phases of moon and counted days. But serious thoughts about nature of time was begun only much later, in Europe, by Socrates, who plunged the idea deep into the philosophical school of Greece and taken forward by Plato and in India. where people pondered over true nature of creation. The Greco-Roman concept of time was practical, involving measurement of time. The Indians took it many more leagues further by describing time as infinite (Lord Vishnu floating eternally and creating universe out of nothingness). The concept of infinity might have also entered Vedic culture in the context of creation and the role of time, but infinity might be used from a different perspective. The endless cycles of time divided into 4 major "Yugas" clearly depicts that ancient Hindus conceived time as endless but the only way they could incorpo...

Executable bit not set for external USB hard disks problem workaround

Problem : Previously the Linux system could automount external HDDs with executable permissions. Any file could be run directly from the hard disk. But the flip side was that almost many files including text files used to get the executable bit set. Hence Nautilus attempted to autorun the HDD. This apparently confused many first time users. So from 10.10 onwards Ubuntu stopped setting the executable bit on external HDDs. At what level it is done UDEV, HAL or PMOUNT is unclear tome. But since pmount is the final piece the workaround could be applied there. Workaround : First plug in the external disk. Display the mount points. df See where is the mount. For eg. /dev/sdb1 /media/My-Passport Then unmount the disk as root su umount /media/My-Passport Then as a normal user mount it using the pmount wrapper for mount with the executable bit set for ALL files. pmount --fmask 077 -d -e /dev/sdb1 My-Passport fmask of 0 makes everything executable. pmount man claims that VFAT supports per fi...

RAW record audio streams playing thorugh the PC speakers

RAW record audio streams playing in browsers like Firefox, Chromium or any streaming player like Quicktime, Realplayer, Helixplayer etc. The best way to copy the audio streams available through the PC speakers is to stream copy through Pulse in Ubuntu. Lucid Lynx 10.04 and Maverick Meerkat 10.10 These instructions describe how to record any audio stream that are piped through to your sound system (e.g., external speakers, headphones) using Audacity. Any KDE recording software should work. For the purposes of this example, the audio (voice, music, or soundtrack) player will be Sonic Visualiser but could be any sound source (e.g., MPlayer, VLC, Firefox Flash video, MIDI device). The "PulseAudio Volume Control" program is not installed by default, but can be installed by typing the command sudo apt-get install pavucontrol from a terminal window, or using the System Settings' Software Management to install the pavucontrol package. 1. Click the K menu. 2. Click Multimedia » Pu...

Bulk rename files in Linux

Use the rename command : To add the album title at the beginning :$ rename -v 's/^/TITLE-HERE-/' *.mp3 -v : verbose s : substitute. it acts in the same way as regular expressions do in SED. To replace a part of filename: $ rename -v 's/MISC\.\ -/Fossils-/' *.mp3 e.g. :- MISC. - 01.mp3 to Fossils-01.mp3 MISC. - 02.mp3 to Fossils-02.mp3 MISC. - 03.mp3 to Fossils-03.mp3 To rename to lower case: $ rename 'y/A-Z/a-z/' * To rename recursively: $ find ./ -type f -exec rename 'y/A-Z/a-z/' {} \;