Tuesday, December 21, 2010

Install Firefox 4 beta (Minefield) on Ubuntu

UPDATE: Firefox 4 (stable version) is now available for Ubuntu. So you can install it instead. Instructions on installing Firefox 4 can be found here

To install Firefox 4 beta on Ubuntu execute following commands
sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa
sudo apt-get update
sudo apt-get -y install firefox-4.0
The new browser will appear as Minefield 4.0 Web Browser in Applications Menu. It will be installed alongside your existing Firefox install (if any).

Sunday, December 19, 2010

Track Your Internet Bandwidth Usage with NTM (Network Traffic Monitor)

For those of us with limited network connection Network Traffic Monitor (NTM) is a very helpful tool. It can monitor upload, download or total network traffic. It can also monitor time spent online and lot of other things. NTM is not available in Ubuntu repositories so you will have to download the .deb from here and install it. After installing start NTM from Applications->internet->NTM. Now right click on the NTM icon  in the taskbar and select preferences from the menu that appears. This will open the NTM preferences window. In the General tab specify the interface that you use to connect to internet. In my case it is wlan0

Now select Traffic tab and enter the traffic limit of your internet plan. I have entered 2G i.e 2048MB as an example value.

You can select Auto Disconnect if you want the connection to disconnect as soon as you reach your limit. This can be very helpful if extra MBs are charged at a high rate. Click Apply and you are all done. NTM will monitor your internet use and you can left click on the NTM icon in Taskbar to see your current speed, bandwidth you have consumed and lot of other information.

If you have time limited connection and not bandwidth limited i.e you buy internet hours and not GBs then you can also use NTM to keep track of time you spend on internet. Open the time tab to configure time related options.

Saturday, December 18, 2010

Connect To PTCL EVDO(Evo) from Ubuntu Linux - Part 2

Starting from Ubuntu 9.10, Network Manager uses ModemManager to communicate with mobile broadband (CDMA, UMTS and others) cards. Ubuntu 9.10 uses version 0.2 of ModemManager which most probably has some bug because of which few modems dont get recognized. ZTE AC2726, the modem which comes with PTCL EVDO, is one of the unfortunate ones. In a previous post we have covered how to connect to PTCL EVDO in Ubuntu 9.10. If you have Ubuntu 10.04 or later you can use the following procedure to connect to PTCL EVDO.

Install usb_modeswitch using the following command:
sudo apt-get install usb-modeswitch usb-modeswitch-data 
after installing usb_modeswitch plug your modem in. If your modem is already plugged in remove it and then plug it back in. Now use lsusb command to see if your modem is properly recognized. The output should contain a line like:
Bus xxx Device xxx: ID 19d2:fff1 ONDA Communication S.p.A. 
Now go to System->Preferences->Network Connections. Click on Mobile Broadband Tab.

Now click Add. In the new window that appears, you will have ZTE device already selected.

Click on forward. Select Pakistan from Next Screen and press forward. In next screen manually enter PTCL EVDO as your provider and click forward. Now click Apply.

 In the new Window enter vwireless@ptcl.com  as user name and ptcl as password and click apply.

You are all set. To connect to this connection click on Network Manager icon in Taskbar. Select this newly created connection and click connect.

Monday, December 13, 2010

Creating a screencast in Ubuntu Linux

To create a screen cast in Ubuntu we need three softwares
  • recordmydesktop for capturing and recording the desktop
  • gtk-recordmydesktop, a graphical frontend for recordmydesktop
  • mencoder for encoding the recorded video to xvid or any other format.

If you also need to record your voice in the screencast then you will need a properly configured sound card along with a decent microphone. You can test your microphone and sound card settings using Sound Recorder.

You can install the softwares using the following command:
sudo apt-get install mencoder recordmydesktop gtk-recordmydesktop
after installation completes run gtk-recordMyDesktop from Applications->Sound & Video menu

If you want to record your full desktop then simply press record and recording will start. You will see a small square in the Notification Area.
This shows that recordmydesktop is currently recording. When you are done and want to stop recording just click on this square and recording will stop. This square will then turn into a red circle and recordmydesktop will start encoding the captured video. It will take some time before it finishes, after that you can find the recorded video in your home directory.
But if you dont want to record complete desktop but only want to capture a single window then you can click on Select Window button and then click on the title bar of the window that you want to record and recordmydesktop will only record the selected window.
If you dont want a specific window but you want the recording to be limited to specific screen area then you can select that area from gtk-recordMyDesktop's preview area. Just left click and drag your mouse to select the desktop area for recording.
recordmydesktop produces files with .ogv extension. I dont know what codec it uses but the files are big e.g a 10 min recording my take upto 60-70 MB. To covert these files into divx use following commands
mencoder your_file.ogv -ovc xvid -xvidencopts bvhq=1:chroma_opt:quant_type=mpeg:bitrate=658:pass=1 -oac pcm -o /dev/null
mencoder your_file.ogv -ovc xvid -xvidencopts bvhq=1:chroma_opt:quant_type=mpeg:bitrate=658:pass=2 -alang en -oac mp3lame -lameopts br=96:cbr:vol=6 -o your_file.avi
This will convert the ogv files into avi with xvid video and mp3 audio. After that you are done and your screencast is ready. If you want to edit this avi file to add some effects or any thing you can use Pitivi video editor which comes by default with Ubuntu (10.04 onwards)

Saturday, December 11, 2010

Linux Tutorial 1 - Installing Ubuntu

This is my first attempt at creating a screencast, a video tutorial explaining the installation of Ubuntu Linux.

Part 1: Installation

Part 2: Post Install

Thursday, December 9, 2010

Simple network usage tracking with vnstat

If you use Linux, you can use vnstat to track your network usage.
Install vnstat using
sudo apt-get install vnstat
then configure it to monitor a network interface
sudo vnstat -u -i
you can find your network interface name using ifconfig or ip addr command. In my case its eth0

Now to see your network usage issue vnstat command

to view daily, weekly or monthly stats you can use -d, -w or -m switches with vnstat respectively i.e vnstat -m
To reset all the counters to zero you will need to delete the interface's database with vnstat and then recreate it. Use the following command for this purpose
rm /var/lib/vnstat/<interface>; vnstat -u -i <interface>
Please note that vnstat is not a packet sniffer, it simply uses the network stats exposed by kernel. This means there is  non-internet network traffic on your interface e.g file sharing, network gaming or etc than it will also be included in the stats. You can use vnstat as bandwidth monitor if you use a dedicated interface for internet usage like 3g usb modem.