Hack: Mange Fluctuating Wireless

I am trying this small script with a so called gui 😉 . This helps managing my wireless in the extreme conditions. Just a shell script. Run the script as root otherwise it’ll not work.

Get the script here or copy the code below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
#
#	Author - Kulbir Saini, IIIT Hyderabad.
#	Home - http://saini.co.in/
#	KWirelessManger - Just for fun.(It works ... its not just fun).
#
 
#Give the popup life.
POPUP_LIFE="10"
#kdialog --passivepopup "Welcome to 'KWirelessManager'"  ${POPUP_LIFE} &
#Give your device name for proceeding further. It may be one of wlan0, ra0, eth0, ipw2200 etc...
WLAN_DEVICE="wlan0"
#Give your WLAN host to be connected.
WLAN_HOST="IIIT WLAN"
CONNECTED=0
while [[ 1 ]];
do
	iwlist ${WLAN_DEVICE} scanning 2> /dev/null > /tmp/iwlist.aps
	grep -e "Cell" /tmp/iwlist.aps | tr " " "\t" | cut -f15 > /tmp/iwlist.apadd
	ACCESS_POINTS_IN_RANGE=`wc -l /tmp/iwlist.apadd`
	for ACCESS_POINT_ADDRESS in `cat /tmp/iwlist.apadd`
	do
		iwconfig ${WLAN_DEVICE} ap ${ACCESS_POINT_ADDRESS}
		#kdialog --passivepopup "Connceting to Access Point ${ACCESS_POINT_ADDRESS} ..." ${POPUP_LIFE} &
		echo "Connceting to Access Point ${ACCESS_POINT_ADDRESS} ..."
		WLAN_STATUS=`service network restart | tail -1 | grep "FAILED"`
		if [[ ${WLAN_STATUS} == "" ]];
		then
			#kdialog --passivepopup "You are connected to ${WLAN_HOST}." ${POPUP_LIFE} &
			echo "You are connected to ${WLAN_HOST}."
			CONNECTED=1
			break
		else
			#kdialog --passivepopup "Failed to connect to the Access Point ${ACCESS_POINT_ADDRESS} :(" ${POPUP_LIFE} &
			echo "Failed to connect to the Access Point ${ACCESS_POINT_ADDRESS} :("
			CONNECTED=0
		fi
	done
	if [[ ${CONNECTED} == 1 ]];
	then
		sleep 180;
	fi
done

Please suggest any optimization and do tell if u like it.

 

How To: Configure Evolution

Well if you already know it, don’t waste your time. But if you don’t know just go through it. Today I started using evolution mail for viewing my mails at the students mail server. Its very attractive as you have vast variety of options for making contact list and its fast and easy way to have your mails at hand. Filters are provided with different specifications. You have your calendar to schedule your jobs and much more to explore. Following are the configuration steps.

1. Start evolution mail by clicking this icon Evolution Icon on you panel or in start menu go to internet and click Email or evolution mail or run command “evolution” from the terminal.

2. A window like this will appear

Evolution  Startup

Evolution Startup

click forward to have this …

Evolution Mail Account

Evolution Mail Account

after adding user yourname@students.iiit.ac.in click forward ….

Evolution Mail Account Preferences

Evolution Mail Account Preferences

choose imap as server type and fill other required information and click forward ….

Evolutoin Mail Server Preferences

Evolutoin Mail Server Preferences

fill information accordingly as it suits you and click forward …

Evolution Account Name

Evolution Account Name

name the account and click forward …

Evolution Finish

Evolution Finish

click apply and it will ask your password for the account give the password.

Now enjoy the facilities provided in the evolution mail browser.

 

How To: Configure Kopete Messenger

Kopete is one of the Instant Messengers available for linux and is an alternate for gaim for kde. Though the older versions were not good enough to use but the recent versions are just awesome with a good gui. Its very easy to use and it also goes to the system tray when you close it. You can logon on to yahoo, msn, google talk etc. in just one widnow, minimizing the memory usage bye the application. It asks to view or ignore whenever a new message comes from a user with you were not chatting already.

Installing/Upgrading

1. You have to get the latest kopete package from the sourceforge or kde official site.

Unzip the bz2 package with command…

[saini@localhost]# bunzip2 -d package.bz2

change directory to package and then issue these command

1
2
3
4
[saini@localhost]# ./configure
[saini@localhost]# make
[saini@localhost]# make check
[saini@localhost]# make install

These should not give any errors, make and make install normally takes 15-20 minutes on an average machine.

Now you are ready to use kopete if it gives any problem try to have a reboot because I faced some problem which rectified itself after a reboot.

