Skip to main content

Posts

Showing posts from June, 2010

Installing ns-3.37 and ns-3.35 in Ubuntu | Ubuntu 22.04 | NS3

Multiple Versions of ns3 in Ubuntu 22.04 In this post, we are going to install two versions of ns3 namely ns-3.35 and ns-3.37  My OS is : Ubuntu 22.04 LTS (Long Term Support) ns-3.35 uses waf and (./waf --run scratch/first)  ns-3.37 uses cmake  (./ns3 run scratch/first.cc) So we will install both the packages  Go through the video for complete instructions To start with  $ sudo apt update  $ sudo apt install build-essential autoconf automake libxmu-dev g++ python3 python3-dev pkg-config sqlite3 cmake python3-setuptools git qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3 openmpi-bin openmpi-common openmpi-doc libopenmpi-dev autoconf cvs bzr unrar gsl-bin libgsl-dev libgslcblas0 wireshark tcpdump sqlite sqlite3 libsqlite3-dev  libxml2 libxml2-dev libc6-dev libc6-dev-i386 libclang-dev llvm-dev automake python3-pip libxml2 libxml2-dev libboost-all-dev  I have downloaded both the versions of ns3 fr

http_proxy in ubuntu

If you are working in the internet with ubuntu, you may need some software to be installed before it is being used actually. If you install ubuntu with a live CD, you will not have VLC Media player, etc. Proxy setup needed to install/update software in ubuntu 1. proxy support for Synaptic package manager Go to Settings-> preferences –> Network Tab, click manual proxy configuration and then set the proxy ip and port 2. proxy support for apt-get Open the file /root/.bashrc and type the following line export http_proxy=http://username:password@host:port/ If your proxy server does not have username/password combination then include the following line export http_proxy=http://host:port/ for example, export http_proxy=http://192.168.0.10:808/ (NB: .bashrc file is available for all the users of ubuntu, for example if the Linux user login name is “pradeepkumar” then there will be a .bashrc file at /home/pradeepkumar/ , but setting the http_proxy in those files wil

Printing Environmental Variables and CPU Time using C

  To print the environmental variables of Linux using C. To print the system uptime and system idle time. Requirements : GCC compiler Suse Linux (Sun V20Z Linux Server) Theory: Linux provides each running program with an environment . The environment is a collection of variable/value pairs. Both environment variable names and their values are character strings. By convention, environment variable names are spelled in all capital letters. You're probably familiar with several common environment variables already. For instance: USER contains your username. HOME contains the path to your home directory. PATH contains a colon-separated list of directories through which Linux searches for commands you invoke. DISPLAY contains the name and display number of the X Window server on which windows from graphical X Window programs will appear. Program: //Printing the Execution Environment #include <stdio.h> /* The ENVIRON variable contains the environment. */ extern char** environ; i

File Handling using Shell Scripts

File handling using Shell Scripts to prepend a line to a file to develop a temporary file name generator to compare two files Requirements:     Suse Linux, BASH Scripting Program (a) Prepending a line to a file   #!/bin/bash # prepend.sh: Add text at beginning of file.   E_NOSUCHFILE=65   read -p "File: " file # -p arg to 'read' displays prompt. if [ ! -e "$file" ]     then # Bail out if no such file.     echo "File $file not found."     exit $E_NOSUCHFILE fi   read -p "Title: " title cat - $file <<<$title > $file.new echo "Modified file is $file.new" exit 0   (b) to develop a temporary file name generator #!/bin/bash # tempfile-name.sh: temp filename generator BASE_STR=`mcookie` # 32-character magic cookie. POS=11 # Arbitrary position in magic cookie string. LEN=5 # Get $LEN consecutive characters. prefix=temp # This is, after all, a "temp" file. # For more &q