Thursday, October 18, 2018

Installing Atom on Ubuntu 18.04

Get the package

Get the latest deb package of Atom at:

$ wget  https://atom.io/download/deb

Install Atom Deb Package

To install the debian package:

$ [sudo] dpkg -i [atom-amd64.deb]

Start Atom

To start Atom:
$ atom

Monday, December 23, 2013

Skype Audio not working on Ubuntu

If you are having audio problems while using Skype on Ubuntu, first check to ensure that sound is working on your system and that your microphone and speaker volume levels are high enough. If you cannot hear yourself using the Skype Echo Sound Test, its possible that pavucontrol is not installed on your system. To install it, use the command :

sudo apt-get install pavucontrol

Restart Skype. Now the audio should work fine.

vmlinuz not found

While installing Ubuntu using a flash drive, you might get an error saying : /casper/vmlinuz not found. You cannot proceed with the installation until you correct it. To do this, you need to rename a file on the flash drive. You could log into another OS on your computer (if you have one) or use another computer.

1. On the flash drive, go to the directory vasper
2. Find a file named vmlinuz.efi
3. Rename that file to vmlinuz
4. Restart and boot using the flash drive. Now you'll be able to proceed with the installation. 


Saturday, December 14, 2013

Changing computer name on Ubuntu

To change the computer name on Ubuntu, you need to do the following :

First, you need to edit /etc/hostname file. To do this, run the following command :

sudo vim /etc/hostname


Change the name as required. After that save and exit ( Use :x to save and exit).

Now, you need to edit /etc/hosts file. To do this, run the following command :

sudo vim /etc/hosts


In the file, you might see something like :

127.0.0.1       localhost

127.0.1.1       "your computer name"

Change the text next to 127.0.1.1 to the name you like. Save and exit.

To apply the changes, restart the hostname, and log out and log in again.

sudo service hostname restart

Monday, November 25, 2013

Ubuntu 13.10 crashes after Suspend

Firstly, make sure you have installed the proprietary drivers for your graphics card. For installing Nvidia drivers for Ubuntu, check out this post. If you continue to have problems even after this, then follow these steps.

sudo gedit /etc/default/grub

Find the line :

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

and replace it with :

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force"

And run the command :

sudo update-grub

Tuesday, November 19, 2013

Creating multiple directories in Linux

For creating multiple directories, you can either specify the names using commas or you can specify a range.

mkdir file{1,2,3}

or

mkdir file{1..5}


Tuesday, November 12, 2013

Can't detect Android phone on Ubuntu 12.10

Apparently, this is a common problem in Ubuntu 12.04 and Ubuntu 12.10.

sudo add-apt-repository ppa:langdalepl/gvfs-mtp
sudo apt-get update

After running these commands, restart the system. After restart, your Android phone internal data storage will be listed in the devices automatically.

Saturday, November 2, 2013

Hidden Directories in Linux

In Linux, directory (folder) names starting with a '.' are not visible to users. To view these files, you need to use the command :

ls -as

This command displays all the directories within the current directory. If you want to rename the directory. Suppose the name of the directory is direc. Then :

mv -i .direc direc

You will find that the hidden directory is now visible.

Thursday, October 17, 2013

Installing Skype on Ubuntu

To install Skype on Ubuntu, follow these steps :

sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
sudo apt-get update
sudo apt-get install skype

After the installation, type skype in the terminal to open it.


Installing Nvidia Drivers on Ubuntu

Without installing the display drivers, you will notice that the performance is the system is pretty poor, which becomes clearly visible while watching videos. So here's how you install the Nvidia drivers on Ubuntu :

sudo apt-get install build-essential linux-source linux-headers

After running this command, you might get an error saying : Package 'linux-headers' has no installation candidate. Ignore the error and continue to the next step.

sudo apt-get install linux-headers-`uname -r` 

sudo apt-get install nvidia-current 

Saturday, September 21, 2013

Executing .run files in Linux

To be able to execute .run files, they first need to be converted to executable files. Use the command :

chmod +x [[filename]]

Then use the following command to execute :

./[[filename]]

Installing Adobe Flash Player on Kali Linux


To install Adobe Flash Player on Kali Linux, follow these steps :

