Wednesday, September 12, 2007

bourne ultimatum or what?

Amusing message ...

try pointing your browser to google.com/bourne .

surprise ...

Sorry, but
THE ULTIMATE SEARCH FOR BOURNE
cannot be undertaken in Linux.


:)

Friday, August 31, 2007

mrxvt is gooood

Thanks debian, for what?
For ubuntu and for awesome repository.

Fedora7 i am sorry, i ll have to format your owned root partition for my VMs for Xen and KVM. :-).

with aterm, mrxvt and xterm i have to say bye bye to bulky gnome-terminal.

BTW try this combo

aterm/xterm + scrollz + mutt + ssmtp + getmail + lynx :-)
Super cool.

later

Sunday, August 26, 2007

Mutt

heh... bloody mutt.
Its awesome :-).

And so is text mode.
Who needs Outlook crap ... ;)

Fetchmail + procmail + ssmtp + mutt + cron is cool :-).

later

Monday, July 9, 2007

Geek score

I can't help myself grinning on how i got a 100 score on that test :).
But test was loooong and gooood.

I thought i would fair poorely because as per the question i answered -
1. I did not ever program on Commodore.
2. I do not know how to program in BASIC.
3. I do not know how to program in PHP or JAVA.
4. I do not think Seymour Cray is someone i should bow before.
5. I sleep during my weekdays.
6. I played MMORG games rather than programming in my college days at 2 am any day irrespective of the day :).
7. i do not host my blog on my web server which sits in my apartment.
8. I do not think Bill Gates is evil.
9. I have dual boot machine for both WinXP and Linux on 2 of the machines our of 2 in my apartment.
10. duh...a lot more.

I guess i was over rated because i responded like a normal guy for most of the questions. Was that for good or bad i don't know.
But i have put up the trophy on my blog, you may want to have a look at it though.


But yay!!! that was fun and feels good to have a score of 100.
I wish i could do some justice to this score :-(

Later.

~psr

Saturday, June 16, 2007

fluxbox(ed)

One thing which i always strive to achieve is simplicity and power.
Fluxbox gave me all in one shot.

Took a little time tinkering with the fonts and config files as per my use, but it paid finally.

Tabbed windows ...just *awesome*. :-)

Hey but oowriter sucks :(, it looks bad very bad on fluxbox ... duh.

Later

UPDATE: fixed it finally. I hate this thing of mine, whenever i am stuck i 'll keep thinking how to solve that issue. And this eats up my time which should have been devoted to something else :-(

Saturday, June 9, 2007

Git it !!!

Banged my head a thousand times to figure out how Git actually works, last week.
For a developer coming from Subversion world that was not at all easy. Finally i must confess 90% of the people are unaware how actually git works.Why? Because they gave me all sorts of crazy ideas.
The very purpose of git is to be transparent and powerful. And i made full use of it. realised that there is no need to download 300MB of src from linus's repository to work on kernel src. And so i am happy now that i figured out a trivial but important cheat.

Cheat is you don't need to download the tag necessarily if you want to work on a local source tree and that includes any damn src in the world.
Just cd to the src tree and do following -

$ git add .
$ git commit
$ git tag -f v2.6.xyz-mine
$ git tag -l
$ git branch devel-branch v2.6.xyz-mine
$ git checkout devel-branch
$git branch
this shoule show a star in front of devel-branch.

Now modify the src, add files, remove some.
to commit
$ git diff
$ git add file_changed.c
$ git commit
or
$ git commit -a [to combine last two steps]

Hope this will help who want to migrate to git without downloading 300MBs of kernel src.

Godspeed.

--psr

Saturday, April 14, 2007

MS's insane logic ..wtf?

Have a look at this.
What the fsck ? From when did Microsoft started assuming crash is a feature and not a bug? ...lolz :D
Seriously now i am convinced MS have just a bunch of overpaid programmers who don't have any work to do.So they have started rolling out completely idiotic and out of the world statements, to save their crappy products which are incidentally great and flashy on the GUI front.But all that at the cost of efficiency and robustness.

Good going MS, keep it up.Suddenly BSODs will be centre of attraction.May be you can put advertisements there as you have lost doubleclick deal to Google. :)

~psr

Wednesday, April 11, 2007

OO concepts with C

As usual my example is more related to simple C and not Objective C.

Here, is the second tip.
How can i use function overloading in C?
Answer is ,you can provided you are absolutely sure what you are doing. This means you should be double sure of your parameters passed and avoiding any smart newbie stuff like passing an expression as and argument, which many people do to flaunt their horrible obscure C programming constructs.(No pun intended cuz i am also one of them :)).
You can impersonate function overloading using macros and inline functions in C(more specifically C99). Before you take this suggestion, remember Macros are a bad way of coding.They show how lazy you are. Thank C99 for inline functions.

