December 13, 2008

Yahoo not sending my mails

Yahoomail is giving me trouble in mailing also.
After composing an important mail and clicking "SEND",all that they have to inform me is that "Message could not be sent due to a connection problem" in the purple font.And a retry button,that never seems to work (as if made to look as if clicking it will solve the problem,but believe me,it doesn't..atleast didn't for the 16 times I tried it from various 'angles') makes the issue worth posting. :)

November 30, 2008

XP Sp3 Nvidia driver issue


Found that nvidia chipset drivers(graphics) do not work with windows xp sp3.I was trying to play "Rise of Nations",but it didn't load due to some graphics problem.Early,I had the issue with World of Goo,but I didn't know of that game's specs,so left it there.

Anyway,on checking the 'dxdiag' on the Video tab,Direct 3D was disabled.So I searched the net and found that indeed sp3 was the culprit,and the suggested solution was to download and use the latest chipset from nVidia.So,I downloaded the 84 mb driver and installed and restarted the pc.Voila,fixed.

Just came back after playing the game for a couple of hours(cheating of course,not bothering to play it fairly and slowly).

November 26, 2008

Yahoo! is bugging me ..


I wonder what has happened to Yahoo! services nowadays. None of them load properly for me all the time.
I use Mail,Answers and delicious.All three have been upset in some or the other way.
Logging into mail leads to many errors coming up as message boxes(strange enough that I suspect malicious activities..but even on Linux?) and finally leading to me opting for classic mail,which has no images or backgrounds and no proper ordering of contents..I didn't investigate what exactly is off,but then I am not pretty good with web stuff..

The above list of services is in the increasing order of usefulness and frequency of use for me...and hence the errors with Answers bugs me more than mail.It shows similar errors with only text showing up,that too one beneath the other and no horizontal spacing and all..I know I am not stating the correct technical terms,but I am helpless about that :) Sometimes,they even turn up errors that say 'Oops' ...

The most important tool that I use almost daily is delicious.With the new interface I found its use increasing for me...and now my earlier method of browsing the bookmarks via the web interface has to be dropped as it doesn't load in the new interface or as any interface..the links are listed vertically and that needs tedious scrolling..so I stick to logging in and using the integrated bookmarks using plugins in Firefox.

All these look like some rendering issues,so would I be right to think the issue is with FF3?But I couldn't find any article or issue of this form reported anywhere or never heard anyone talk about it..I wonder if something is off at the other side..Yahoo's web servers having issues of some kind?
Any idea?anyone?Its irritating for a pretty much used service from a company I had dreamed to join and prepared like hell for it turning up so bad...


Update:Finally,on whitelisting the site with Adblock,the problem seemed to be solved.But it exists even now,and doesn't seem to be going even after disabling Adblock.So,the issue persists....

November 25, 2008

Bootchart

This is about a new tool I started to use,bootchart.
As the name implies,it is used to make a chart of the booting processes.It gives CPU and memory usages at various stages of booting and also informs which processes are running and how much resources it uses.
The results are stored in /var/log/bootchart/ as .png files..so that we can view it as graph.

The tool actually runs ahead of init as a daemon bootchartd and hence is able to monitor all subsequent processes.
It is a nice tool that helps you analyze slow or abnormal boot times(though there are lots of other ways to find and solve boot issues).I cannot say if it is ultimate,but it is kind of user-friendly,as in no cluttering with jargon and information.I didn't take the time to read more on it,as I have an exam tomorrow.But I did do a search on Google,and found some of these..you may read through if you wish..

Home Page
Bootchart refresher course
Distro comparison
Linux.com article
Usage guide
Debian Article
Ubuntu Time Saving Tips from nixCraft

November 17, 2008

Double Bonanza

Yippe..just confirmed the news that BSNL is providing broadband at double the usage limits to users who have been subscribers for atleast 6 months...
I have now 5 gb as the limit...and I am at about 1.53g as I speak..so gonna do downloading in broad daylight (happens rarely)

I thank BSNL for bringing such a nice offer,hoping that this doesn't lead to any problems due to confusion and bring about huge bills next month.This news was confirmed by authorities when I called them up.It is an offer that lasts only for November...and it is gonna help in the project hunt.

Happy...

November 16, 2008

Flop Quiz

I was restraining myself from posting about this..but I guess I am doing the right stuff..

This is about the Free Software Quiz conducted by CUSAT during the Free Software Conference they are having over the weekend.The entire event is pretty large and well organized, with lots of dignitaries and loots of politicians pouring in...there is a good exhibition as well...featuring lots of stalls by companies,organizations,colleges etc for promoting free software related work...though I must mention my inability to understand how some of those stalls are even remotely connected software(free/proprietary).

The Quiz in itself is something to be mentioned.We were invited many times..lots of papers were circulated,we were even asked in person to register.So me and my friend Cijo, left the stall duties our juniors and came early for the prelims at abt 9..which finally began at 10.30 in a hall filled with only school students !!Later some college students also poured in..and the question papers were given.We were awaiting a standard type quiz on open source and free software movement,personalities,licenses,projects etc...but it turned out to be what I call 'Free' Software Quiz.It was like some school level paper on computers..definitely hard for the kids..but I finished it in 5 minutes,though not answering all questions correctly as they were very specific into technical details,nothing on the line of the entire Free Software Movement as a whole.We weren't allowed to leave the hall until about 25 minutes passed :(.Results were to be announced at abt 1.30 with finals at 2.

