g++-4.x gives following warning whenever a string with in double quotes is assigned to a char * :
warning: deprecated conversion from string constant to ‘char*’
Though there is no fix available as far as I know except for following two solutions:
1. convert 'char *' to 'const char*' whenever a string is to be assigned.
2. use a type cast to convert a string to a char*.
For example:
const char *name = "Adam Smith"
char *name = (char*) "Adam Smith"
To get rid of deprecated conversion warning, pass -Wno-write-strings option to g++
Sunday, August 23, 2009
opencv on Ubuntu Jaunty
Opencv does not handle videos properly on Ubuntu Jaunty. In order to fix this, please follow the instructions given at this link:
http://gijs.pythonic.nl/blog/2009/may/3/getting-video-io-working-opencv-and-ubuntu-jaunty-/
http://gijs.pythonic.nl/blog/2009/may/3/getting-video-io-working-opencv-and-ubuntu-jaunty-/
Monday, August 10, 2009
Vim-latex suite on Ubuntu Jaunty
First install vim-latex package using synaptic packet manager. Then run following command on a terminal :
$ sudo vim-addons -w install latex-suite
Now opening a tex document with gvim should show tex related menus on the menu bar.
If this does not help, then refer to ubuntu forums for solution. For instance check this link.
$ sudo vim-addons -w install latex-suite
Now opening a tex document with gvim should show tex related menus on the menu bar.
If this does not help, then refer to ubuntu forums for solution. For instance check this link.
Friday, July 10, 2009
Automating chmod
Task is to change the permission modes for multiple directories
$ find . -type d -print0 | xargs -0 chmod 771
$ find . -type d -print0 | xargs -0 chmod 771
Tuesday, June 30, 2009
PDF Highlighting tool