Implementation :-
#define my_function(x) \
do { \
//do something sane \
// with x , with \
// one expression per line \
} while(0);

void my_function()
{
//kill'em all :)
}

#define my_function(y, x) \
do {
x = y+1;
my_function((x));
while }(0);


Weird it seems but effective.

Later

~psr

Sunday, April 8, 2007

OpenBSD Vs GPL

OpenBSD developers especially Theo seem to be apprehended by linux community.Whats wrong with GPL , you BSD dudes? I think BSD people are too paranoid.

He is not only difficult but keeps his personal ego above the benefit of the community.Which is suicidal for BSD community. Code doesnot work with human sentiments ...period.

Copyright act and permission rule the open source community, if he cannnot respect them... sorry you are in trouble. You ll be dragged to court.

Whatever the case may be, AFAIK lkml discussions have a common goal for linux kernel.No personal feuds. I remember Alan(Alan Cox) pissed with Dave(Dave miller) for a serial driver.He didnt fire his personal vendetta on the lkml. linus inervened and kicked dave to utter surprise for being fussy. To which dave gracefully accepted and asked suggestions to fix the flaw, which was finally fixed by Linus's suggestion.

I have pbserved this is a very common scene except in rare cases.Exception being when some nutty dumb wit tries to say like - "how about a poll for GPLv2 Vs GPLv3 for linux kernel".Obvious Linus's reply was -"How about this?Go write your own kernel and then poll whos is popular":). Linux kernel is his kernel, he decides it has to be GPLv2, thats it.Mostly all kernel developers are very professional and extremely dedicated. Warning, Linus is an exception.He is professional and doesnot care what you think when it comes to common kernel goals.you can be thrashed for poor code submission or idiotic logics or misinterpretations.

Anyway, i wish Theo de Raat was more acceptable of the FOSS community.Sadly this is not true.

Later

~psr

Thursday, April 5, 2007

switched to Gnome ... yet again!!!















Tried my hands with xfce4 for few days.xfce4 is indeed cool but somehow the shortcuts i am used to work only with __GNOME__. Too bad, i have to switch to heavy gnome.

The wallpaper is pretty cool.:)
Back to gnome and happy to have it back.
Thinking should switch to ever favourite, the fluxbox.
Will give it a shot and let you people know the results.

~psr

Wednesday, April 4, 2007

How to pull an overclock hack safely!!

I tried my hands at overclocking CPU at my home machine and not on my work system. I must say, i am in trouble.Will have to purchase a few hardware components :(.

Writing this so that somebody who want to do the same doesnot land into trouble like me.

The dangerous way of getting max out of your computer is changing the FSB frequency.FSB is the frontal side bus which connects CPU with the system memory.Changing FSB means you are changing not only the system memory access speed but also the processor clock, the PCI frequency and many other IO device's operating frequency including the chipset (your motherboard's heart,AGP etc) .

So you need to be extra careful.

If you want to :-

1. Read the motherboard manual to see if overclocking the FSB or for that matter even CPU overclocking is supported. Do not trust your BIOS like i did. Good BIOS vendors lock the FSB freq option to avoid any not so pleasant scenes. Unfortuantely Chinese manufacturers are either brain dead or don't know how a software should work, no matter how small it is.

2. Best to test is download software utilities which can check and tell you if you can do it ,and if you can what is the best range.

3. Sometimes overclocking comes with the price of over heating.Be prepared to face this.

4. Check if your perihperals can work with freq increased to orig freq + half the margin by which FSB freq is increased. Important ones are IDE HDDs, AGP cards and RAM modules.

5. Stick your both palms and pray.

6. If you are luck enough, welcome to the elite club.

7. If you are not welcome to the elitest club, because now you know what to do and what not to do , rather than just what to do. :)

Good luck

~psr

Monday, April 2, 2007

Google Gags

One thing about Google which amuses me is its innovative ways.

It may be work culture there, their web based dominance or April 1st announcements which turn out ot be gags at times. :)

Google Tisp as they call it is Toilet ISP. hahaha ... gag was good , but for a moment i was also surprised if they are kidding or serious. Anyway figured out when i clicked on advanced installation link on FAQs :).

haha... gotcha.

Anyway though it was a April fool prank, concept is very much possible and has been employed near 2002-2003 by a company(oops ..name i dont remember).