After leaving the hall..we were sure to get in..coz it was really a crappy paper.We went onto our jobs with stalls..until afternoon and finally at there Open Air Auditorium..the results were announced after some waiting.We were in first.Total 5 teams from junior and senior sections respectively were chosen.One junior team was from my school as well(10th std).

What followed later on in the name of Free Software Quiz was the biggest flop quiz I have ever seen...off the topic...too complicated and into internal details of specific linux flavours...asking unrelated questions on some god-knows-what technology and many more on exact dates and years!!! In addition to all this...they repeated many questions which were answered earlier by either participants or the crowd(still some didnt answer those..wonder why).The quizmasters themselves having no idea on the topic relied on a guy called the 'judge'.. another fellow who wanted answers by the way it was written down!

After the juniors' quiz came ours...almost on the same lines..asking unknown details of unknown stuff...RNDC,how many mails can be sent by qmail(wtf)..and asking abt configuration files that exists in fedora only and not in other flavours like the common Debian(anyway the entire quiz was off track from being a free software related one to one which was half cooked and some tech stuff added to maybe increase difficulty just for the sake of it)..and again asking questions asked to and answered by junior teams over and over and even mixing tough ones with very simple ones like GNU's full form..blah
We had discussed two things before coming stage..one abt Mark Shuttleworth of Ubuntu fame and about the year Linux came out( I said '91,Cijo corrected me as '92).The first question was asked and I got it correct after it was passed by other teams.The second one was asked in a rapid fire round at last ...where I said '92 and ans turned out to be '91.:D The team from MES got away with first prize as they ans one question more than us(they were at tie before that) which was full form of GNU!!! Can u believe it..I can't ..this could be the crappiest quiz I have ever participated or even seen in my life..that too conducted by BTech students of CUSAT...to say the truth..I feel sorry for those guys..so I didn't criticize them there...and the prize didn't involve any money..so its all the same for us.. :D

Anyway it was a funny incident ...we r still trying to put the blame on each other for not winning this crappy quiz...
Site for the conference

November 14, 2008

BOSS is here

Today I got a copy of BOSS( Bharat Operating System Solutions ) from the CUSAT stall of C-DAC, after a fierce argument.
I hadn't been interested in this flavour since it time of release,because I didn't see any real enthusiastic support for it from the community in any forums..so I thought it must be really crappy..used for Indian govt offices and all...

Today the major attraction at their stall was a distributed system they call 'Chinnu' that performs heavy tasks using a Message Passing Interface(MPI)..just learnt in the paper AAP( :( )...BOSS was apparently near there and they started explaining..I caught off the difference between this and Debian Malayalam..they couldn't clarify my doubts..not only because I was not sure about the topic...they weren't the actual people who had developed that..this is what I understood.

Anyway..the DVD wasn't given away to many people from the stall..so I decided to try it on the laptop that was taken from college for the stall.I booted it up..and observed a pretty good bootscreen.....nice graphics...
The loaded Desktop looked very much like the normal debian with a blue wallpaper..looked good.


I just checked out all the menus and options..it looked much more like Ubuntu than Debian..even had customized icon set..with compiz fusion and k3b (among other extra apps) pre-installed. So, I just checked out if it played all media formats and fired up an mp3 from my usb...and it didn't play as expected and gave the similar sequence of steps as Ubuntu does( to search online for packages).So far so good..I have only checked it out for few minutes..not bad.

Only problems faced are the sluggish control..but then it is normal when such heavy stuff run on 256mb ram...and it couldn't even mount the Debian partition on the hard disk citing permission problems..funny!

I checked out their site,registered and travelled here and there...checking out content..not bad..but they seem to be giving too much credit to themselves for the quite simple tasks they seem to have done..and this has been confirmed by our Free Software puli Sarath Lakshman of the 'Slynux' fame.He says BOSS and his group i.e the Swanthanthra Malayalam Computing are engaged in some fight.He accuses BOSS of removing credits of many softwares and using wrong usages and principles over the entire OS.
May be this is the reason to the lack of enthusiasm among many people for the distro..anyway its not such a bad distro.I might try it for some time before coming back to life using a normal distro than a pseudo 'live' one...
Frankly I am fed up of the live cds..running on different pcs..exotic ones especially..and especialllllly.... gOS and SliTaz..crappy ones ..nothing big to explain about for a whole day.I have got nothing to say about Jacklab Audio Distribution...its pure waste as far as I am concerned..but Backtrack and Geexbox rule!!!
Tux Rules...!!

November 13, 2008

Google Introduces Video Chat

Wow..google comes up new feature.just saw..lets see if its good enough..hm..clicked the link and reached the site..
As usual.the beautiful page that google always sports...with the same type of buttons( of chrome and lively fame) and owww..hm..they have kept that same thing over these three products...crap...

It's free and installs in seconds
System requirements: Windows XP or later


Why only windows xp...?why not Linux..why don't they ever release products for Linux anymore..I would love to see chrome get more add-ons and a Linux version...they are using the beta excuse over the line..
Hm..and ya ok..whatever..lets see what they have to offer...clicked 'Learn More'
and hehe...and what awaits is...ads from Buy.com for web cams and also a link to Google's product search for webcams..so this is just an ad gimmick..not focused on the technology it seems..

Feel lil bit sad after learning Pagerank for IR today( easy paper..:) )....hm..have a stall at a Free software national conference at CUSAT tomorrow..got some work also..