1. Download Adobe Flash Player (.tar.gz) from http://get.adobe.com/flashplayer/ and save it in the root folder.

2. Now untar it using the command :

tar -xvzf [[name of the package]]

3. Change to directory usr/lib64/kde4 (if you are on a 64-bit machine) or usr/lib/kde4. Run the command :

cp kcm_adobe_flash_player.so /usr/lib/mozilla/plugins/

Error while installing Firefox on Kali Linux

I tried installing Firefox and got an error like this :

root@Hari:/home/harichandan# apt-get install firefox-mozilla-build
Reading package lists... Done
Building dependency tree       
Reading state information... Done
wine is already the newest version.
wine set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/29.7 MB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: error processing firefox-mozilla-build (--configure):
 package firefox-mozilla-build is not ready for configuration
 cannot configure (current status `half-installed')
Errors were encountered while processing:
 firefox-mozilla-build
E: Sub-process /usr/bin/dpkg returned an error code (1)

So to get around this, you just need to run the command :

apt-get install --reinstall firefox-mozilla-build

Thursday, September 19, 2013

How to change ROOT password in Linux

Enter the command passwd.

Then choose the password you want!

Tap Clicking Not Working on Linux

This has happened quite a few time for me. No matter how much I fiddled with the system settings I couldn't get it working. There's a simple command which you need t run and it will work.

synclient tapbutton1=1 

Saturday, August 24, 2013

Installing Aircrack-NG on Linux

Aircrack-ng is an 802.11 WEP and WPA-PSK keys cracking program that can recover keys once enough data packets have been captured. Fir installation, run the following commands :


sudo apt-get install build-essential

sudo apt-get install libssl-dev

wget http://download.aircrack-ng.org/aircrack-ng-1.1.tar.gz

tar -zxvf aircrack-ng-1.1.tar.gz

cd aircrack-ng-1.1


Edit the file common.mak before you run make and make install.
sudo gedit common.mak

Locate and change the unused variable werror. Change :
CFLAGS          ?= -g -W -Wall -Werror -O3

to

CFLAGS          ?= -g -W -Wall -O3


Now run :
sudo make
sudo make install 

After the installation, if you get a prompt as follows :
[*] Run 'airodump-ng-oui-update' as root (or with sudo) to install 
or update Airodump-ng OUI file (Internet connection required). 

Then run the command :
sudo airodump-ng-oui-update

Friday, August 23, 2013

Installing ettercap on Linux

Ettercap is a comprehensive suite for man in the middle attacks. It features sniffing of live connections, content filtering on the fly and many other interesting tricks. It supports active and passive dissection of many protocols and includes many features for network and host analysis.

For installing ettercap, use the following commands :

sudo apt-get install zlib1g zlib1g-dev
sudo apt-get install build-essential
sudo apt-get install ettercap

You will be prompted to choose between ettercap text-only and ettercap-graphical packages. Choose accordingly.


For installing ettercap-graphical, use the command :

sudo apt-get install ettercap-graphical


For installing ettercap-text only, use the command :

sudo apt-get install ettercap-text-only
 
After the installation is done, you can open ettercap in different modes. For opening ettercap in graphic mode, use :


sudo ettercap -G


For text mode, use

sudo ettercap -T


To read about ettercap and its different modes, you can use :


man ettercap


Note : 'man' is short for manual. It can be used to read about all commands (description, syntax etc.)

Thursday, August 22, 2013

Capturing Packets using Wireshark

To start the capture of packets, select the interface from the left panel and click on Start.

Once you click on start, you'll notice that the capture of packets has begun and all the packets to and from your computer starts appearing.


If you just want to see a paticular type of packets, say ARP, HTTP etc., you can also add a filter. In the top left corner, type the desired type of packet. Only that type of packet will appear.

Wednesday, August 21, 2013

Cropping an image in Linux using GIMP

Cropping an image is a pretty basic feature in image editing software. Its pretty easy to do in Windows. You can even use Paint to do it in Windows. But I had a tough time doing it on Ubuntu. But its pretty easy to do it on GIMP. Here's how.

1. Open the image you want to crop on GIMP.

2. In the Toolbox, you have to look for the Crop Tool.


3. Use the Crop Tool to select the area you want to crop and click on the small rectangular box within the selected area to crop.


  4. You get the cropped image. Use Ctrl+S to save the image. Use Ctrl+Q to quit GIMP.

Installing MATLAB on Linux

I recently downloaded a MATLAB image to install on Linux thinking that it would be a walk in the park like Windows. But it wasn't. There a few things you need to take care of before installing MATLAB on Linux systems.

Firstly, you need to have Open JDK installed. I have read about people having problems installing MATLAB with Open JDK Java 7 (latest version). If you do, then  install Open JDK Java 6 and it should work fine.

In Windows you can just extract an ISO file and run the .exe file to install the software. But that doesn't work in Linux. First you need to mount the ISO. Ofcourse you can install some software for mounting with a GUI but I am going to tell you how to do it using commands.

To mount the ISO file, check this link here.

After mounting the ISO, enter the mounted drive using the following commands :

cd /mnt/disk

Now you can check the  files in this directory using ls command. You should find a file named install in the directory. Now use the commad :

./install

This should start the installation.

 

After the installation, you will be prompted to activate your software. Choose the option that suits you. Since I had the activation file, I chose the option Activate Manually without Internet. 



After activating the software, MATLAB is ready to use. Now you can unmount the ISO file. For help on unmounting an ISO file, click here.  

Sunday, August 18, 2013

Mounting & Unmounting an ISO in Linux

Mounting an ISO

To mount an ISO in Linux, you need to follow these steps :

Firstly, you need to create a directory where you will be mounting the ISO. You can do so using the command :

sudo mkdir -p /mnt/disk


Next, we mount the ISO file using the command :

sudo mount -o loop [filename].iso /mnt/disk


If you get an error saying that loop is not up, first load the loop module and then repeat the mount command. To load the loop module, use the command :

sudo modprobe loop


Note that you can always use TAB key to auto-complete the filename. -o loop is used to denote the mounted ISO file is a loop device. A loop device is a pseudo-device which writes/reads from a file rather than a hardware.

Unmounting an ISO

To unmount an ISO file, use the command :


sudo umount /mnt/disk

Use the following command if you are getting an error :


sudo umount -f /mnt/disk

Note that it is 'umount' and not 'unmount'. 

Saturday, August 17, 2013

Moving Close, Maximise and Minimise Buttons to Right Side in Linux

If you are a windows user, then the one thing that you would find most annoying is the close, maximise and minimise buttons being on the opposite side. It can be done in a couple of ways. Just run this command to have the buttons on the right :

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


If the above command doesn't work, try this :

gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close"

It is also possible to do it using gconf-editor. If gconf-editor is not installed on your system, you can do so by searching it in the software centre. To change the buttons to right, follow these steps :

1. Press Alt+F2. This should open the Run Application window.
2. Type gconf-editor as shown.
   

3. In the editor, select apps -> metacity -> general.
4. In the value field of button_layout, change close,minimize,maximize: to menu:minimize,maximize,close  


Deleting a directory in Linux

To delete a directory in Linux OS, we use the command :
rmdir
or
 rm 

The syntax is :

rmdir [directory path]
But the rmdir or rm command works only for an empty directory. For deleting a directory, we need to perform what is called a Recursive Delete. Recursive Delete deletes the directory, its sub-directories and all the files contained within. To perform a recursive delete, we use the command :

rm -rf [directory path]

Obviously it doesn't make sense to have to run a command if you could do it manually. But sometimes, you cannot delete directories as a normal user and you will get an error saying you do not have necessary permissions. So you need to be a super user to do so. Use the command as follows :

sudo rm -rf [directory path]

Thursday, August 15, 2013

Installing Wireshark

Wireshark is a network protocol analyzer. If you are networking geek, its a software you would definitely have on your system. Whether you are looking at network troubleshooting, analysis, software and communications protocol development or just as a hobby, Wireshark is your go-to tool.
To install on Windows, you download the latest release from here. Each Windows package comes with the latest stable release of WinPcap, which is required for live packet capture. If needed you can install the latest development release from here.
To install on a Linux system, you can run the command :
yum install wireshark (Fedora/CentOS)

sudo apt-get install wireshark (Debian/Ubuntu)
After the installation, to run Wireshark, type wireshark in the terminal.

How to repair MBR in Windows 7?

When you install a Linux OS on your system, the Master Boot record (MBR) gets replaced by GRUB (GRand Unified Bootloader). If you decide to uninstall the Linux OS and go back to your Windows system, you need to fix your MBR. You have to follow these steps for that :

  1. Put the Windows 7 installation disc in the disc drive (or a bootable Windows 7 USB), and then start the computer.
  2. Select a language, a time, a currency, a keyboard or an input method, and then click Next.
  3. Click Repair your computer.
  4. Click the operating system that you want to repair, and then click Next.
  5. In the System Recovery Options dialog box, click Command Prompt.
  6. To restore the MBR, simply type : bootrec /fixmbr

Wednesday, August 14, 2013

Essential Shortcuts & Commands in Terminal

Ctrl + Shift + T - Open a new tab within the Terminal
Ctrl + Shift + C - Copy
Ctrl + Shift + V - Paste
Tab Key- Autocomplete the command if there is only one option, or else show all the available options.
Ctrl + C- Kill the current process (works mostly with small text-mode applications)
Ctrl + Z - Send the current process to the background.
clear - Clears the screen
ls - List all the contents of the current directory
cd - Change the current directory
exit - It will get you out of the shell

FAQs by Linux Newbies

How do I become "root"?
To become "root" on a Linux system, type :
su -
You will be prompted to enter your root password (you set this while installing your OS), entering which you will become the root of the system. Becoming the root will give you access to all the commands on the computer.
How do I change the GRUB boot order?
GRUB boot order can be configured using the file /etc/default/grub . Use the following command :
gedit /etc/default/grub
This command opens a window with the GRUB file. In this file, you will notice that there's a line :
GRUB_DEFAULT=0
In the list that appears at the start up, the Linux OS appears first. Here, the indexing starts from 0. So the first option on the list will have a value 0, second option has value 1 and so on. Check the position of your Windows OS and change the value of GRUB_DEFAULT.
Also, if you can change the amount of tume you have to wait during the boot time by changing the value of GRUB_TIMEOUT.
How do I untar a .tar.gz file?
Any compressed file can be decompressed by choosing "Extract Here" after right clicking on the file.
Command to untar a file is :
tar -xvzf 
Is there a Task Manager equivalent in Linux?
Yes there is. While logged in as root, type
ps -ax |more
or
ps -aux |more
You will get a list of all processes running on your computer. You will see the process id (PID), process status (STAT) various statistics, and the command name. You can kill a process by typing "kill" and the PID number right afterwards similar to the line below.
kill 1721
You can also stop and restart processes by sending them various signals as in the below examples:
kill -STOP 1721 - Stops (suspends) process 1721 by sending the STOP signal to the process. This process will still be on the task list. The process can't catch or ignore the STOP signal.
kill -CONT 1721 - Continue process 1721 causing it to resume. The CONT signal is sent to the process.
kill -TERM 1721 - Terminates process 1721 by sending the TERM signal to the process. This process will no longer show up on the task list if it is actually terminated. Process terminated cannot be continued. The TERM signal can be caught so TERM is not guaranteed to kill the process.
kill -HUP 1721 - Stops, then restarts process 1721. This is usually done when a process is not working properly or the configuration files for that process have been changed. This command sends the HUP signal to the process which means hangup. This signal can be caught by the process.
killall -HUP myprint - Restarts any process with the name "myprint".
kill -TERM myprint - Terminates any process with the name "myprint".

Monday, August 12, 2013

Commonly used Linux Commands

1. ls command

ls command is used to list the contents of the current directory.

2. cd command

cd command is used to change directories.

cd . - Takes you to the parent of the current directory
cd - Takes you to the root directory
cd PATH - Takes you to the specified PATH

3. uname command

It is used to print system information.

-a, --all
print all information, in the following order:
-s, --kernel-name
print the kernel name
-n, --nodename
print the network node hostname
-r, --kernel-release
print the kernel release
-v, --kernel-version
print the kernel version
-m, --machine
print the machine hardware name
-p, --processor
print the processor type
-i, --hardware-platform
print the hardware platform
-o, --operating-system
print the operating system
--help
display this help and exit
--version
output version information and exit

Things to do after installing Linux

When I installed Fedora 18, I realised that it doesn't include most of the software I am used to in Windows. Luckily, almost all the software that are available for Windows are available for Linux distros as well (atleast close substitutes). This is not an exhaustive list! Just to give an idea as to how to go about things.
Remember to run all the commands as super user, i.e., type ' su - ' first. You will be prompted to enter your password. After entering the correct password, you enter the root of your system, similar to admin in Windows.
1. Fedora Utils
Fedora Utils lets you install codecs and additional software that Fedora doesn't want to ship, like MP3 codecs, Adobe Flash, Oracle Java etc. It can also fix problems, tweak and cleanup your system, show system information and much more with just few clicks.

su -c "curl http://download.opensuse.org/repositories/home:/satya164:/fedorautils/Fedora_19/home:satya164:fedorautils.repo -o /etc/yum.repos.d/fedorautils.repo && yum install fedorautils"

2. VLC Media Player & Media Codecs

I find VLC more convenient to use than the default player that comes with Fedora, so that's usually the first thing I prefer installing.
yum install vlc
yum install gstreamer gstreamer-ffmpeg gstreamer-plugins-bad gstreamer-plugins-bad-free gstreamer-plugins-bad-nonfree gstreamer-plugins-base gstreamer-plugins-good gstreamer-plugins-ugly ffmpeg
3. Adobe Flash Plugin
You have to chose either based on the hardware architecture you are using.

x86_64 (64 bit)

sudo yum install http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm -y 

x86 (32 bit)


 sudo yum install http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm -y

Install the Adobe Flash web-browser plugin
The first command imports the GPG key for the Adobe Flash plugin repository and the second command installs the plugin itself.
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
sudo yum install flash-plugin -y
4. GNOME Tweak Tool
GNOME Tweak Tool is an application for changing the advanced settings of GNOME 3.
yum install gnome-tweak-tool
5. Installing Java Runtime Environment
For installing JRE, download the package required/ You can download the latest package from here or the previous releases from here. There are a variety of formats available and you can choose whichever suits you the best. Since I use a Fedora system, it would be *.rpm for me.
rpm -Uhv *.rpm
6. WINE
Wine is a free and open source software application that aims to allow applications designed for Microsoft Windows to run on Linux operating systems.
yum install wine
7. GIMP
GIMP is an open source equivalent of Adobe Photoshop.
yum install gimp
8. Audacity
Audacity is free, open-source audio editor for recording, slicing, and mixing audio.
yum install audacity --disablerepo=LumenVox
9. Clementine Music Player
You do find some default music players on Linux like Rhythmbox or Brasero, but I found this music player really ineresting.

sudo add-apt-repository ppa:me-davidsansome/clementine
sudo apt-get update
sudo apt-get install clementine

Upgrading Fedora using yum

For upgrading Fedora, you have to install a script called 'fedora-upgrade'. After installing this script, you just have to run the script for the upgrade. Use the following commands :
# yum install fedora-upgrade
# fedora-upgrade
For upgrading from Fedora 18 to 19, follow this procedure :
# rpm --import https://fedoraproject.org/static/FB4B18E6.txt
# yum update yum
# yum --releasever=19 distro-sync

Downloading YouTube Videos on Linux

There are many YouTube Downloaders available on net but I use a very simple command line program called 'youtube-dl' to download videos.

Installing youtube-dl

yum install youtube-dl (For Fedora/CentOS)
          sudo apt-get install youtube-dl (For Debian/Ubuntu)

How to download videos
youtube-dl - This command will download the video into your Downloads folder.
If you want to specify the download folder, then use the following command :
youtube-dl -o /home/"YourPATH"
This command can be used for downloading any video and is not limited to YouTube.

12. PTP Router (Precision Time Protocol Router)

a. NetFPGA Base Version : v2.0
b. PTP Package : PTP Router 1.0.0
After downloading this package, merge it with the NF2 folder in root.
c. After this, compile and load the driver again, i.e., use the following commands :
  1. cd ~/NF2
  2. make
  3. make install
d. Regression Tests : Regression tests for PTP Router are the same as those for reference router.
RESULTS
e. Building the software : For building the software, use the following command :
  1. cd NF2/projects/ptp_router/sw
  2. make install
  3. cd scone-ptp
  4. make
f. For running the PTP project, go to the directory sw/scone-ptp and use the command ./scone.
Sample Output : Follow the link


 

Tuesday, August 6, 2013

11. Regression Tests

Regression tests are a set of tests that exercise the functionality of the released gateware and software. The following are the initial tests that need to be followed :
1.Go to : Systems -> Administration -> Server Settings -> Services  and stop all the processes (except the process network) that are running (time consuming but has to be done). I had once faced a problem of not being able to open the Systems  due to insufficient rights (dunno how that happened as I was the only user on the computer). For that, you can log into the  root and type : system-config-services.
2. IPv6 needs to be disabled. This can be done as follows :
a. Type : /sbin/chkconfig ip6tables off
b. Type : gedit /etc/modprobe.conf and add the lines :
alias ipv6 off
alias net-pf-10 off


 c. Edit network file using the command : gedit /etc/sysconfig/network and make the sure the following line is there : NETWORKING_IPV6=no



Regression Tests
1. Connect 'eth1' to 'nf2c0' and 'eth2' to 'nf2c1'.
2. Connect 'nf2c2' to 'nf2c3' (Leaving these ports unconnected causes errors in the regression tests).
3. Pull up all the interfaces :
ifconfig eth1 up
ifconfig eth2 up
ifconfig nf2c0 up
ifconfig nf2c1 up
ifconfig nf2c2 up
ifconfig nf2c3 up
And assign an IP address of 0.0.0.0 to all of them. This is done to remove the IPv4 address for each interface.
ifconfig eth1 0.0.0.0
ifconfig eth2 0.0.0.0
ifconfig nf2c0 0.0.0.0
ifconfig nf2c1 0.0.0.0
ifconfig nf2c2 0.0.0.0
ifconfig nf2c3 0.0.0.0
Now reprogram the CPCI using : /usr/local/sbin/cpci_reprogram.pl -all
Write the bitfile onto the NetFPGA using : nf_download ~/netfpga/bitfiles/reference_router.bit
Now start the regression tests using : ~/netfpga/bin/nf_regress_test.pl 
RESULTS

Wednesday, July 4, 2012

10. Selftest

1. For selftest, connect nf2c0 to nf2c1 and nf2c2 to nf2c3 using an RJ45.




2. Ensure the nf2cx interfaces are up. You can check this by using the command :
ifconfig
3. If you can see the 4 interfaces (nf2c0, nf2c1, nf2c2, nf2c3) in the list, that means that the interfaces are up.


 4. If the 4 interfaces can't be seen in the list, then they have to be pulled up by using the command :
ifconfig nf2c0 up
ifconfig nf2c1 up
ifconfig nf2c2 up
ifconfig nf2c3 up
or for i in `seq 0 3`; do ifconfig nf2c$i up; done
5. Load self-test bitfile
nf_download ~/netfpga/bitfiles/selftest.bit
6. Run Selftest
a - If you have the SATA cable connected, then use the command :
~/netfpga/projects/selftest/sw/selftest
b - If you do not have the SATA cable connected, then use the command :
~/netfpga/projects/selftest/sw/selftest -n
c - To get the continuous output, add a -c to the above commands. The advantage of getting a continuous output is that you can correct the errors (described later on) in real time.




7. While running the selftests, I got 2 errors. PHY Test failed and DMA Test failed. I corrected the errors as follows :
A - PHY Test Failure : PHY Test failure occurs due to improper connection between the ports. Run the selftest in continuous mode by using the command : ~/netfpga/projects/selftest/sw/selftest -n -c. Now under PHY Test, check if the packets being are going to BAD or GOOD. If the packets are going to GOOD, then it is fine otherwise you would notice that there is a no link appearing for that port. The ports of the NetFPGA are very sensitive. So even though it appears that the ports are connected, they may actually not be connected. So readjust the connections till all the packets go into GOOD. This would result in passing of the PHY Test.


 B - DMA Test Failure : This may result due to multiple reasons, vis-a-vis, the following :
1. Memory hasn't been allocated for the NetFPGA (Article 2 of this blog)
2. The nf2cX interfaces haven't been turned up (Refer article 9 to turn up the interfaces)
3. The CPCI hasn't been reprogrammed. So try reprogramming the CPCI using the command : /usr/local/sbin/cpci_reprogram.pl --all

9. Compile and Load Driver

1. Compile : 
cd ~/netfpga
make
Sample Output : Follow the link
If your output is not similar to the one described in the linked page, you should try checking whether the NetFPGA Environment variables were successfully added to the .bashrc file or not, because I found this was the most common error. The error could be like (just the last few lines) :
make[1]: /bin/nf_register_gen.pl: Command not found
make[1]: *** [registers] Error 127
make[1]: Leaving directory `/home/nchc/netfpga/projects/scone/sw'
make: *** [projects/scone/sw] Error 2
So for getting rid of this error, just use the command :
/usr/local/netfpga/lib/scripts/user_account_setup/user_account_setup.pl
This command for some reason doesn't setup the Perl path correctly. For setting up the Perl path, use the command :
export PERL5LIB=$NF_ROOT/lib/Perl5:$PERL5LIB
This should get everything to compile.



2. Load Driver and Tools :

make install
Sample Output : Follow the link



Now reboot the machine. Reboot is required to load the newly compiled driver.
3. After the reboot, log in as root. Verify if the driver is loaded using the command :
lsmod | grep nf2
Sample Correct Output : nf2      23308      0
4. Verify NetFPGA Interfaces
1) Verify that the four nf2c* interfaces have been loaded successfully by using the command :
ifconfig -a | grep nf2
2) Sample Correct Output :
nf2c0 Link encap:Ethernet HWaddr 00:4E:46:32:43:00
nf2c1 Link encap:Ethernet HWaddr 00:4E:46:32:43:01
nf2c2 Link encap:Ethernet HWaddr 00:4E:46:32:43:02
nf2c3 Link encap:Ethernet HWaddr 00:4E:46:32:43:03
3) If you don't get the output as mentioned in the sample output, then you can turn the interfaces up by typing :
ifconfig  nf2c0  up
ifconfig  nf2c1  up
ifconfig  nf2c2  up
ifconfig  nf2c3  up
The other possibility is that you are not logged onto the OS which has the NetFPGA installed on it. So when booting, ensure that you log into the OS with the NetFPGA installed on it.
5. Reprogram the CPCI
1) Run the CPCI Reprogramming Script
/usr/local/sbin/cpci_reprogram.pl --all
2) Sample Output :
Loading the CPCI Reprogrammer on NetFPGA 0
Loading the CPCI on NetFPGA 0
CPCI on NetFPGA 0 has been successfully reprogrammed



