FreeGeekery                            

Some computer related stuffs

Revtex4.cls not found in ubuntu 10.04

Image

In ubuntu 10.04 revtex4 has been removed and replaced with revtex4.1. Typing only revtex4 will give error that revtex4.cls not found. One simple solution worked for me is to replace revtex4 by revtex4-1 in the document class specification. \documentclass[showpacs,amsmath,amssymb,prl,twocolumn]{revtex4-1}

You also require the package texlive-fonts-extra. Install it sudo apt-get install texlive-fonts-extra

Switching on the vim-latexsuit in ubuntu

Image

I recently installed a vim addon named vim-latexsuit for vim editor wich makes typing in latex much easy. However just sudo apt-get installation did not switch on the latexsuit. In order to use it type the following command sudo vim-addons -w install latex-suite

error: iostream.h: No such file or directory

Image

This is because you must have added a line at the beginning of your program #include

Omit the .h extension i.e. the correct line would be #include

‘cout’ was not declared in this scope

Image

If you are getting this error means you have not added the line using namespace std;

Add this and you will not get this error.

Move the minimize, maximize, close keys from the left to the right of the window

Image

For ubuntu 10.04 in the default setting the maximize, minimize and close buttons are on the top left panel, like the mac style. I did not like and changed it by the following command

gconftool-2 --set /apps/metacity/general/button_layout--type string :minimize,maximize,close

Find the format type of a harddisk

Image

If the device name for the hddisk is /dev/sdc then type fdisk -l /dev/sdc

Recover data fromed a crashed Harddisk

Image

Recently a harddisk with ubuntu installed on it crashed and I was not able to mount the partitions on a second computer. Using the command

mount /dev/ was giving me output like Wrong fs type ...

If you are having similar problem follow this instruction to recover you data. You will need a working computer with linux on it and also a third hddisk. One can use a rescue cd but I will not describe that. You can see more details in the related links.

  1. Connect the hard disk to a working computer, as a secondary harddisk.
  2. Find device name for the crashed hddisk. For me it was /dev/sdb and the partition I want to recover was /dev/sdb7. Make an image of the crashed hddisk on the third hddisk. For me it was /dev/sdc.ddrescue -r 3 /dev/sda7 /dev/sdc /home/logfile.txt
  3. Now on the copied image run fsck /dev/sdc
  4. It will most probably will give you an error like wrong fs type.... Run the following commandfsck --rebuild-sb /dev/sdcThenfsck --check /dev/sdcIf you still get errors then run fsck --rebuild-tree /dev/sdc
  5. This should work. Try mounting the hddisk on a filemkdir recoveredmount /dev/sdc recoveredAll your recovered files will be inside folder recovered/lost+found.

Ubuntu 10.04 beta not able to connect the repositories

Image

I was trying the beta release of ubuntu 10.04 Lucid Lynx, and after installation when I pressed reload on the synaptic manager it gave me an error saying it is unable to connect the server to download thep ackage. However my internet is working. It turned out that I was using the Indian server and that was not working. In order to change it got to the settings => repositories and change the download from option to main server. then reload, and it worked

First step towards hacking!

Image

If you want to surprise your friends by writing a mail from their mail account follow this

Telnet into your mail server by 25 port

telnet yourmailserver 25

If you are lucky you can get into the server. Then type the following

MAIL FROM: sender's mail id

Remember to give a space between the colon and the mail id.

RCPT TO: recipient's mail id

To type the message

DATA

Then press enter and type your message

After you finish typing the message press enter then type "." and then press enter. This will send your message

Merge multiple pdf files

Image

If you want to merge multiple pdf files into single file, this tutorial tells you how to do that

First you need to have gv installed. Then use the following command in the terminal.

gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=combined.pdffile1.pdf file2.pdf

UBUNTU: Wireless not working in dell laptop / Installing wireless driver for bcm4312 on Ubuntu

Image

