Sunday, December 06, 2009

Some photos from FOSS.IN 2009 (more to come)

I've not yet had the time to sit down and write a report and my experience, but here are some photos


From James Morris at Flickr




From Kishore Bhargava at Flickr


The entire set that Kishore has can be accessed here

Thought for the day in Hindi

जो याद नहीं उसे भोल गए हम
जिसे भूल गए उसका नहीं गम!

Friday, November 27, 2009

Gops views on Mumbai 26/11

Well worth a read! We've had lot of heros, lets remember and pray for them, the victims and their families and that such things don't repeat themselves anywhere in the world.

Friday, November 20, 2009

Smooth upgrade to F12

My first post after the upgrade. The upgrade sailed through smoothly and I got back the packages I had to uninstall. The first issue I faced was the nomodeset issue. X would not recognize any resolution beyond "800x600", I had to pass nomodeset as kernel boot parameter to get my original resolution back.

I was also happy to see my back for resource counter scalability included in F12
(run rpm -q --changelog kernel | less)
* Mon Oct 12 2009 Kyle McMartin 2.6.31.4-75.rc2
- improve-resource-counter-scalability.patch: Fix scalability issues
on big machines, requested by prarit.

I am all set to sail, kudos to those who helped make Fedora and especially the upgrade path so smooth.

Wednesday, November 18, 2009

Upgrade Journey to Fedora 12

After reading the ever so useful YumUpgradeFaq, I've started upgrading my system from F11 to F12. I had some scarifies to make along the way, I had to remove about 100 of my favourite RPMS, so that the upgrade starts

yum finally told me...

Transaction Summary
=======================
Install 238 Package(s)
Upgrade 4512 Package(s)
Remove 4 Package(s)
Reinstall 0 Package(s)
Downgrade 0 Package(s)

Total download size: 5.0 G
Is this ok [y/N]:

Wish me luck!

Fedora 12 is out