3) To have the CPCI reprogrammed when the computer boots, follow the following steps :
a - gedit /etc/rc.local
b- Add the following line to the file :  /usr/local/netfpga/lib/scripts/cpci_reprogram/cpci_reprogram.pl --all and save it.


Wednesday, June 27, 2012

8. Running the Java GUI

1. Replace the GUI folder in the location root/netfpga/lib/java/gui by the GUI folder in the location from filesystem /usr/local/netfpga/lib/java/gui

2. To run the Java GUI, we use the command ./router.sh from root/netfpga/lib/java/gui




3. If the GUI fails to run, use the commands :
make clean
make
and then repeat step 2.

4. If the GUI fails to run even after step 3, you can run the GUI from the folder /usr/local/netfpga/lib/java/gui using the command ./router.sh.

7. Installing Packages and Kernel Updation

1. Find the kernel version you are currently running using :  uname -r
Sample Output : 2.6.9-42.el5

2. Install the packages for compiler, cursor movement and network library :
yum -y install gcc  
yum -y install ncurses-devel  
yum -y install libnet  
yum -y install compat-libstdc++-296.i386  
yum -y install libpcap-devel

3. Install packages for packet capture, raw IP packet sending and error reporting in Perl.
yum -y install perl-Net-Pcap  
yum -y install perl-Net-RawIP.i386   
yum -y install perl-Error.noarch  
yum -y install perl-XML-Simple