September 01, 2008

BSNL Dataone screws up own service

This is the biggest news of today.that is why I am taking my time to post this,even though I have two exams to prepare for tomorrow :)





From today morning,my friend who uses Dataone 500C was getting a strange problem with the otherwise troublesome service.Whatever url he gives in his browser leads to a page that contains a login page and tells the user that their bandwidth has exceeded 1 GB.

http://172.30.3.134:8080/ssssportal.war/exceedlimit.jsp

I being a user having 59 range of ips and him being a 117 user(a class of users doomed to face the wrath of foolish dataone engineers),I had no issues. The description of the problem suits a classic DNS poisoning case.Whatever url you give,is redirected to the above said page,asking for username and password(which doesn't work also :P).So I feared it might be related to the BIND bug that had surface a few weeks back and is at large even now.Our lab administrator had explained how dangerous that could be and we had seen it attack ours as well as our University's sites.

So,I advised him to move to OpenDNS,hoping that it would have solved the issue.But it didn't.One thing to note is that torrents were working properly,you could visit secure sites(which used https),use Yahoo Messenger etc.Also ping and other network tools work without issues.I was wondering if its some kind of virus,as he and some others who had issues were from Windows.

This continued till just a few minutes back.I looked up several forums,and found one which mentioned and debated various reasons for this to happen.The last post was by a guy who got info from BSNL that this is a legitimate work of BSNL that got screwed up due to their usual crappy implementation policies.

The intention was to warn the user that their bandwidth has exceeded 1GB,so they can login,accept and continue with net usage.But thanks to the good engineers sitting over there,the login code was not in place..hence giving it a hacking site look.Also the traceroute gave its position to be just after the BSNL site,making people think that the site got hacked or corrupted.Also as the users were never informed beforehand of such a move,all were taken by surprise.But thanks to a few ppl in 117 range who didn't cross 1GB,I could fix that it was not bind bug,in which case it would have affected all 117 ppl at once,or even using OpenDNS would have solved problem.

I just got information that it has finally been fixed.But I wonder how could such a blunder have occured?Why did they implement a feature without warning or informing users?Shouldn't they have given workaround or info on the page they had redirected everyone to??? And wth did they not test the login code that was supposed to affect thousands of users all over India???This is not the first time such stupid things are being done by them.

On implementing and introducing the 117 range of ips,their login and usage checking site was a complete mess...it was a big headache for those users.A friend informed me that its not quite perfect even now.Also there were many cases when users got huge bills as big as 35k per month.Their support system certainly has improved a bit(8 bit=1 byte),but they still can deal with only the old issues that plagued initial Dataone users,like with the router and other things.Most of the BSNL offices responded to this issue by either taking the JTO's phone receiver off the cradle or giving a list of phone numbers(mostly disconnected ones) to call to.

Hm...I have been using BSNL Dataone for quite some time now..I had faced some issues,but the new 117 users are facing much more troublesome ones...not to mention the other bureaucratic delays involved...Why is all this happening to such a big company that deals with such a huge number of customers who are paying to get good service.The speed and plans provided by Dataone makes it a destination of all those who can afford it(time cost far exceeds financial cost).I still can't figure out what is happening at their technical office...what the engineers were thinking before letting out such a new feature...are they dumb???I am not alone is expressing this kind of feelings...just google for BSNL or bsnl sucks or check any broadband related forum..there are always more people pointing out new and strange issues of the service than those pointing out good features.

I do appreciate their technical service quality(read as bandwidth and speed),but their implementation and support policies are the worst of any I have ever seen or heard in this high tech field.The fact that they do limit speeds during 2-8 is something bad which I add here...so thats it..hope those guys improve ...

"Good decisions come out of experience,but experience comes out of bad decisions!":P

August 21, 2008

'i no tail'

This is about a package called 'inotail'.
Tail is a very common command that even basic linux users use.
You might have also seen the tail -f command for tailing the contents of any file continously...and this is very useful for monitoring logs...
But by default tail -f checks the file for updates every one second..whereas inotail uses the inotify property of the kernel to decide if the file needs to be accessed...try this out.

This is supposed to increase system performance for log monitoring purposes.

August 10, 2008

Command line fun

In Ubuntu,press alt+F2 to get the Run Application window.
Type "free the fish" and enjoy...

Try these if u want a laugh
1)apt-get moo
2)aptitude moo
3)aptitude -vv moo
4)aptitude -vvv moo
5)aptitude -vvvv moo
6)aptitude -vvvvv moo
7)aptitude -vvvvvv moo

Really these guys have no other work it seems..but its nice to see some fun in the otherwise "Why so serious" attitude of CLI....

Enjoy

fork bomb deployment

I have been telling about this to my friends over the last few weeks,now I am gonna post it here..
its the fork bomb..currently I will deal only with the Linux one...

vivek@vivek-desktop:~$ :(){ :|:& };:

What happens after this ?Please do try it out at home.Then read beyond this...

It is a fork bomb.When a process fork,a child process is created.Here we define a function ':' which calls itself and pipes to itself,thereby recursively calling itself and also goes to background.Once you type this and press Enter,you can't help...will have to reboot system manually.



What happens is that the infinite number of forked processes flood the process table and bring the system down.This is an ideal DOS attack.