This problem I faced in dell inspiron laptop. After installing Ubuntu (9.04) wireless was not working. There was a red cross on the wireless signal bar on top right panel on the desktop.

Solution: Install the correct driver for the wireless network card. I will describe how to install wireless driver for BCM4312 wireless card.

To find out your wireless card type the following on the terminal lspci | grep Network For me the out put has BCM4312 802.11b/g (rev 01) term and this is my wireless card. If you have this follow the instruction bellow or make suitable changes according to your network card.

  1. Create a directory "driverwl" anywhere mkdir driverwl and then go inside the directorycd driverwl
  2. go to the site http://www.broadcom.com/support/802.11/linux_sta.php and download the corresponding tar.gz file for your laptop. Mine was 32-bit system. Save the file inside the "driverwl" directory you just created
  3. Untar the file. tar -xvzf hybrid-portsrc-x86_32-v5_10_91_9.tar.gz
  4. Run the following command pwd Use this output in the "full path name" place in the next two commands.
  5. Type make -C /lib/modules/<2.6.xx.xx>/build M="full path name" clean To get the number <2.6.xx.xx> type up to "..modules/" and then press tab.
  6. Then run the commandmake -C /lib/modules/<2.6.xx.xx>/build M="full path name"
  7. Thensudo depmodand sudo modprobe wl
  8. You are done. Your wireless should detect available signals. Sometimes you need to reboot your comp.

"Firefox is already running, but not responding..."

If you get this message do the following.

  1. Open a terminal and type ps -e | grep firefox. If you get an output like 5433 ? 00:07:40 firefox, use the number on the left to kill the firefox. kill -9 5433 Again ensure that no firefox is runningps -e | grep firefox. There should be no output this time.
  2. Now go to the .mozila/firefox directory cd ~/.mozilla/firefox/
  3. Do ls here.ls There will be a directory with some apparently meaningless name with numbers. If you are using default profile there will be only one directory with .default extension. Like I have a directory "dvermul9.default"
  4. go inside the directory and do ls -a therecd dvermul9.defaultls -aYou will find two files "lock" and ".parentlock". Delete them.rm lock .parentlock
  5. Start the firefox. It will work.
  • Sometime this procedure removes you bookmarks. To get them back open the firefox, and then go to Bookmarks in the menu list => Organise Bookmarks. Then go to Import and Backup => Restore => Choose File. This will open a file opener. Type ~/.mozilla/firefox in the address bar. If you don't see the address bar click on "pen and paper" symbol on top left. Then go to directory dvermul9.default => bookmarkbackups. Choose the .json file with recent most date. Restart the firefox. This will get your bookmarks back

Mathematica6 Fonts not visible in Ubuntu 8.04

Problem: In mathematica6 if the fonts are not readable and it looks like the following

Solution: Open a terminal and type the following commands. sudo apt-get install libqt4-core libqt4-guisudo mv /usr/local/Wolfram/Mathematica/6.0/SystemFiles/Libraries/Linux/libQtCore.so.4 /usr/local/Wolfram/Mathematica/6.0/SystemFiles/Libraries/Linux/libQtCore.so.4.oldsudo mv /usr/local/Wolfram/Mathematica/6.0/SystemFiles/Libraries/Linux/libQtGui.so.4 /usr/local/Wolfram/Mathematica/6.0/SystemFiles/Libraries/Linux/libQtGui.so.4.old Then start the mathematica.

Many windows opening in Mathematica 6

Image

Problem: When starting mathematica it opens more than one blank windows.

Solution: Open mathematica => Go to Edit => Preferences => Advanced Options => Notebook Options => Window Property => WindowFrame. Change this from normal to generic This fixes the problem

Flowers of India

Image

As the name suggests this is a website about flowers from India. This site is maintained by a group of enthusiastic people, some of them are friends of mine. They have a very good collection of Indian flowers and their scientific names. Please have a look.