I use Fedora on my desktop, now more than ever. I am currently well setup on Fedora 11, with 3D graphics (yeah, I can get Secondlife, google earth, etc to work with great speed) setup. Setting up 3D graphics was not easy (but that should be another blog entry. I also have my favourite sound system ALSA setup. I could never get used to Pulseaudio or get it to work the way I like. I am still trying to get webgl to work on my browser. The features in Fedora 12 are too tempting and of course I am already using some of the latest features via rawhide.

I guess its time to plunge into Fedora 12! Do take a look at the release tour of Fedora 12.

Tuesday, November 17, 2009

Thought for the day (Hindi)

मैं अकेला ही चला था जानिब-ऐ-मंजिल मगर, लोग साथ आते गए और कारवाँ बंता गया

मजरूह सुल्तानपुरी

Great Knock Dravid!


(From: cricket.yahoo.com)

Todays knock by Dravid's got to be the best I've remembered from anyone in a long long time. I've witnessed the record breaking knock with Laxman to help India win against Australia in India, the 200 odd to help India win against Australia in Australia.

I loved this one because of the determination and absolutely wonderful confident stroke play. This knock also got Dravid in the 11,000+ squad (only the 5th cricketer to have that honour). Bravo on the six, the quality of shots and the confidence. Keep the aggression coming Dravid! I love it!

Tuesday, November 10, 2009

Bangalore book fair 2009

The Bangalore Book Fair has started today at Palace grounds and I happened to visit today. With close to 330 stalls, I was awed by all the books and publications present. I had two clear priorities

  • Technical books
  • Childrens books

On the technical front, I purchased





It was really nice to see a good number of exciting books for children, I even managed to find some interesting gifts for children I know.

I'd highly recommend visiting the fair, the last day is November 15th

Sunday, November 08, 2009

Thought for the day

Happiness is when what we think, what we say and what we do are in complete harmony

Mahatma Gandhi

Arguing about OS'es

Gopal and I argued about Linux, Windows and browsing (nothing out of the ordinary though, we kill time in arguments and we've mastered that art). I thought I'd share what the stats look like for visitors on my blog. If you are worried about being profiled, don't worry, no personal information is stored by me! The data is from sitemeter and blogspot (If you are too concerned, you can start using the "Private browsing" or Incognito Windows)



Browser Share

Operating system share

FOSS.IN first shortlist

The shortlisted talks, workouts, project of the day, etc are announced. This year seems to be quite interesting with several kernel talks selected. I am looking forward to the Pulseaudio, security, S.M.A.R.T., kernel, gnome, GSM/Telecom, Haskell talks. I wish to attend them all assuming there will be no conflicts :) Link

Exponentiation

There are several well known exponentiation algorithms, but this one caught my eye, specifically due to its application in the Rabin-Miller primality test. Here is the math, the algorithm will follow later

Let the problem be rewritten as raise x to the power n. Let us convert n to binary


Where b0, b1, b2.. bk is the binary representation. Now lets rewrite x to the power n as

This in turn is equal to


The trick is to note that we need to compute even powers of x and determine b0, b1, .. bk. A simple trick is to, check if b0 is odd or even, if it is odd, multiply the current temporary value with x, if it is even, skip b0, but keep squaring the current exponent. Note we keep shifting n right, so that b1, b2,.. ,bk move to position b0 eventually.

Here is the algorithm from Sahni's textbook

def exponent(x, n):
m = n
expx = x
power = 1

while (m > 0):
while ((m % 2) == 0):
expx = expx * expx
m = m >> 1

m = m - 1
power = power * expx

return power

Monday, November 02, 2009

FOSS.IN posters are out

This is some of the best creative work I've seen (in terms of conference posters and getting the message out). All of this is released under CC. Excellent work guys! I am reproducing them below, the original post is at Posters! Posters! We need them, crave them








Friday, October 30, 2009

A consumer complains

I recently bought a new laptop and the display went bad in less than 15 days. I eventually got it back with the LCD replaced, but my experience at the customer service was horrible and I complained. Here is the letter I wrote, I am hoping that [company] will wake up and take notice. Customer service offered elsewhere (outside India) seems to be much more superior with value for customers.

My experience with [company] today was one of the worst I've had with any product support. I visited [service center] to repair my 15 day old laptop, the display had stopped working. I found that the front desk person opened my laptop without using any static protection mechanism, which I escalated all the way to [somename] (Customer Service Head). I asked for a letter of apology for not following prescribed procedure. [somename] told me it is a human error and I need to ignore it and stop interfering with how [company] service people work (I as a customer was going beyond my boundaries and interfering with their day to day work). After my complaint, the other people started doing the right thing, the local manager said that his employees were tired and just had lunch (hence the error). If [company] can void my warranty (even for opening my laptop, even though I did not (just hypothetically)), why is it OK for [company] service people to *NOT HANDLE* my laptop carefully.

Clearly I am very disappointed and want to see justice done in this matter. All I want so far is a letter of apology for not handling my product and a guarantee that their action has not damaged my laptop

Do you have any experiences to share? Consumer rights are taken for granted and I wish we could be more empowered to take stronger action.

Monday, October 26, 2009

FOSS.IN 2009 coming your way

I know this is last minute, but the CFP is due tomorrow (so please make full use of the last day to submit proposals). The event has unfortunately moved out of IISc (my favourite venue for the event and given the proximity to my house, my favourite visiting place as well). Nevertheless, the organizers are very helpful/cheerful people and I get to meet a lot of local FOSS people, apart from the regular visitors. Make sure you attend the event if you are in town or make plans to come down to attend it.





Friday, October 23, 2009

Finite Automate - solution part I

In my previous post "Finite Automata", I had posted two interesting exercises from well know texts. This post has their graphical solutions

Question 1 was

  • Given a binary stream, can we develop a finite automata to calculate the binary number modulo 5?
Here is the graphical solution of the problem, one can simulate an input stream of 0's and 1's and verify the correctness



The start state is represented using a triangle and the accept state is represented by double boundary node. In this case both the start and accept state is "1".

Question 2 was

  • Can we develop a finite automata that can validate the addition of two streams of binary numbers? Does such a finite automata exist?
There is one simplification we need to make to validate our results. For a given input of the form

0 1 1 <- Input1
0 0 1 <- Input2
1 0 0 <- Output

We need to present the string to the automata in the form [1 0 0][0 0 1][0 1 1]. We split the input and output into groups of threes, the last bit (MSB) represents the output. So for example, it says 1+1 is 0 and that is carried over and for the next input 1+0+ 1 (carry) is 0 and1 is carried over again. For the final input 0+0+1(carry) is 1. Hence this language is accepted by the finite automate.

Here is the graphical representation of the solution. In the next blog on FA, I'll discuss the techniques behind these solutions (which are probably very obvious to the reader of this blog anyway)


NOTE: states 7 and 8 are no good, but they are still shown here. Again, 3 is the start state and 3 and 4 are the accept states. The solution can be verified using two inputs and the output in the format specified above


Finite Automata (post one of many to come)

Oh! Gosh I can see it already, this is going to be a long post. Here is a brief background, I recently found my copy of Michael Sipser's Introduction to the Theory of Computation lying around. I found that is was rather nice to read (compared to some of the earlier texts I had been reading) and on finishing the first chapter stumbled upon some interesting problems posed in different forms in Sipser's, Ullman's and Papadimitriou's book.

I am going to cover some interesting aspects of Automata in this blog entry

  • The exercises in this blog entry to provoke some thought
  • Their solutions and representation in the next blog entry
  • A software to help solve/validate some of the solutions to the exercises

The exercises I am going to cover are

  1. Given a binary stream, can we develop a finite automata to calculate the binary number modulo 5?
  2. Can we develop a finite automata that can validate the addition of two streams of binary numbers? Does such a finite automata exist?
Now that you have some food for thought, come back here and check to see what I did with these problems/exercises at little later in the next blog post

Saturday, October 03, 2009

Thought for the day

I satisfy myself by saying, "My every attempt at failing to solve a problem and learning from it, is equivalent to Edison trying a new filament" :)
Balbir Singh