2. Adding accounts

Now go to k-menu -> internet -> kopete and that it.

When kopete opens go to settings -$gt; configure…

Kopete Main

Kopete Accounts

Click new and select new

Kopete Choose IM Server

Select yahoo and add your account…

Kopete Yahoo Username Password
Go to account preferences and browse your photograph

Kopete Yahoo User Preferences
Just click next and finish and you are done with yahoo account.

Similar is for the MSN Messenger, No special settings.

If you want google talk also. Then you have to install some support for tls

Download the source package qca-tls-1.0.tar.bz2 from here.

If it gives no errors and got install without any errors. Then go to add account and select jabber in the add acount wizard menu and do as shown

Kopete Add Gmail User

and in connection tab do

Kopete Gmail Server Preferences

click next and finish and now you can connect to Google as well.

If you have further suggestion, please leave a comment.

 

Humour: Funny Behaviour of rm Command

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@localhost pub]# ll
total 1648
-rw-r--r--  1 root root  85648 Jun  5 23:52 14thtop.png
-rw-r--r--  1 root root 262852 Jun  5 23:52 orkuthelper.png
-rw-r--r--  1 root root 143804 Jun  5 23:52 shot1.png
-rw-r--r--  1 root root 160552 Jun  5 23:52 shot2.png
-rw-r--r--  1 root root 159934 Jun  5 23:52 shot3.png
-rw-r--r--  1 root root 141849 Jun  5 23:52 shot4.png
lrwxrwxrwx  1 root root      9 Jun  4 18:44 windows -> /windows/
[root@localhost pub]# rmdir windows/
rmdir: 'windows/': Not a directory
[root@localhost pub]# rm windows/
rm: cannot remove directory 'windows/': Is a directory
[root@localhost pub]#

can you just tell me how to remove this directory? plz… urgent help required …

 

How To: Configure Wireless with Ralink (RT2500) Level One WNC 0301 in Fedora Core 4

Yesterday after a lot of trials with Fedora Core 5 to activate my wireless LAN card, I switched to Fedora Core 4, which looked much more stable than FC5. Actually with FC5, I mainly faced problems with gui , my mouse which is Microsoft USB mouse and my wlan card which is level one Ralink RT2500. In FC5, I tried both with ndiswrapper and madwifi but nothing worked out for me. Also my mouse was not working well. I can click things but the pointer was not visible like microsoft gave me a invisible mouse or this microsoft mouse don’t want to work with Linux. After installing FC4, I felt very comfortable with guis and my mouse. They worked fine. But now there were two problems. One is that FC4 was not able to detect my soundcard and the wlan was not working again. Anyway soundcard is not a big problem, as it worked in FC5, I’ll make it work with some up-gradation or things like that. But the major problem is wlan. And here goes the methods which I tried to activate my wlan card.

Method 1. With rpms

I downloaded these rpms

1
2
3
madwifi-0.9.4.12-16.rhfc4.at.i386.rpm
madwifi-kmdl-2.6.11-1.1369_FC4-0.9.4.12-16.rhfc4.at.i686.rpm
madwifi-hal-kmdl-2.6.16-1.2111_FC4smp-0.9.6.0-20.rhfc4.at.i686.rpm

from the site atrpms and tried installing them but they failed the dependency /boot/vmlinuz-2.6.16-1.2111_FC4 , then i tried to find this rpm everywhere on google , rpmfind etc …. but I could not find it. Then I installed it with –nodeps option and configured according to the data given here .
But in vain.

Method 2. With ndiswrapper using Microsoft Windows XP drivers

I downloaded the ndiswrapper-1.16 from sourceforge.
I untarred it and used these commands.

1
2
3
make uninstall
make
make install

Please don’t forget to the read the INSTALL and README files in the ndiswrapper-1.* directory. Then I inserted my LAN card driver cd for XP and copied the drivers directory which contains .inf and .sys files to my root directory. Then I used the commands .

1
2
3
4
5
ndiswrapper -i Rt2500.INF
ndiswrapper -l
modprobe ndiswrapper
iwconfig "wlan0" key open "wep 128 bit hex key" ESSID "IIIT WLAN"
dhclient wlan0

I ran all this command and I am very happy to say that wireless LAN did not work. 🙂 Then I ran this command

touch /etc/sysconfig/network-scripts/ifcfg-wlan0

and then edited this file. I entered all the data suggested here except that second line I wrote

DEVICE=wlan0

OK. Then i ran

neat

and edited the properties of wlan device by double clicking it and gave the 26 letters wlan key there and activated the device and it worked 😀