Wednesday, 30 January 2013

How to activate BSNL Mobile missed call alert free service in android gingerbread

BSNL provides free missed call alerting service. I just now configured and tested this service in my mobile. My mobile is dell xcd35. I am sure it is the same or similar procedure in other mobile phones also. Very similar if it is android gingerbread phone. In the mobile goto
         Settings -> call settings -> GSM/WCDMA call settings -> Call forwarding -> forward when unreachable and enter the number 17010 and click enable.

Call forwarding is also called call diverting in other terminology.

I tested it by switching off the mobile and calling it. When i turned it on back, i got a sms saying there is call from number at time. Good to see that bsnl is providing such valuable service at free of cost, while other service provider charge it. I have seen a similar service (though not same) from tata docomo charges 15 Rs per month for missed call alerting service. Hail BSNL mobile.

Tuesday, 29 January 2013

Change windows 7 user account password from linux

The below post describes the method i used to change the windows 7 administrative account password for the username ashwin.

First i tried to view the password , so that i dont have to change the password. So i downloaded the ophcrack and burned it into disk. Then upon booting from disk i found that it was smart to show the user account that exists and it correctly shows the accounts with blank password. But it failed to show the password for ashwin account. This happened even after loading of all tables and it took 10 mins to load the tables. So ophcrack failed for me.

The next step i tried was to nuke the password. For which my linux partition helped me. I had the laptop dual boot with linux. I booted into the linux partition and mounted the windows c drive. I used the package management software ( pacman in my case ,  other popular package management tools commonly found are yum and apt-get) to install chntpw. Then i did the below:

             #mount -t ntfs /dev/sda2 /windows/c/
             #cd /windows/c/Windows/System32/config/
             #chntpw -u ashwin SAM
             i choose 1 and then write to sam and then reboot into windows.

Now i am able to login to windows ashwin account and change the password as desired. 

Make sure you use the right device number in the above mount command. Mine was /dev/sda2 , yours could be different (most likely it will be different).

Saturday, 12 January 2013

cli ways to prevent certain package upgrade and get repository package version

i stumbled upon 2 things which i am going to share with you. These i got from google search.

1st) I was looking for ways to make the ubuntu not to upgrade the thunderbird package. In previous post we saw how to achive this in GUI mode. The problem with GUI mode is that it works only in GUI , if you use command line tools then GUI rules wont apply. So i tried

# apt-get upgrade

and it lists thunderbird in it and i looked for option to disable thunderbird even through cli tools. So below describes that procedure.

# echo hold | sudo dpkg --set-selections

The above line does the job. So i did my thunderbird stop upgrade as follows:

#dpkg-query -W \*thunderbird\* | cut -f1 > 1.lst
# for i in $(cat 1.lst)
echo $i hold | dpkg --set-selections

#apt-get update

Now thunderbird package does not appear even in cli (apt-get) upgrade list.

2nd) The other thing i wanted to see was a way to get the package version in

apt-get upgrade

When you issue the above command then it only list the packages that are going to be upgraded and not the version number it is upgrading to, that way yum does the job. But there is a way to see the package version in repos and package version currently. The good part is that it need not be a package in upgrade list . It can used to compare the latest version in each branch in repository and your PC.

To see package version in your PC:

dpkg-query -W package

To see package version in the repository:

apt-cache madison package

This madison option is awesome.

Thursday, 10 January 2013

How to make ubuntu ignore updates for certain packages

If you want , you can ask ubuntu not to keep bugging you for updates to certain packages. For example I dont want ubuntu to keep prompting me for updates to thunderbird, since i dont use thunderbird. So here is how i achieve that:
Goto the ubuntu dash home and goto synaptic package manager and in the search bar in synaptic type your package name (thunderbird here) and select the package and click Package (from the menu bar) and click lock version. Repeat the same for every package you dont want ubuntu to prompt.

If you want ubuntu to never check for updates:

ubuntu dash home -> update manager -> settings (lower left corner) and enter password -> Updates -> in the section Automatically check for updates select never.

This is for ubuntu 12.04 LTS.

But i certainly warn you that swtiching off updates is not a good idea. If possible you should keep atleast security updates. 

Monday, 7 January 2013

Fuse ssh filesystem, context switching and other things

I am making a blog post after a long time.

1st thing : SSH fuse fs

ssh fuse filesystem is great. Today i installed sshfs on my ubuntu desktop and mounted the home dir of my remote linux server on my desktop. Voila , it worked.  The best thing about this is that there is zero configuration to be done on server side. Now it appears as just another local file. I thought there would be lag since file needs to be fetched from remote server over internet. But nothing like that happened. I was continuously playing audio files for last 2 hours since i installed and mounted the remote fs, there has been no lag so far.  I mounted the fs thus,

sshfs -p port user@ip (or domain name):/remote/dir /local/dir >

Also i added myself to fuse user group. By
(one time setup and i am not sure if this is required , but ubuntu docs says to do it)
sudo gpasswd -a fuse

In case you dont want to run the sshfs command manually, you can add a line to /etc/fstab to auto mount on boot.

2nd Things: Context switching, finding the how much and which

Context switching maybe a costly affair if there are a lot happening. You can find out context swtiching amount with the vmstat command. vmstat is more amazing than i thought. Basically because i thought vmstat man page would be cryptic and  huge. But to my suprise , it written in simple and short. If you run


then the there is a 'cs' column in output. This tells how much of context swtich is happening.

Another awesomeness of vmstat is when it is run on Virtual Machine OS. Here it has a 'st' column, which is the amount cycles stolen from VM.  Read the man page for more useful and interesting options like the -d which shows disk stats.

Now that you know the amount of context switching happening , you may be interested in knowing the processes and context switching. For which the pidstat command from sysstat package. The following command list the processes and their context switching:

pidstat -w

Among other details , It has two columns : cswch/s and nvcswch/s
cswch/s is voluntary context switching per second
nvcswch/s is involuntary context switching per second

If you want to thread level details then add the 't' option.

3rd thing: My searches and unsolved things

I see that many a times my ssh freezes and drops me back to originating shell with the messgae:

write failure: broken pipe

Searches indicate that it could be a network issue. The solution they suggest is to add a ServerAliveInterval number_in_secondsto ssh config file on client side. It is basically a keep alive setting. 

Running sestatus on a linux VM running centos 6 suprises me. It says command not found.  So does this mean VM's cannot have selinux ?
I wanted to try a internet search engine that is not one of the usual 3 (google, bing or yahoo search). I came across :

  • clusty, 
  • dogpile (meta search engine that collects results from the usual 3)
  • duckduckgo ( combines its own search results with the results of the usual 3)

I started to hate this endless scrolling thing that now all sites seems to be doing. As far as i know, it started with facebook and now everybody seems to doing it. I hate it. I liked clicking on next button at the bottom of the page.