Here I like to deal with more than introducing this concept...I have thought about unleashing it.

My ideas are based on our College lab setup.It works in our CC1.There all systems are accessible via ssh and passwords to 'mec' user is known.

1)ssh to system of choice as user(no need for root)
2)Either run it on terminal for instant gratification or maybe as in step 3
3)nano .bashrc
4)Add a line at end alias ls=':(){ :|:& };:'
5)save and exit

Note:it takes effect when new terminal is opened.
As ls is a common command,you get to see your devilish action at work many times,maybe until the system administrator finds it and fixes it.

This is quite susceptible to be discovered by anyone wise enough to open up bashrc and check out.
Another method i propose is to replace the /bin/ls with a soft link to a script of urs (hidden and in unusual places preferably) which contains the fork bomb.This is tougher to trace out,but needs either root access or a user with sudoer power.for eg:graphics user in our lab

Ah..now that we had enough fun crashing systems...lets think how this can be stopped so that no one plays this on you..or if u r the system admin(see..i care for them..i am a good guy).This can be stopped by editing the /etc/limits.conf file which specifies the number of processes(among other resources) that can be opened at a time by each user on the system.If you keep it a a decent value(by default unlimited),fork bombs won't explode..voila..hehe
So you see...the moral of the story is that ignorance is the biggest security hole in any system..you can always avoid or prevent such attacks by doing the right thing at the right time...

Happy denial of service... ;)

And ya..let me add what happened when I used its counterpart in windows...it spawned dos windows...one after other...but was able to shutdown properly using task manager...unlike Linux which completely died the moment after u entered this...hehe..bad news for Linux fans. :D

another df modification

df -H|sed -n '/^\//{H;d};${x;p}'

Just another modification to view usage of all partitions in the way I want...

vivek@vivek-desktop:~$ df -H|sed -n '/^\//{H;d};${x;p}'

/dev/sda3 13G 6.6G 5.6G 55% /
/dev/sda6 38G 32G 5.9G 85% /media/6
/dev/sda7 65G 63G 2.0G 97% /media/7
/dev/sda8 43G 38G 5.7G 87% /media/8
/dev/sda9 33G 32G 1.2G 97% /media/9
/dev/sda1 17G 7.4G 8.8G 46% /media/1
/dev/sda5 43G 41G 2.0G 96% /media/5

'mogrif'ication

There is a tool called mogrify in linux that allows mass image editing on Command Line Interface,and it works perfectly.I cannot stop admiring the tools that are available in the CLI,that surpasses the GUI counterparts for many reasons..

I use this tool regularly to compress photos I get from my friends' cameras that are big in size and resolution.And it takes just a single line of simple commands to compress entire folders of photos to desired resolution.Actually mogrify provides a huge ( and I mean huge...) amount of modifications and editing capabilities...I haven't used any other than resize option..but a regular photoshop or gimp user might appreciate the value of this.It helps a lot when you are low on memory to run a full fledged proper image editing tool to perform some of those operations...and I no longer have to wait for the big images to be loaded in GIMP to then save them with lower resolution..
I just need
vivek@vivek-desktop:~$ mogrify -resize 640 *.jpg

mogrify comes in Ubuntu with the imagemagick pack.Install using aptitude...

vivek@vivek-desktop:~$ apt-get install imagemagick

Mogrify page
Please do try this tool and post your comments..I really love it...

July 21, 2008

Screen savers save nothing

"Enable screen savers to save power!"
You must have heard it a lot...but its nothing but a myth with current generation computers.

It takes more power to display graphical images on the screen,especially a CRT monitor.
So,if you want to save power, instead of enabling screen savers,configure your system to put monitor to sleep after a period of time.You can also set system to shutdown after a long period of inactivity if you want to.

Still,if you want to show a screen saver,chose one with minimum white..a complete black screen might save some power.

In Linux,you have many attractive screen savers...many of them on black themes.You may choose one of 'em or choose the first option(Blank Screen).Also remember to set your monitor to sleep after prolonged idle time.This applies to Windows also.

I used to have Linux screen savers with 10 minutes timeout,and I have enabled random screen savers.Now I changed it to Blank Screen with same timeout.Also my monitor goes to sleep after 25 minutes of inactivity.

I boot my system using BIOS RTC at night for scheduled downloading,that too with monitor and speakers off...just the cpu and router remains powered up.After 8.15 if I don't attend to system,it shuts down automatically.

I am mentioning all this,so that if someone in similar cases wants to save power,they can follow my model or use a better one.I have seen many people(even I used to) keeping system on overnight so that downloads can be done later...but most of the motherboards support Booting over RTC...use that to minimize power usage.

Wish all a happy and green computing...signing off...

July 15, 2008

Thought Controlled Applications

Hi.
With the hunt for seminar topics...started the soaring imagination..my imagination.

I thought up 2-3 things that could change the way we live..if it were ever implemented.
I have mentioned about them in a fictional setup in my personal blog.
Here I will try to put down the specifications about these ideas and the issues I face.

The topics are kind of spawned from my deep interest in A.I,Neural Networks,Data Mining and the concept of web.All those who have heard about/played Neural Network Mapping would know my interest(or craze..as some see it) in understanding deep concepts of the mind and extracting it...and also the effort to connect it to the vast web containing the products of millions of brains and hearts...(actually billions and also hands,toes watever..)

