Pages

Monday, February 13, 2012

Installing ns-2.35 on Ubuntu 10.04

A lot of people dread having to install ns2. Well here is a simple tutorial to get you through in just a single go. Mostly people fail at installing ns2 in the first go because of the missing libraries and dependencies.

Here is what you do to install ns2 in the first go.

1. Download ns-allinone-2.35

2. cd into the directory where you have downloaded the ns-allinone-2.35.tar.gz file.
tar -xvzf ns-allinone-2.35.tar.gz

3. Next you need to install the required libraries

sudo apt-get install autoconf automake gcc g++ build-essential libxmu-dev libtool libxt-dev 

6. Now cd into the ns-allinone-2.35 directory and do ./install , hopefully everything will go smoothly and you ns-2 will be installed. But before you can proceed you need to set the environment variables.

gedit ~/.bashrc
copy the following lines at the end of the file, be sure to change /your/path to the path where ns is installed on your system.

# LD_LIBRARY_PATH
OTCL_LIB=/your/path/ns-allinone-2.35/otcl-1.14
NS2_LIB=/your/path/ns-allinone-2.35/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/your/path/ns-allinone-2.35/tcl8.5.10/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/your/path/ns-allinone-2.35/bin:/your/path/ns-allinone-2.35/tcl8.5.10/unix:/your/path/ns-allinone-2.35/tk8.5.10/unix
NS=/your/path/ns-allinone-2.35/ns-2.35/
NAM=/your/path/ns-allinone-2.35/nam-1.15/
PATH=$PATH:$XGRAPH:$NS:$NAM

for instance on my system i would replace /your/path with /home/z3d

9. source ~/.bashrc to have the changes take effect or you can simply reopen terminal.

10. Now cd into the folder /ns-allinone-2.35/ns-2.35/ and type the command ./validate
it will take a considerably longer time than it did to install and in almost an hour you should get a message all tests successful.

11. Now you can type ns and begin doing your work :)

Monday, January 9, 2012

Wednesday, November 2, 2011

How to check your ISO file for consistency before buring it to disc or using it

When you download a large file from the Internet there are chances that the file might be corrupted during download. In order to be sure that the download is not corrupt, you can always check its md5sum.
In case of Ubuntu you can check the md5 sum of the downloaded ISO using
md5sum ubuntu-11.10-desktop-i386.iso
Then you can compare this with the md5sum available on the website, from where you downloaded the ISO.

Tuesday, November 1, 2011

Windows not loading from grub menu, what to do??

Sometimes it may happen that after reinstalling grub the windows does appear in the grub menu but does not load. In case you are having such a problem. Boot up your Ubuntu machine
sudo su
update-grub

Friday, October 28, 2011

WIFI not working in Ubuntu, what to do??

If you have freshly installed Ubuntu and your WIFI is not working. Then you should follow the following steps to hopefully resolve the issue.

Goto System/Administration/Hardware drivers
See if any drivers are listed as to be installed or in-active.
In this case install the driver and enable it.
Restart the machine

Still not fixed
If you are using a Compaq machine in particular and also in general, sometimes the drivers are installed properly but the wireless button does not work. In that case, first check to see if it is disabled. If it is, then enable it
rfkill list all
# if blocked =yes then try next command
rfkill unblock all

If you still have problems then may be you have the BCM4312 802.11 b/g rev(01) card
Check to see if this is the case

lspci | grep 802

If in the output you see BCM4312 802.11 b/g rev(01)
then you should do the following

sudo su
apt-get update
apt-get install bcmwl-kernel-source
shutdown -r now
You would need to restart for the changes to be effective
If in case it still does not work, check in system/administration/hardware drivers. A LINUX STA driver will be listed. Click on install and then enable it in the same menu. After this reboot.
Everything should be working now! :)

Thursday, October 27, 2011

Setting up network proxy in Ubuntu

Method 1: (Graphical)
Note: You probably need this method in order for the synaptics packet manager or the updates to work.
If you are using the Internet behind a proxy, then in order for apt and other Internet related services to work you need to configure an Internet proxy. You can do this using System/Preferences/Network Proxy. After setting the IP and port click on Apply system wide. It will ask for your password twice. You are done.
A note on the above method: This method works but when un-setting the proxy you may run into bugs, so this method is not recommended.

Manual Method (recommended)
You can set the proxy manually in the terminal (note: This method only works for applications that run in the terminal).

export http_proxy=http://192.168.1.1:8080
ftp_proxy=ftp://192.168.1.1:8080

Replace the IP and port in example with your proxy's IP and port.
Then you can test the connection using

wget www.yahoo.com
rm index.html

If wget is able to download the page it means your proxy has been configured correctly, the rm in the above command has been used to delete the test page downloaded using wget.
To unset the proxy

unset http_proxy
unset ftp_proxy

A known bug:
apt-get does not work when used with sudo, if you see that the downloading is getting stuck and not proceeding at all. You should probably use the following method


sudo su
export http_proxy=http://192.168.1.1:8080
apt-get install 

Additional notes:
If you have opened up multiple tabs of terminal,you would have to set proxy in each tab independently. This proxy setting does not hold once you close terminal.

Permanent method:
If you wish to setup proxy permanently, i.e. whenever you open up terminal the proxy is already set; then you need to make changes to your ~/.bashrc file as super user.

sudo gedit ~/.bashrc

When a window pops up enter the following lines at the very end of the file

export http_proxy=http://192.168.1.1:8080
export ftp_proxy=ftp://192.168.1.1:8080

Now you can either restart the terminal or

source ~/.bashrc

In order to remove the proxy in the future just simply comment/remove the lines you added

Special case: If you want to set proxy for all users, not just your own user, then you need to make changes mentioned above in the /etc/bash.bashrc

Installing Qt4 on Ubuntu and integrating with Eclipse

First install qt4 on Ubuntu

sudo su
apt-get update
apt-get install qt4-designer qt4-demos qt4-doc qt4-dev-tools libqt4-dev
Then you need to install the pde environment for eclipse.
Refer to my older post on seeing how to do this.
go to help->install new software -> select your package-> general tools -> plugin development environment

Then download the integration files from http://qt.nokia.com/products/eclipse-integration/
Then you need to extract the tar file and place the extracted files in the eclipse folder, if you did a standard installation using apt or synaptics package manager you will find it in /usr/lib
cd /usr/lib
tar -xvzf /qt-eclipse-integration-linux.x86-1.6.1.tar.gz
Now you need to re-start eclipse with a clean configuration
eclipse -clean

Now go to new..Project..qt

You will get an error when it starts
Click on open preferences and setup the paths as follows
After this it will ask you that a rebuild is necessary, you should say yes to this. It will also ask for changing perspective, say yes if you please :) You're done enjoy!