Friday, August 21, 2009

Thought for the day

Be willing to be questioned till the right thought emerges and be willing to question till the right answer emerges
Balbir Singh

Wednesday, August 19, 2009

Feeling insecure - thoughts on SELinux

I've decided to run Fedora on my main desktop and enable other distros via virtualization. Yes, too many good solutions to ignore and I paid for the hardware. Anyway, this is not an entry about virtualization, but on SELinux. Fedora enables SELinux by default and I was left to live with the consequences. To try and make sure I get the same five star security on my desktop that enterprise applications get, I decided not to add selinux=0 to the boot command prompt.

I thought I could learn it, wouldn't I be an inferior being if I could not? What does it say about my go-getter attitude? My first encounter with SELinux was when I tried to get ~user/public_html enabled via the Apache Web Server. After I had followed the documentation, I still could not get a seemingly easy feature to work. I dig the web and without knowing too much, I learn about a certain context httpd_user_context_t and use a certain tool and it worked!!!

I had a grin on my face for a few days, I was going to be able to work with SELinux. My next surprise came when I tried to install some software and setroubleshootd very gently pointed me to the cause of the security violation while installing the software and what I could do to fix it (gee, an automated tool, no more worries). My next encouter occurred when I tried to install mediawiki with math enabled (yeah.. I decided to save paper and take notes on the wiki with TeX enabled, but that is a different story). Again, no matter how well I followed the guidelines, I could not get texvc to work :(

Remember to look at /var/log/audit files as root and run audit2allow to get some useful hints with SELinux. SELinux comes with a set of rich GUI tools, be sure to use them as you walk through the seemingly friendly maze of SELinux
I found some help on the mediawiki site that gave me instructions on how to setup SELinux and mediawiki together. To my surprise, I found quite a few software vendors providing additional instructions for setup when SELinux is enabled.

The feeling of being miserable at SELinux set in, I had to now read up and understand the architecture or forgo my new found security infrastructure. Today, I came across a very interesting web page (the wikipedia entry for SELinux),

“...given the threat models and capabilities of the adversaries involved, that's probably appropriate... But that’s not necessarily appropriate for all users. SELINUX is so horrible to use, that after wasting a large amount of time enabling it and then watching all of my applications die a horrible death since they didn't have the appropriate hand-crafted security policy, caused me to swear off of it. For me, given my threat model and how much my time is worth, life is too short for SELinux.” — Theodore Ts’o
You can only imagine how relieved I was to see this quote
Life is too short for SELinux
I was not alone, others hated it and found it hard to use as well. How pathetic can such happiness be, but I was overjoyed, excited to say the least.

My path forward is to continue to use SELinux, but be less tolerant of its idiosyncrasies. I am working my way through the documentation, but very slowly. I've learnt that my new best friend is "Z". Add "Z" to existing commands in Fedora and magically it shows SELinux information that can be a life saviour at times.

Sunday, July 26, 2009

Search engine, BIOS updates and a waste of time

I am not quite sure how, but the default search engine on my Windows partition changed to "Ask". I was looking for BIOS updates as a possible workaround to some 3D graphic issues I was observing. The search showed a wrong version of the BIOS and board and I (being me) ran the .exe express update only to realize that I've managed to erase out my Intel Management Agent firmware. The BIOS worked, but I could no longer read the temperature and voltage from the motherboard sensors.

After this blunder, the regular express or ISO based mechanism of BIOS update refused to work. Thanks to the recovery BIOS mechanism on my Intel board, I removed the jumper pins (see manual for your BIOS), put in the CD with .bio file burnt on it.

NOTE:
  1. .bio is the recover BIOS. Burning
  2. .bio from Windows burner created a UDF filesystem on the CD, which the failed to work.

I had to force a iso9660 file format from my Linux partition and recover. After the recovery BIOS update, I put back the jumper pins and got back to normal work. My Intel 3D graphics problem on Linux is not yet completely gone, but I do hope to debug it more and not hear back (update BIOS) when I ask for help

In summary, stop believing your search results if you want to be productive :)

Monday, June 08, 2009

No.. I've not given up blogging

Just too busy collecting stuff to write about. Many interesting things, many learning's, mistakes and successes. Watch out, something might be coming soon.

I've got a twitter home as well, but twitter is like a light snack and blogging is like a full meal.

Ranking and Unranking permutations

I've been a big fan of Skiena's Algorithm Design Manual , I recently found my first edition of the book (although I own the third ed...