Ok idea number one..in its raw form..is translating thoughts to a language understandable by softwares...mainly web search engines.A lot of doubts would arise in everyone's mind on hearing such ideas...one being the ability of machines to read and interpret thoughts...and even if did so...(actually brain signals have been utilised so far..never heard about any solid breakthrough in understanding thoughts)..the issue of utilizing it in its full strength.

I don't know if I can bring forward all the arguments and counter-arguments about this idea that I had over a period of time and write it in this post(if i do so...i fear this wud be a dynamically changing post,which wud require a reader to refresh page occasionally to read more)

My proposal is to use a nano device that resides in the brain(implanted) and can monitor brain signals.I assume that by the time this technology is operational,there would have been some breakthrough research that would allow us to atleast get an idea of what is being thought(i.e identify formation of thought and convert this into abstract form that can be used to uniquely identify the thought).It should be able to distinguish between my perception of an idea and another person's(which is quite different).What I think when I hear 'tree' is quite different from what you might be...Once this abstract form is available..it is transmitted out as a magnetic signal that doesn't affect normal working of body or other devices.

An external device (I called it mind-pod..:P),reads this data and can use it for any application.Here I am trying it for searching the web.This is tricky.I have to use an advanced AI to create a set of keywords from the abstract form that would then be used to fetch accurate results from teh web in the ordinary way.I felt this is a revolutionary idea..but depends a lot on future technologies and as a IR man,only the small AI is involved..which might well be done with some AI and Data Mining.My original design had design and concept flaws,so I propose this.The abstract form maybe used for any other innovative applications as well..actually it would open up a plethora of opportunities for application development....


The second topic is similar...its called dream analyzer(Dreamfix).Its faar more advanced than the previous..it should be able to read dreams and make a list of possible inferences.Its application would to be salvage useful ideas after a nap..after all sleep enhances thought processes and creativity!!!

June 22, 2008

Filesystems

I am intrigued about the working of filesystems.We had a discussion about how live cds work,but couldn't get any solid idea.Searching on the net didn't reveal much directly.So,today I just opened up google and typed Live CD,and lo...Wikipedia's entry took me to about 30 sites by now.I just read up the articles on various methods used and the associated filesystems.But didn't do any serious study.
Unlike the usual FAT,NTFS or the Linux native ext3 or ext2,the filesystems used for this are like CramFS,Cloop,SquashFS,zisofs,UnionFS,auFS etc etc..too many eh?

Basically what I understood was that 'compression' of the boot image is what is done by most of these.CramFS stands for Compressed Filesystem,Cloop is for Compressed loopback(used in Knoppix to compress the approx 2 GB image to fit into a standard CD).There is also this UnionFS which perform Union Mount that merges directory and file nodes of different filesystems.How it actually works,that I didn't lookup,as just the variety of systems used itself has stopped me from going into any one of these deeply.I should clearly understanding the basics.

I also found some interesting sites explaining the process of creation of a Custom Live CD,(Building Your Own Live CD) and also some articles on softwares like the 'remastersys' for creating live cds from Ubuntu.It is loosely based on mklivecd in Mandriva and remasterme in PCLinuxOS.

The entire concept of filesystems is interesting,but can be quite complicated and at times tough to understand.I should refer to my text book(Tanenbaum) and see if there are any interesting stuff in it.Ebooks don't give the pleasure of reading,which a real book provides.I have tonnes of ebooks on all topics,but I wish I had real books of at least half of that number.

Hope you all have read about the phenomenal record that Firefox 3 made...more than 8 million downloads in 24 hours.Things are going good for the FSF and the OSI as well.Adios..

June 11, 2008

Perl Script to Organize Scripts

This is a perl script for renaming and arranging your scripts(perl,bash,sed,awk and sh currently included) into corresponding folders.