Make sure that kernel devels of the system are updated.

4. Check the list of kernel and kernel related packages installed on your system using the command :
rpm -qa | grep -i kernel

5. Install the latest kernel-devel packages using the commands :
yum -y install kernel-devel*
yum -y install kernel-PAE*

6. Uninstall the older version using the command :
rpm -e kernel-$(uname -r)

7. Reboot your machine in order to update the kernel-devels.

6. Install NetFPGA Base Package

1.  Install the NetFPGA yum repository and GPG key using the following command :
rpm -Uhv http://netfpga.org/yum/el5/RPMS/noarch/netfpga-repo-1-1_CentOS5.noarch.rpm
2. Then run the following command to install the NetFPGA Base Package (if you are trying to implement any routers mentioned in step 3, do not run this command) :
yum install netfpga-base
(This command installs the latest version of the netfpga-base which is currently 3.0.1)

3. Different types of routers that I have tried implementing are as follows and mentioned in the brackets is the version of teh NetFPGA Base Package required for that router :
  a - IPv4 Reference Router (v2.1.1)
  b - DRAM Router (v2.1.1)
  c - Fast Reroute & Multipath Router (v2.0)
  d - PTP-Enabled Router (v2.0)
  e - Promiscuous Reference Router (v2.0)
  f - Flexible Router (v2.0)
  g - Deficit Round Robin Router Backplane (v2.2)
  h - RCP Router (v2.0)


