Friday, January 3, 2014
I am so tired of Unity: Part 2 AKA I like Kubuntu/KDE
Friday, December 27, 2013
I am so tired of Unity
Unity has its own merits but it has made it difficult for me to perform day to day operations. For example whenever I have to run an app for which I don't have a launcher icon I have to click the home button and then type the app name for it to appear in the app list and then click on it. I don't like that. I also do not like that there is not button to minimize all windows. I also do not like the fact that every program has its menu in the top panel. When I have two windows open side by side and I need to use their menu, I have to first select the window and then move my pointer miles away to top panel to get to the menu. Similarly I like the close button for a window to be in the top left or top right corner of the screen when they are maximized. This makes closing them easy. But with Unity this is no longer possible. There are a lot of other similar issues which are not a big deal them self but together they make it really difficult for me to perform everyday operations.
But this does not mean I am giving up on Ubuntu, I am not ready to go back to Windows, but I have decided to give Kubuntu a try as well and see how I feel about KDE. No matter whom I end up with, KDE or Unity, I will still be using Ubuntu.
Saturday, December 17, 2011
Android: Debugging your application on real hardware (phone/tablet) on Ubuntu 10.10
To declare your application debuggable, add android:debuggable="true" to
To setup your device, connect it to your computer with a usb cable and run following command:
adnan@adnan-laptop:~$ adb devices List of devices attached emulator-5554 device ???????????? no permissionsif the output contains a line with many question marks (?), as in the above example, then Ubuntu was not able to identify your device. In this case create the file /etc/udev/rules.d/51-android.rules and add following line to it:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
adnan@adnan-laptop:rules.d$ adb devices List of devices attached emulator-5554 device SH1A6TR23522 deviceYour device is ready now and can be used for debugging an application but before trying to install and debug your application on this device, make sure that you have selected the following options on your device:
Settings->Applications->Unknown sourcesNow when your run your app from Eclipse, you will be presented with a dialog of available emulators and devices. To run your app on device instead of emulator select the device from this dialog and your app will be installed and run on the device.
Settings->Applications->Development->USB debugging
Vendor IDs:
| Company | USB Vendor ID |
|---|---|
| Acer | 0502 |
| ASUS | 0B05 |
| Dell | 413C |
| Foxconn | 0489 |
| Garmin-Asus | 091E |
18D1 | |
| Hisense | 109B |
| HTC | 0BB4 |
| Huawei | 12D1 |
| K-Touch | 24E3 |
| KT Tech | 2116 |
| Kyocera | 0482 |
| Lenevo | 17EF |
| LG | 1004 |
| Motorola | 22B8 |
| NEC | 0409 |
| Nook | 2080 |
| Nvidia | 0955 |
| OTGV | 2257 |
| Pantech | 10A9 |
| Pegatron | 1D4D |
| Philips | 0471 |
| PMC-Sierra | 04DA |
| Qualcomm | 05C6 |
| SK Telesys | 1F53 |
| Samsung | 04E8 |
| Sharp | 04DD |
| Sony Ericsson | 0FCE |
| Toshiba | 0930 |
| ZTE | 19D2 |
Saturday, May 21, 2011
VPTCL Wireless: Connect to internet using VPTCL from Ubuntu 10.04
PTCL DSL is great. Its cheap and offers good (reasonable) speed. But PTCL landlines are very untrustworthy and you never know when it will stop working. So I keep VPTCL as my backup internet connection. It is not fast but it works and has almost no down time. PTCL provides drivers and documentation for connecting to internet with VPTCL but everything is for Windows. So you are at loss if you are a Linux user. But dont worry, its really easy to connect VPTCL from linux especially Ubuntu. Basically the driver is there (usb-serial), so all you need is a dialer to connect to internet. Wvdial is a good tool for dialing different PPP connections. Earlier I have written about connecting to Windows VPN using it. To install Wvdial use the following command:
sudo apt-get install wvdialafter the installation is complete, open file /etc/wvdial.conf and add following lines to its end:
[Dialer VPTCL]Now save and close the file. You will need sudo rights for installing wvdial and editing the conf file.
Modem = /dev/ttyUSB0
Baud = 230400
Phone = #777
Init1 = ATZ
Stupid Mode = 1
Dial Command = ATDT
Username = vwireless@ptcl.com
Password = ptcl
PPPD Options = lock noauth refuse-eap refuse-chap refuse-mschap nobsdcomp nodeflate
Now from terminal issue the following command:
wvdial VPTCLWvdial will connect to internet using VPTCL. You will get the connection information in the terminal after issuing this command i.e DNS servers and other stuff. Don't close the terminal as this will disconnect you from internet. Only close it when you want to disconnect. Pressing Ctrl-C in terminal will also end wvdial and disconnect you from internet.
Note: PTCL charges 2 rupees per 20 minutes for VPTCL internet service.
Tuesday, March 29, 2011
Install Firefox 4 in Ubuntu
sudo add-apt-repository ppa:mozillateam/firefox-stable
sudo apt-get update
sudo apt-get upgrade
This will update your Firefox to version 4. Note that this will not install Firefox 4 side by side with your previous version as used to be the case with beta versions. As this installs the stable release version of Firefox so your previous version will be removed and after installation you will only have Firefox 4.0.
Wednesday, January 19, 2011
Limit Internet Bandwidth Usage (internet speed) in Ubuntu
To limit internet bandwidth on a Ubuntu machine install wondershaper. For this open a terminal and type following command:
sudo apt-get install wondershaperNow use ifconfig command to find out the name of interface connected to internet. The name will be something like eth0, eth1, wlan0 or something similar. In my case it is eth0
Now issue a command similar to follwoing (relpacing eth0 with your interface name):
sudo wondershaper eth0 1024 256this will limit the download speed to 1024 Kbps and upload to 256 Kbps. Remember that this limit is for all internet traffic i.e torrent, ftp, browsing and any thing else.
If you want to remove these limits use
sudo wondershaper clear eth0again replacing eth0 with your interface name
Tuesday, December 21, 2010
Install Firefox 4 beta (Minefield) on Ubuntu
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.0The 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)
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 wlan0Now 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.
Monday, December 13, 2010
Creating a screencast in Ubuntu Linux
- 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-recordmydesktopafter 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.aviThis 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
Part 1: Installation
Thursday, December 9, 2010
Simple network usage tracking with vnstat
Install vnstat using
sudo apt-get install vnstatthen configure it to monitor a network interface
sudo vnstat -u -iyou 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
rm /var/lib/vnstat/<interface>; vnstat -u -i <interface>
Tuesday, November 30, 2010
About .bashrc .bash_profile .profile .bash_login and /etc/profile
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.
...
When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, if that file exist.Interactive shell is the one which is not running because of a script and lets you enter commands to interact with it. Login shell is the one where you are asked for user name and password before you can enter commands. An example of an interactive login shell is the one that you get after you login to a system using ssh. An example of non-login interactive shell is a shell that you get when you run terminal from menu item or some icon.
Friday, May 14, 2010
How to connect to Windows VPN from Ubuntu without the help of GUI
First thing you need is to install pptp-linux package. So do
sudo apt-get install pptp-linuxNow create a file /etc/ppp/peers/vpnfile. You can change the file name vpnfile to any name you like but keep it simple as you will need it to connect to your VPN. Now add following lines to this file:
remotename myvpn linkname myvpn ipparam myvpn pty "pptp--nolaunchpppd " name usepeerdns require-mppe refuse-eap noauth defaultroute #defaults from the pptp-linux package file /etc/ppp/options.pptp
The first three parameters provide name of the remote system, name for the link and a value to be passed to scripts in ip-up.d and ip-down.d directories, respectively. These values dont need to be same and can be different. The scripts in ip-up.d directories are called when a connection is established and the ones in ip-down.d are called when a connection is terminated. Next parameter i.e pty specifies that the given script should be used to communicate rather than any terminal device. Rest of the parameters control different attributes of the connection i.e what protocol to use or refuse or whether to use encryption or not and etc. The last parameter i.e defaultroute adds a default route to system routing table when this connection is established. This means that when this connection is active, by default all traffic is routed on this connection. If you dont need this behaviour, remove it and add scripts to ip-up.d and ip-down.d to add only your required routes.
More detailed explanation of these parameters can be found in manual entry for pppd i.e man pppd.
You will also need to add a line to file /etc/ppp/chap-secrets with username and password for this connection.
username connection-name password *
Connection name in this line must be same as remotename, which we have set to myvpn.
Now to connect to vpn, issue command
sudo pon vpnfileand you are all set, connected to your vpn. To disconnect from the vpn, issue command
sudo poff vpnfile
Wednesday, May 20, 2009
Solving Skype audio problem in Ubuntu 9.04 (Jaunty)
stop skype, open terminal and issue following commands
- sudo killall pulseaudio
- sudo apt-get remove pulseaudio
- sudo apt-get install esound
- sudo rm /etc/X11/Xsession.d/70pulseaudio
Sunday, November 9, 2008
Installing Sun Java 6.0 on Ubuntu
Installing Sun Java 6 JRE is simple. Just issue the following command from shell:
apt-get install sun-java6-jre sun-java6-bin sun-java6-plugin sun-java6-jdk
You will need to be root or use "sudo" to perform this operation. You can skip package sun-java6-jdk if you dont plan on doing development in Java.
Once these packages are installed you can use Alternatives to make sun java your default JVM. To do this issue following command from shell:
update-alternatives --config java
You will get a screen like following:
The * sign means that this JVM is default. Enter the number for Sun JRE which in my case is 3. Now you can check your java version using: java -versionSunday, October 5, 2008
Installing and using knockd to allow temporary SSH access
In below example we will use knockd to, upon seeing a specific sequence of port knocks, open a "hole" in our firewall to allow ssh access from outside. Dont worry this is not insecure as you will be the only one knowing that port sequence, unless ofcourse you share that sequence with some one else :)
To accomplish this we will need to do following:
- install knockd
- configure it to allow ssh access on seeing a specific port sequence
- configure it to close ssh access on seeing a different port sequence
Open this file using “sudo nano /etc/knockd.conf”.The file will look something like this:
----------------------------------------------------------------------------------------------------
[options]
logfile = /var/log/knockd.log
[openSSH]
sequence = 7000,8000,9000
seq_timeout = 5
command = /sbin/iptables -A INPUT -s %IP% -p tcp --dport 22 -j ACCE$
tcpflags = syn
[closeSSH]
sequence = 9000,8000,7000
seq_timeout = 5
command = /sbin/iptables -D INPUT -s %IP% -p tcp --dport 22 -j ACCE$
tcpflags = syn
-----------------------------------------------------------------------------------------------------
we need to change the sequence and seq_timeout lines for both, [openSSH] and [closeSSH] sections. This is just a precautionary measure as sequence 7000,8000,9000 is a very common and well known. So change the file to look as one below. You can use any sequence that you like but avoid commonly used ports. You can even use ports that are closed/blocked on ur system as knockd works on link layer and will see all the traffic destined for your system even for closed or blocked ports. Dont change command, tcpflags or logfile options. After you have changed the file save it.
Now you need to edit your /etc/default/knockd. Open that file using “sudo nano /etc/default/knockd”. Change it to match the following. This will ensure that knockd is always run as daemon at init i.e at system startup.
The “-i eth0” will ensure that knockd listens on eth0 for port knock sequence. You can change it to whatever interface that you want knockd to listen at.
Now start knockd. You need to do this just this one time.
sudo /etc/init.d/knockd start
Now you are up and running :). knockd will open ssh access for you on seeing the specific port knock sequence. To try this try SSHing this computer from any other machine connected to this computer on interface that you selected in /etc/default/knockd which in my case is eth0. Your firewall will not allow access. To get access you will need to knock at the doors of your computer and for that you will need knock client on the machine that you are using to do ssh. If you are using a linux machine install knockd package and if you are using windows machine you can use windows client from here.
To knock issue following command ( replace 192.168.1.2 with the IP of your computer)
knock 192.168.1.2 5000 7000 9000
This will open ssh access for you. Now use ssh to access your gateway. When you are finished issue following command to close the ssh access.
knock 192.168.1.2 6000 7000 8000