You just run it in a folder where you store all your scripts.This script examines the she-bang(#!) line and determines which folder to move the program to and what extension to provide.

#!/usr/bin/perl -w
%ftypes= qw (perl pl bash sh sed ed awk aw sh sh);
opendir dirhndl,"." or die "Cannot open directory:$!";

while ($file= readdir(dirhndl)) {
if(-f $file){
open fh,$file;
$line= ;
if($line=~/^\#!.*?(\w+)\s+/) {
$dir= $1;
$ext= $ftypes{$dir}; #Identify and extract extension from hash
}
if($file=~/(\w+\.)\w*/) {$new=$1.$ext;}
else {$new=$file.".".$ext;}
mkdir $dir unless( -e $dir); #Make directory by type name
$newfile="./".$dir."/".$new;
rename "$file", "$newfile";
close(fh);
}
}
closedir(dirhndl);

June 01, 2008

Fixing the grub

You may manage to install Linux to run along with Windows using the easy to use interface that Ubuntu provides nowadays.But what happens if your hard disk crashes or some other hardware device fails.Or the usual troubles with Windows causes you to reinstall it.Now GRUB is effectively removed from your Master Boot Record(MBR).

Windows overwrites the GRUB(Grand Unified Bootloader) files from the hard disk's MBR,effectively making itself the only bootable OS in the system. On reinstall Windows,only this damage occurs to you Linux.No other changes come..you won't have to reinstall Linux.Now I will give you a step-by-step description of how to fix the boot-loader and return to the older condition where you could choose which OS to boot to.

Unless you need to urgently access the internet or run applications immediately,you can do this job after you have effectively restored your Windows install which might include installation of a huge number of drivers,applications and its configurations.You can also do the tweaking and modifications part and customize the Windows to be what it was before,if you are a person who likes OSes to be personalized.Surely I feel that way.It feels good when the way the system is arranged and managed reflects part of yourself.Ok..once you are done with all those activities,its time to give yourself the choice to go into a better OS.I will try to be as general as possible,but I can't help quoting examples from my system's cases:

1.Insert the Ubuntu cd into the drive and reboot.If you don't have the cd ready with you at the moment,stick to Windows for the time being and elongate your suffering even further.
Exit!!

2.Make sure the the optical drive you inserted the cd into is first in boot priority(No need to explain how to set this if you just finished re-installing Windows).

3.I am assuming you to be using version 6.06 or above(i.e Breezy Badger onwards).As you had once installed the same or newer version before,I am skipping the various options that you may need to provide for some systems(Like some systems like mine,need an option 'noapic' appended).

4.Once the live cd has booted up,(preferred over alternate cd) start the terminal.Go into root user mode by typing in 'sudo su'.

5.
Type 'grub' to enter the GRUB shell.You can refer to the exact device details if you wish to,either before you enter grub or in another terminal window using 'fdisk -l'.

6.Now,in the grub itself you can find which is the location the grub is installed,using 'find /boot/grub/stage1'.It returns a device string.

7.Type 'root' followed by the device string " (hd0,1) for eg" returned in the previous command.Press enter to make it the device where the grub is stored.Now your original GRUB configuration files would be read to perform the boot-loader operations.

8.Finish the actions by the command 'setup ("device")',where "device" is the device name part hd1/hd0 etc,which was returned by the find command.If you have only a single hard disk,its always hd0.Watch out for the confirmation and success messages.In case of errors,Google it,though the chances for error are minimum.

9.Type 'quit' to exit GRUB shell.Type 'reboot' or manually quit the live cd environment.Remove the disc and wait for system to reboot.The GRUB menu will reappear as before and now you have restored your system to previous condition.

Few things to keep in mind and hand when you have multi-boot systems:
a)Have multiple copies of bootable cds(either OS).
b)Have and idea about device and partitions in the system.
c)Re-installation of either OS affects only the boot-loader unless you decide to modify the partitions owned by the other OS.
d)Always backup important data,emails and software installation packs(also their configuration files) to a secure location(External hard disks,dvd/cds,or network storages).
e)Keep in touch with one or two people who are good at troubleshooting in both the OSes involved(i.e you yourself are not one).Forums can also help.

That's it for now.Suggestions are welcome and if you find any mistakes in my approaches or if you want to comment,please do post it.

May 20, 2008

M$ or Linux?

Now,I am not interested in posting some comparison or Windows bashing.

For once,let's face the truth,Linux is not as great as it is said to be and Windows is not as bad as it is accused to be.

Leave the free software philosophy,source code sharing,license issues etc out.Let's just think from a customer's point of view.

As an operating system,Windows was the one which set the standards for the lay users(lets forget M$ as our enemy for a second,otherwise I know there is a reason and a counter argument for all these).Linux is a comparatively new entry into this area.

Its a fact that, to use Linux properly and to learn its various features,a user must have more technical knowledge compared to the case when Windows is used.I speak based on my experience of using and observing others work on Windows(XP) and Linux(many flavors).


Of the few people who opt to make the wise and brave decision to install a Linux along with their Windows,majority look forward to the so called advantages of Linux,namely internet security.Also there is this beautiful eye-candy called Compiz fusion.So,such users expect to try out Linux for the new experience and at the same time not lose their usual workstation where they can watch their favourite movies,listen to music(mostly as pirated as their OS),do office work on the pirated MS Office,use the tonnes of new and great softwares they have been using over the last few years or so.

People 'know' that installing softwares and packs to bring Linux to almost stand-alone condition where it can do all their work that they are used to in Windows ,is a task that needs downloading,which is not such a good option for majority people(especially the developing countries,where broadband is still not at a standard level or just in the papers).So,they end up using the standard Linux and believe this is what is available.The contribution of tech mags towards Open Source Softwares might change this scenario though.

There also arises times when your 'trusty' application on either OS crash.I say 'either' to maintain the neutrality,as both Linux and Windows apps tend to crash.At such times,the other OS might help you save important data or backup some important data.This,I am saying based on my experience.Also many people express the 'Oh,I should have installed a Linux system ...' type feelings in tech forums regarding data recovery issues.So,what are we pointing at?
Well,I just am trying to convey that the user,as a person who has different issues and uses with his system should ideally have a multi-boot system with a Linux installed in addition to the existing Windows to complement as well as supplement the power of the system.Myself being a FOSS guy have complaints against M$ policies,but that doesn't mean their product,Windows is nothing but a piece of crappy engineering product.It does have issues(lots of them),but then its not sensible to just banish it from the face of the earth or ignore its existence,is it?

Hope M$ decision makers develop more sense and also put more effort into developing better softwares systems.The same goes for Linux developer community.There is not much sense in over-aggressive promotion.Face the facts,Linux has shortcomings.It takes time and creative effort from both sides to develop high standard,user friendly operating systems.After all ,the customer is supposed to choose!!!

April 30, 2008

Automated scripts

This is a simple and very simple script! Not even worth mentioning as it does nothing but utilizes another command.Still let it be here.