For v2.0, use the command :
yum install netfpga-full-2.0.0-beta_full.i386

For v2.1.1, use the command :
yum install netfpga-base-2.1.1-full

For v2.2, use the command :
yum install netfpga-base-2.2.0-full

5. Installing the RPMForge YUM Repository

1. Use the following links to download the packages :

2. Install DAG's GPG key using the command :
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

3. Verify the package you have downloaded using the command :
rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm

4. Install the package using the command : 
rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm
This command will add a yum repository config file and import the appropriate GPG keys.

5. Then use the following command : yum install htop

4. Installing Java GUI

1. Use the link to download the Java 1.6 :
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jre-6u6-oth-JPR
2. Download the package "Linux RPM in self-extracting file".
3. Change directories using the 'cd' command to reach the directory where the downloaded package is located.
4. Add execute permission to the JDK file (the downloaded package) using the command :
chmod +x jdk-6u6-linux-i586-rpm.bin

5. Install JDK using the command : ./jdk-6u6-linux-i586-rpm.bin. Scroll down and type 'y' when prompted.6. Install the key for the JPackage repository.
rpm --import http://jpackage.org/jpackage.asc


7. Install the JPackage repsoitory information for yum.
cd /etc/yum.repos.d
wget http://www.jpackage.org/jpackage17.repo

