Archive for August, 2010

Welcome SAM!!!

How many of you are bugged by Cyberoam at your workplace or college??

For those who don’t know, Cyberoam is a corporate firewall used by many organisations including our college… 😑 😑 😑 to block websites and restrict user’s internet accessibility. To continue (so called) uninterrupted access to internet user needs to login ever hour in Cyberoam client. In our college it also restricts the amount of data that user can access in 24 hrs to 100Mb. So if your usage exceeds than there are only three options for you:-

1. Wait for clock to Pass Midnight.
2. Plead your friends to give you their account details.
3. Make a fool of Cyberoam(Bypass it)….. πŸ˜›

Well for third option you need to be a genius…:D and for 2nd option you need cooperative friends… πŸ˜€

Enough of Cyberoam, lets talk about SAM(Syberoam Account Manager). SAM is simple GUI developed in Python with Qt bindings in collaboration with dhinchak (who gave birth to it… :D) for managing Cyberoam Accounts. In this you can add multiple accounts if you know your friend’s usernames and passwords and to reduce your annoyance we added certain features to it.

It re-logins into the current account after definite interval of time defined by user itself, it can also switch accounts if usage of one account reaches critical limit specified by user or it maxes-out. There are also notifications options which user can customize according to his liking. There are many more features in it which user can exploit if user wishes so as it’s OPEN SOURCE …. :D.

That’s my friend SAM( πŸ˜€ ). Do you like him?….NO…it’s your choice. It’s my creation and I love himm… :P.

After reading the post ,if you are slightly excited to check out SAM, it’s source is available at
SAM. For for information please have a look at README file in the source.

Though it’s still in development phase and since its tested only on our college’s server, it might not work fully or even partially outside our campus. Although we are working on it.

See you later….
Adios and Do comment… πŸ™‚ .


Package Synchronizer [Arch]

This is a small script that I wrote yesterday in order to synchronize my packages that are stored in my cache directory (/var/cache/pacman/). It creates a directory defined by user where it stores all the latest version of the installed packages available in your cache directory.
This script first gets the list of all packages installed in your computer. Just running the “pacman -Q” command and then searches for .pkg file for each package installed, in your cache directory.
If found it then checks whether a newer version is already present in the user directory, if not then transfers the package to the user directory and if an older version is already present in the user directory then it transfers it back to the cache directory

#A simple Package Synchronizer
Author: Mohit Kothari <>
import os
import shutil

pkg_dir = "/var/cache/pacman/pkg"
lat_dir = "/var/cache/pacman/bck_pkg"

if not os.access(lat_dir,os.F_OK):
	os.system("sudo mkdir "+lat_dir)

os.system("pacman -Q > list")
list_fl = open("./list","r")
pkg_list = list_fl.readlines()
length = len(pkg_list)
ctr = int (1)
print"Completed [",
for l in pkg_list:
	perc = float(ctr)/float(length)*100
	print"\rCompleted["+"-"*int(perc/4) + "] "+str(int(perc))+"%",
	spli = l.split(" ")
#	print spli[0]
	com = "ls {1} | grep ^{0}-[1,2,3,4,5,6,7,8,9,0] > pkg".format(spli[0],pkg_dir)
	pkg_fl = open("./pkg","r")
	pkg_list = pkg_fl.readlines()
	if len(pkg_list) is not 0:
		size = len(pkg_list)
		pkg_name = pkg_list[size-1].split("\n")
#		print pkg_name[0]
		com = "ls {1} | grep ^{0}-[1,2,3,4,5,6,7,8,9,0] > pkg".format(spli[0],lat_dir)
		pkg_fl = open("./pkg","r")
		pkg = pkg_fl.readlines()
#		print pkg
		if len(pkg) is 0:
			com = "sudo mv {1}/{0} {2}/".format(pkg_name[0],pkg_dir,lat_dir)
#			print com
#			print "IN VEEVR"
			pack2 = pkg[0].split("\n")
			if pack2[0] < pkg_name[0]:
#				print "MOVING"
				com = "sudo mv {1}/{0} {2}/".format(pkg_name[0],pkg_dir,lat_dir)
				com = "sudo mv {1}/{0} {2}/".format(pack2[0],lat_dir,pkg_dir)
#				print com
	ctr = ctr+1

Just run the script as root as it makes changes in var directory which requires root privileges.
It will show the status of completion as follows

[zarthon@zarkost ~]$ sudo ./
Completed[-----------------------] 92%

By default the user directory is specified as “/var/cache/pacman/bck_pkg”
You can change it in the script.

Apology of NULL Pointer

Well this post is not exactly my creation rather I came accross it when I was surfing trolltech’s blogspot.

So I am just copying the text, as I liked it very much and wanted to share.

Here it is:-

"Nobody likes me. I’m despised everywhere I go. I am accused of being the responsible of many problems and even calamities. Some say that I am accursed. Some even say that I am some kind of disease that needs to be cured. When people see me the first thing they think is β€œoh no, not again…”. Nobody has a kind word for me. People spends hours and hours finding ways to make sure that I am not welcomed. They spend incredibly amounts of time looking for ways to avoid me, to squash me and to make sure I cannot even get close. Even worst, some people has managed to make me invisible to their eyes, so even if I appear they do not see me. If I manage to get close and say β€œhi”, they do not say β€œhi” back to me. In fact, whenever I say something people look at me very weirdly. People has been told since the beginning that I am the worst thing that could ever happen to their software.

They do not understand me. And in fact I think nobody understands me. But that is ok, because no matter what I will still be around after your software is done. I will still be around when your software becomes outdated. In fact, you can count on me being around all the time. And yet I’m not haunting you. If you just stopped for a while and listened to my message, you will see that I can be your best friend. My mission is very simple: if I appear in your software it is not a sign that your software is badly designed, I’m just pointing out a case that was not considered before. If you could just understand that sometimes it is much better that I come and say β€œhi” than to close the door to me, you will realize that we can work together to make your software the best software ever. So please, stop cursing me and for once try to listen to my message.”

Two weeks inn…

Hello Friends,
Its been a while since my last post, so here it is….

Since my last two recent posts were of my projects, i thought it would be good to write some thing new as there are two more technical post waiting to be posted..:D
Its been two weeks since my college started and I am packed with my college schedule, partly because i selected 2 Group electives for this sem which are kinda tough as they both have labs so in all i have 5 labs in 4 days..:( I am seeing a really tough time ahead of me which is gonna get tougher once I start my GRE prep. but this time , am nt at all worried as was previously …:D

I have been busy these days developing a simple Cyberoam Account Manager in collaboration with Viranch
and completing my summer internship under Prof. Samaresh Chatterjee regarding Understanding and implementation of PageRank. More about this will be posted in my next post.
In the course i also watched “Once Upon a time in Mumbai”… i gotta admit that it was one of the most horrible movie i have ever seen, though it didn’t topped the list of unbearable(s) but it wasn’t far behind. I am still pondering over my decision to watch this film even after knowing that it was a BALAJI PRODUCTIONS and also can’t understand why other people are liking it may its the magic of EKTA KAPOOR that seems to doesn’t work on me anytime…:). Well i think every one has his own opinions but as far as i am concerned i wont recommend anyone to watch this film.
Well that’s all for now…


This is a test post from Kblogger