Earlier I talked about few tools for editing PDF files (for free) on linux. You can go through the discussion here. I recently came across some more free tools that tend to make our life little easier, particularly when it comes to editing pdf files on linux. Some of these tools are as follows:
- Scribus : Limited capabilities
- Inkscape : Limited capabilities
- Okular : Limited capabilities. You can do some highlighting and add annotations. But they don't seem to be very neat. Just give a look at some screenshots.
- PDF-xchange-viewer. Its a windows based application which is free to download at present and can be run on linux using Wine. I could use it flawlessly on my Ubuntu Intrepid Ibex (8.10). Among all pdf editing tools, this seems to the best option for editing pdf files. Even though its not a native linux application, it is better than going back to windows just for editing a PDF file. However, I am still waiting for GNUpdf which, I believe, would provide a permanent relief to linux users in this regard.
To get started, first use synaptic packet manager to install wine. For Ibex, follow the instructions given at this link. Download PDF-xchange-viewer from its website and run it using wine. That's all. It installs itself within a folder. A screenshot of PDF-xchange-viewer is shown in the adjacent thumbnail. Its really neat and close to what we find in Adobe Acrobat PDF editor. - PDFescape: You can edit PDF files online (particularly fill up forms) at this website. This is useful if you are in a hurry and can't install a PDF editing software on a public machine.
Tuesday, January 20, 2009
Installing Essential softwares on Debian Etch
In order to install softwares like acroread and mplayer, include following line into your '/etc/apt/sources.list'
deb http://www.debian-multimedia.org/ etch main
Download the key-ring from this site and install it as follows:
$ sudo dpkg -i debian-multimedia-keyring_2008.10.16_all.deb
and then run "apt-get update". More information regarding this is available here and here.
# sudo apt-get install acroread
For flash, you need to install the package "flashplugin-nonfree" which is available in backports repository. Include following line into your sources.list file:
deb http://www.backports.org/debian etch-backports main contrib non-free
and now get keyrings for backport repository.
#apt-get install debian-backports-keyring
#apt-get update
#apt-get -t etch-backports install flashplugin-nonfree
deb http://www.debian-multimedia.org/ etch main
Download the key-ring from this site and install it as follows:
$ sudo dpkg -i debian-multimedia-keyring_2008.10.16_all.deb
and then run "apt-get update". More information regarding this is available here and here.
# sudo apt-get install acroread
For flash, you need to install the package "flashplugin-nonfree" which is available in backports repository. Include following line into your sources.list file:
deb http://www.backports.org/debian etch-backports main contrib non-free
and now get keyrings for backport repository.
#apt-get install debian-backports-keyring
#apt-get update
#apt-get -t etch-backports install flashplugin-nonfree
Thursday, December 4, 2008
Mounting an external drive using volume label
The device nodes keep changing if you are pluggin in and out several different usb disks and in different orders. For various reasons for instance for file synchronization, it is useful to mount these drives according to their names.
First of all, find out the correct device partitions for usb drives.
$ sudo fdisk -l
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4be002e1
Device Boot Start End Blocks Id System
/dev/sda1 1 1402 11261533+ 12 Compaq diagnostics
/dev/sda2 * 1403 15918 116592640 6 FAT16
/dev/sda3 15918 29975 112918572 f W95 Ext'd (LBA)
/dev/sda4 29976 30402 3420160 12 Compaq diagnostics
/dev/sda5 15918 22292 51200000 7 HPFS/NTFS
/dev/sda6 22293 22304 96358+ 83 Linux
/dev/sda7 22305 22912 4883728+ 82 Linux swap / Solaris
/dev/sda8 22913 26559 29294496 83 Linux
/dev/sda9 26560 29975 27438988+ 83 Linux
Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x5b6ac646
Device Boot Start End Blocks Id System
/dev/sdb1 1 24315 195310206 c W95 FAT32 (LBA)
/dev/sdb2 24316 38913 117258435 82 Linux swap / Solaris
The Usb disk is mounted at /dev/sdb.
Before changing the label, unmount the device partitions. This is very important.
$ sudo umount /dev/sdb1
$ sudo umount /dev/sdb2
Install "mtools" and "e2fsprogs"
$ sudo apt-get install mtools e2fsprogs
in order to label vfat partitions, we need 'mtools' and 'e2label' is needed for labelling ext2/3 partitions.
$ sudo mlabel -i /dev/sdb1 -s :: SWG_WIN
now check the label with following command
$ sudo mlabel -i /dev/sdb1
Volume label is SWG_WIN
$ sudo e2label /dev/sdb2 swg_lin
check the label using following command:
$ sudo e2label /dev/sdb2
swg_lin
Now edit /etc/fstab and enter following lines:
LABEL=SWG_WIN /mnt/usb_win vfat user,rw,auto,umask=0 0 0
LABEL=swg_lin /mnt/usb_linux ext3 user,rw,auto 0 0
save the file and remount them
$ sudo mount -a
More information about changing partition labels are given here.
First of all, find out the correct device partitions for usb drives.
$ sudo fdisk -l
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4be002e1
Device Boot Start End Blocks Id System
/dev/sda1 1 1402 11261533+ 12 Compaq diagnostics
/dev/sda2 * 1403 15918 116592640 6 FAT16
/dev/sda3 15918 29975 112918572 f W95 Ext'd (LBA)
/dev/sda4 29976 30402 3420160 12 Compaq diagnostics
/dev/sda5 15918 22292 51200000 7 HPFS/NTFS
/dev/sda6 22293 22304 96358+ 83 Linux
/dev/sda7 22305 22912 4883728+ 82 Linux swap / Solaris
/dev/sda8 22913 26559 29294496 83 Linux
/dev/sda9 26560 29975 27438988+ 83 Linux
Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x5b6ac646
Device Boot Start End Blocks Id System
/dev/sdb1 1 24315 195310206 c W95 FAT32 (LBA)
/dev/sdb2 24316 38913 117258435 82 Linux swap / Solaris
The Usb disk is mounted at /dev/sdb.
Before changing the label, unmount the device partitions. This is very important.
$ sudo umount /dev/sdb1
$ sudo umount /dev/sdb2
Install "mtools" and "e2fsprogs"
$ sudo apt-get install mtools e2fsprogs
in order to label vfat partitions, we need 'mtools' and 'e2label' is needed for labelling ext2/3 partitions.
$ sudo mlabel -i /dev/sdb1 -s :: SWG_WIN
now check the label with following command
$ sudo mlabel -i /dev/sdb1
Volume label is SWG_WIN
$ sudo e2label /dev/sdb2 swg_lin
check the label using following command:
$ sudo e2label /dev/sdb2
swg_lin
Now edit /etc/fstab and enter following lines:
LABEL=SWG_WIN /mnt/usb_win vfat user,rw,auto,umask=0 0 0
LABEL=swg_lin /mnt/usb_linux ext3 user,rw,auto 0 0
save the file and remount them
$ sudo mount -a
More information about changing partition labels are given here.
Subscribe to:
Posts (Atom)