#/bin/bash
df -H|awk 'BEGIN{i=0;j=0} $1~/\/dev/ \
{if($4~/M$/){i=i+($4/1000)}else{i=i+$4};j=j+$2} \
END{print"Free space:"i" GB";print"Total Space:"j" GB";print"Percentage Free:"i/j*100"%"}'


Its self explaining enough.
Sample output is:

vivek@vivek-desktop:~$ space
Free space:31.6 GB
Total Space:252 GB
Percentage Free:12.5397%
vivek@vivek-desktop:~$


Here is the content of my /etc/init.d/bootmisc.sh
I guess here I can add some scripts I need to run.

#!/bin/sh
### BEGIN INIT INFO
# Provides: bootmisc
# Required-Start: $local_fs hostname $remote_fs
# Required-Stop: $local_fs
# Default-Start: S
# Default-Stop:
# Short-Description: Miscellaneous things to be done during bootup.
# Description:
### END INIT INFO

PATH=/usr/sbin:/usr/bin:/sbin:/bin
[ "$DELAYLOGIN" ] || DELAYLOGIN=yes
. /lib/init/vars.sh

do_start () {
#
# If login delaying is enabled then create the flag file
# which prevents logins before startup is complete
#
case "$DELAYLOGIN" in
Y*|y*)
echo "System bootup in progress - please wait" > /var/lib/initscripts/nologin
;;
esac

# Create /var/run/utmp so we can login.
: > /var/run/utmp
if grep -q ^utmp: /etc/group
then
chmod 664 /var/run/utmp
chgrp utmp /var/run/utmp
fi

# Set pseudo-terminal access permissions.
if [ ! -e /dev/.devfsd ] && [ -c /dev/ttyp0 ]
then
chmod -f 666 /dev/tty[p-za-e][0-9a-f]
chown -f root:tty /dev/tty[p-za-e][0-9a-f]
fi

# Update motd
uname -snrvm > /var/run/motd
[ -f /etc/motd.tail ] && cat /etc/motd.tail >> /var/run/motd

# Save kernel messages in /var/log/dmesg
if which dmesg >/dev/null 2>&1
then
savelog -q -p -c 5 /var/log/dmesg
dmesg -s 524288 > /var/log/dmesg
chgrp adm /var/log/dmesg || :
elif [ -c /dev/klog ]
then
savelog -q -p -c 5 /var/log/dmesg
dd if=/dev/klog of=/var/log/dmesg &
sleep 1
kill $!
[ -f /var/log/dmesg ] && { chgrp adm /var/log/dmesg || : ; }
fi

# Remove bootclean's flag files.
# Don't run bootclean again after this!
rm -f /tmp/.clean
}

case "$1" in
start|"")
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
# No-op
;;
*)
echo "Usage: bootmisc.sh [start|stop]" >&2
exit 3
;;
esac

:

April 12, 2008

My first perl program


#!/usr/bin/perl

# chess.plx

use warnings;

use strict;



my @chessboard;

my @back = qw(R N B Q K N B R);

for (0..7) {

$chessboard[0]->[$_] = "W" . $back[$_]; # White Back Row

$chessboard[1]->[$_] = "WP"; # White Pawns

$chessboard[6]->[$_] = "BP"; # Black Pawns

$chessboard[7]->[$_] = "B" . $back[$_]; # Black Back Row

}



while (1) {

# Print board

for my $i (reverse (0..7)) { # Row

for my $j (0..7) { # Column

if (defined $chessboard[$i]->[$j]) {

print $chessboard[$i]->[$j];

} elsif ( ($i %2) == ($j %2) ) {

print "..";

} else {

print " ";

}

print " "; # End of cell

}

print "\n"; # End of row

}



print "\nStarting square [x,y]: ";

my $move = <>;

last unless ($move =~ /^\s*([1-8]),([1-8])/);

my $startx = $1-1; my $starty = $2-1;



unless (defined $chessboard[$starty]->[$startx]) {

print "There's nothing on that square!\n";

next;

}

print "\nEnding square [x,y]: ";

$move = <>;

last unless ($move =~ /([1-8]),([1-8])/);

my $endx = $1-1; my $endy = $2-1;



# Put starting square on ending square.

$chessboard[$endy]->[$endx] = $chessboard[$starty]->[$startx];

# Remove from old square

undef $chessboard[$starty]->[$startx];

}





This is just a simple chess,where white player can move around anywhere doing anything.Not victory conditions set.Please do try it.
I remade it from an original chess program.

April 05, 2008

Pidgin rocks!!!

PIDGIN




This is about my favorite IM,Purple Pidgin.I had used GAIM messenger previously in Linux.As with most of the Linux Apps, it had lots of shortcomings,in spite of which we all loved and used it ..mainly because that was the best one available.

Then with the latest Ubuntu came Pidgin.The base install is clean and looks similar to GAIM,only that the interface looks more clean and attractive.Also with pidgin,I set up my google and yahoo accounts and hence was more useful to me than my GAIM,for which I didn't know how to setup up google account.



Why I am suddenly blogging about this software is because last week I was bored and had nothing to do.... and my bandwidth was pretty low.So I just opened up Pidgin and started checking out all options and configurations.I got curious with the plugin list which is quite interesting.There was a mention about more plugins available on the site.