Whatever, people are getting free WiFI services from google without flushing even right now.Though the service is limited to a few priviliged cities in US sadly :(.

Anyway whatever, it was indeed a worth rolling on the floor after i figured out the prank ... :)

~psr



Sunday, April 1, 2007

Future calling...

Many of the computer engineers are perhaps unaware of the fact that Dell and HP are serious about adopting Linux as a Desktop Operating Systems for their customers.
This is a heartening news for me. May be this is just beginning of an era.An era of competition, quality and engineering.

At the same time i am disappointed to find most of the people as a mute spectator.Nobody is willing to hop in.Nobody is willing to engineer and take risk.

Linux has a huge potential in Gaming markets.Still unexplored and lackluster because of the kernel's GPL2 only policy to which big guns like Nvidia and ATI refuse to budge.

Only consolation which Linux community can get happy with is OpenGL, thanks to SGI for OpenGL.

Anyway whatever the case may be, Noveau project will bring some smiles on our graphics engine.
Frankly speaking i am more than skeptical about Noveau's success. Why?

Because Reverse Engineering is a science which is not only insanely difficult but also not even match for the purpose it is employed.
Isn't this much enough for Nvidia and ATI to think about it.

May be someone need to tell them "FREE SOFTWARE AND OPEN SOURCE SOFTWARE ARE TWO DIFFERENT TERMS".They form a closely knit but well defined union of two entirely different sets with a common intersection region. :)
Sorry, for a bit of set theory there. ;)

I am quite sure they know this, but problem is they are too paranoid about their patents and hardware designs.
My suggestion you are wrong, kernel developers are willing to sign a __NDA__ if you are willing to open source your driver.

Time has come for GPU giants to hop in and help the Linux Penguin. After all open standards in x86 architecture is what brought Intel to the top.

~psr

Thursday, March 29, 2007

To Fedora or not to Fedora

I must admit Fedora Core 6 is such a crappy distro, you 'll love to hate.

Being an ardent fan of Fedora's for nearly 3 years since its release, i am disappointed to see FC6 perform poorly.

First, if i select virtualization during installation, i expect atleast 2 kernels in my /boot .One being stock fedora kernel(which is often buggy) and a domU Xen kernel plus a xen hypervisor binary.

Surprisingly Fedora people think users are some lusers :(. They ll just wipe the stock kernel off the boot. nagging and frustrating it is.

Second can they please improve yum?Yum is beaten hands down by apt-get. Every damn time i want to install a package ,it will start downloading headers. Certainly apt-get install gcc32 is way cool :).

Third it was not able to detect the RealTek's 8169 SC gigabit ethernet NIC. Even a modprobe r8169 didn't help and neither did passing pci=noapic.

Thank god i switch to Ubuntu Edgy.

Edgy detects Rtl 8169 SC like a charm, GUI is way better.Synaptic is super smooth.Rest Development environment i have to set, which i am capable of doing even on a LFS box.

Moreover i am command line gureilla, not some GUI luser.(no pun intended)

But i must admit i still like Fedora as a development environment. :)

As they say it - "First love is first love, you will never forget it" ;) ... and neither did i.

Looking forward to Feisty Fawn.

Sunday, March 25, 2007

Indian IT industry and alternative thoughts

The computing industry has seen a manifold increase in last few decades. As an industry and as an engineering tool too. Not to mention, it affected Indian subcontinent and many over developing nations too.

The rat race has begun but is it effective enough for us to be called a quality service provider?Are we just a bunch people who are providing low cost services? May be yes and may be not? Even if we are not, we are perhaps disillusioned with this fact. We are best and hope fully will be best.

The problem as i personally see is - "When does the service starts acting like a commodity". The difference is visible and is inherently different for different sects of IT people. Maybe how we look at this is exactly how we shouldn't or may be we are right.

Whatever services are good and revenue spinning means for us, but point is services for which? Exactly for some product or some software from xyz inc in Europe or Northern America. This means we are heavily dependent on them. The lateral expansion of the software has certainly been the talk of the town but what about vertical expansion?

Are we ready to call our services commodities?Are we ready to give services which will mean a certain degree of domination in the Western market? Answer is yes and no both, which are self evident.

Initially we had to choose the path which we are traversing right now. Isn't it right time that we should spend some amount on vertical infrastructure?

How about building a competing product for which you can give exclusive services?how about recognizing the value of research and development?

Soon some other country will become cheaper than us in terms of services. Shouldn't we think about it?Definitely we should. But not in terms of cost only but also quality. Lets try to make ourselves a brand name in quality, in innovation, in development that we are known for our quality before cost effectiveness.