8. Install the Java RE using :
yum -y --enablerepo=jpackage-generic-nonfree install java-1.6.0-sun-compat.i586

9. Set default Java path to the new JRE, i.e., select number corresponding to jre-1.6.0-sun using the command : /usr/sbin/alternatives --config java

3. Software Installation

Follow the link to download the NetFPGA packet supported by the NetFPGA board :
https://github.com/NetFPGA/netfpga/wiki/Releases

Wednesday, June 20, 2012

2. After the installation of the OS

After the installation is done, you need to modify your grub.conf file so that the kernel will be able to allocate memory space for the NetFPGA. This is done as follows :

1. Log into the computer as root
2. Type : gedit /boot/grub/grub.conf
3. Add the line : uppermem 524288 before the kernel line
4. Add the following text at the end the kernel line : vmalloc=256M




5. Save the file and exit
6. Reboot the computer
7. Log in as root and type : lspci
8. You could get an output like this : ##:##.# Ethernet controller: Unknown device feed:0001



9. This string identifies that there's a NetFPGA device on the PCI slot.

Tuesday, June 19, 2012

1. Installation of OS

I used CentOS 5.5 for working on the NetFPGA. I haven't tried Fedora but the same commands should work for Fedora too (atleast for Fedora14). For installing the OS, you can follow the instructions here :
http://www.howtoforge.com/installation-guide-centos5.1-desktop
The different pages on this link give an idea to install the CentOS step-wise and following these instructions can make the installation simpler.
Note the following while the installation is in progress :
1. Do not install Virtualization as we require a full installation of OS on hard drive.
2. Set SELinux to : Not Enforcing (otherwise you will need to adjust the security settings manually)
3. Disable the firewall
4. Attach your eth0 (motherboard's primary interface) to the external network
5. It is easiesr to use DHCP to set the IP address, gateway, DNS
After the installation, the Package Updater will prompt for an update. Ignore it as installing the updates now will result in missing dependency issues later while installing the Java GUI.