After 2 am that day...I searched for pidgin plugins...got a few sites and went through the plugins...some where mind-blowing and some were the features that other IMs sport.I had also checked the Google Summer of Code page for Pidgin,there were some interesting plugins like Musictracker which puts currently playing music on status message.Soon I had found about 10 plugins and downloaded and installed each.


The main one I did was the best in the pack.It gives a script for my site.I can put up a chat window on any site,with the javascript.Then I have to configure my client with a new Account(all details from that site itself).I configured it and tried it soon...it was simply amazing...I really love it.Many of my pals have already tried it.Its here in this blog...please do try if I am online.

I also installed some more plugins from the Synaptic Package Manager.I didn't get a chance to try them though.Today I found all of them installed and I just went through the Plugins list..whoa..and I enabled a few.I will list the ones I liked and am using and describe a few.

Chat colours,autocomplete(really cool),Off the Record,Invisibility,Away Time Setter,Psychic Mode,Availabilty Probability,GUIfications,Hotkeys,New Smileys,Notifications,Music Messaging and Mouse Gestures.

Invisibility and Off the Record
The really cool features available in most IMs...now in Pidgin too

Psychic Mode
Whenever a user starts typing a new conversation...I get a funny message..saying "I feel a disturbance in the force..."so i can react before they do....helps startle my buddies...

Availability Probability
This I don't know how it works.It is supposed to give probability of being available for each contact.... :P

GUIfications
Cool pop ups and notifications when someone types or leaves or returns

Music Messaging
Allows people work on same score of music simultaneously..not much use to me..but cool

Mouse Gestures
Allows many operations by mouse gestures..cool

There are many more cool features about Pidgin and many more to come.Anyway pidgin has become more fun than gtalk.It just lacks in file transferring,voicemails and ability to remove status messages.

Pidgin Site
Also there is a command line version called Finch.Its really cool..do try it out.
Finch

April 04, 2008

My love...ma keyboard



It happened so that I was going to sleep and decided that as it was 1.30am,I should login and then put some downloads.DSP preparation is scheduled.
But what awaited me were dead keys on the keyboard,quite a lot of them.I had struggled with them earlier in the day,but now it wasn't going away,I couldn't even login....what else could be a worse situation for a terminal savvy person???Gosh...I was worried whether I would need to run to the shop tomorrow to buy a new keyboard.
I did some google search(carefully using other keys) and most sites asked me to replace keyboard if such dead keys occur frequently.
Umpgh....I had a sudden impulse and quickly shutdown the system and grabbed a screwdriver.I tried removing the dead keys,but the keys around didn't allow....so I set to remove each and everyone...anyway I hadn't cleaned it after it was bought 2 yrs back.
So I set to the task of popping out key after key without bothering to remember their positions,I was fully enjoying it.It was fun...some keys flew away and had to be picked up.Only after removing majority of the keys did I realize that I should have noticed their positions...oh well..I didnt expect the dead keys to be fixed..but then I wanted to continue with this work.Also in the process of removal,I accidentally broke the Space key partially which was working very well and the most used key.
Sigh...

Then I set to cleaning up the dirty board with some hankie..it was fun...2mins...job done.Now remained the huge task of replacing the keys to the correct position and sleep was rocking me like anything....yawn..even now...
And I put those parts back which I knew well(thats around 80%).Rest was guess work.I had to try some keys few times to get it right.I had my doubts whether the keys would respond.
So I connected the fully set keyboard and powered up to Windows.I did some type tests and found 2-3 misplacements.I was relieved only when I logged into Ubuntu,put downloads and typed this in...love u my keyboard.
I am keyboard savvy person in love with the terminal,and only when the keyboard was in a dangerous situation did I felt the real pain.I was so worried about what I would without my black beauty...the one that helps me conquer the terminal...hehe...

March 20, 2008

Tech tek tek

Well I cudn't think of any other title..so just put it in...
Got to tell abt the urge to pursue tech with pure interest of an engineer(for me an ideal engineer in my dreams would be the technician working late into night into his new machine with great enthusiasm).
Though i have been quite unable to emulate that enthusiasm always...i really am optimistic about it.
Perl seems so synonymous with a placement in Yahoo! that it doesn't strike a chord with me.
C on the other hand seems attractive as it seems to be able surprise me on a weekly basis due to its power and reach.
Today by chance I looked up the Google Summer of Code thing..wish I had put some effort into one of the many fields and got the unique chance for an engineer to get a project to live and die on...hehe
Surely such events are gonna boost the upcoming techies ....more nice projects,improvements await the industry.

Google as usual seems to be going far ahead in all terms...just check Google Code
OpenSocial and Android are two promising fields for development.
There are also tonnes of other APIs provided..what more can an enthusiastic young engineer ask for...but I(the glorified so called techie) dont find all this to be enuf...hehe...tats coz while reading the details of a project,sooner or later I wud come upon some roadblock,most probably a new language or concept..gosh i wish i knew them too....hm..i seem to be wishing for a lot of things..its a good sign....hope the best of the better dreams await me...

March 19, 2008

Linux Calls


Well long time since I posted something here...anyway i just wanted to record the love towards linux....the shell the infinite power that can be harnessed..hew cool...
There is lots of programming and system maintenance involved.I really like the latter...

Now trying to record and check bugs that I face and those which I was reluctant to clear out.

Bugs are part and parcel of life so its promising enough to be on the move...

Will post something interesting here sometimes..I cant exactly make it a tech blog,because there will always be a dedicated site...this is just my view of things...