Let us innovate, have a bunch of talented engineers who can dedicatedly work on emerging technologies so that we can call ourselves pioneers.

Let us not waste the oppurtunity to make our mark at the right time. Lets have a fore vision. Let us work together for a brighter and talented India.

Are you there yet? :-)

Friday, March 23, 2007

Disappointment with kernel

Came across a livejournal entry comparing between FreeBSD 7 and Linux 2.6.18 kernel on Fedora Core 6. Surprisingly Linux performed poorly when it came to scalability issue with a MySQL server.

Here is my interpretation and inferences( can be wrong also :) ) -

-On a 'n' node system running a SMP kernel, the SQL server handles the load excellently till following condition is met -

num_of_sql_query_threads <= no_of_nodes_in_the_SMP_system

This means till threads(assuming each query launches a thread) are less in number as compared to the num of CPUs(cores if you consider Dual Core processors these days) the threading model performs great.
Every thread gets migrated to each of the ores and thus gives optimum CPU usage. The moment number of threads start increasing beyond the num of cores in the SMP system, it starts causing problems.
Possible reasons :-
* The userland is unable to keep up with the CPU execution speed and thus is not able to feed the right number of threads to the kernel. (Does it means user space threading model needs a look?)
* The kernel is not able to keep the CPUs busy when number of kernel threads increase beyond a limit. Well does this means kernel threading model is a little overlooked?

I think reason 1 is indeed true because replacing glibc's malloc with google's malloc improved performance considerably. But things did not improve that much. Something really bad is happening inside the kernel.

Linux uses a one to one threading model. This means for every thread requesting a priviliged operation, a corresponding kernel thread is spawned by the kernel on its behalf.This means some global/local spinlocks in SMP kernels is hindering effective migration of the kernel threads among runqueues(or waitqueues). Whatever this issue looks plainly separate from the scheduler.No blaming scheduling algo here:). Locking and synchronization primitives are indeed the culprits.

Important point to note here is in Kernel threading model in Linux is relatively new. It was included in the kernel with the 2.6.x kernel series only.

So there is a lot of scope for improvements in the kernel on threading front.
Any takers? :)

On last thoughts, why is malloc performing poorly? No idea.May be Ulrich Drepper is the best person to ask... so don't ask me. :)

Random thoughts : doesn't futexes have some added complexity? Somebody can explain me about futexes i hope ...

Later.

Object Orientism with C

C is a language to drive you insane - me :)

Well, C is indeed a wonderful programming language.
Success of C has been limited and overshadowed by the rise of Object Oriented era.
That is indeed disheartening to C fans like me. So i myself learnt C++ with no special goal in mind and found that indeed C++ is a wonderful application language. But C can still provide OO features in complex pieces of software.
A very good example is an Operating System kernel.

Some of the ways we can employ few of the OO feature in C IMO are :-

struct my_struct{
int a;
....
int (*my_function)(int);
...
};

The above structure is just a declaration and not a definition. Catch is kepping declaration and definition separate gives flexibility to a C programmer e.g

struct my_struct A;
A.a = 3;
A.my_function = some_random_function_i_defined;

And again in some other source file in the same namespace i do

struct my_struct _A;
_A.a = 345;
_A.my_function = another_random_function;

Above example shows, one declaration but different invocation of the methods. Indeed fantastic and divine :).

So, this means depending on the definition we can invoke the correct function using function pointer here :).
Indeed something modern *NIX kernels make good use of.

more on this later.

(mis)adventures with networking code

These days i dived into networking subsystem in the linux kernel and studied the networking subsystem.I must say it was one hell of a roller coaster ride :).

Code is elegant and a little on the higher side of intellect.

Some hacks have been wonderfully pulled especially by Alan Cox and Dave Miller :).
A very good example i found was skb_sh_info structure. Have a look at it.

Just for beginners
kernel networking subsystem code is located at
net/*
and network driver code can be found in
drivers/net/*
apart from this rest all headers can be found at standard place like inclue/linux/ and include/linux/net/ etc.

Still i am more than blank. Hoping to get some real insight into networing subsystem. But i must confess, this is fun :) and am loving each and every part of it.

Adios

emacs tryst


Recently installed Ubuntu Edgy 6.10 on my work machine.
Is great i must say. I felt deprived of my favourite editor for programming.

So here i went
apt-get update
apt-get install emacs emacs21 emacs-common

And i was working with the mighty emacs :).

Recently saw some posts on antialiasing support for xemacs fonts. Tried my hands on it and i must say now emacs looks pretty cool.

here is the link to install this cool but unstable emacs.

Please note, the software is still in Alpha stage. You have been warned.

Happy programming :)