Solving the problem of missing Windows 7 entry in grub2 on Fedora 18

I installed Fedora 18 on laptop a couple of weeks back. I basically set up a dual boot system alongside with Windows 7 as I sometimes need Windows to play games and stuff. Despite the installer being pretty convoluted, I managed to install Fedora 18 successfully. After installation though I didn’t find any entry for Windows 7. My first reaction was that I might have corrupted the windows partition, but I checked and it was not the case. After searching for some time, I came across a pretty straightforward solution to this, which is as follows:

1. First we have check for the partition where our windows is installed. For that we need to fire up the terminal and use the following command:

sudo fdisk -l

There should be an output like this :

Disk /dev/sda: 320.1 GB, 320072933376 bytes, 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe3d12c7c

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 357074943 178536448 7 HPFS/NTFS/exFAT
/dev/sda2 357074944 519493904 81209480+ 7 HPFS/NTFS/exFAT
/dev/sda3 519495680 520536063 520192 83 Linux
/dev/sda4 520536064 625142447 52303192 5 Extended
/dev/sda5 520538112 625141759 52301824 8e Linux LVM

Disk /dev/mapper/fedora-root: 12.6 GB, 12582912000 bytes, 24576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes …..

In my case I have my Windows 7 installed in /dev/sda1 partition, which might be different for other people so it’s better to check.

2. Now we need to create a custom grub script to add the Windows entry in the Grub menu. Create a file 15_Windows in the /etc/grub.d  folder and add the following lines to it.

 #! /bin/sh -e
echo "Adding Windows" >&2
cat << EOF
menuentry "Windows" {
set root=(hd0,1)
chainloader +1

Note that we would need root permissions to create this file. Also on the line

“set root=(hd0,1)” , it depends on the partition where we have installed our windows on. My Windows was on my first hard disk ( the only one for that matter) and the first partition, hence hd0,1. hd0 refers to the first hard disk and 1 refers to the first partition. Edit this line to point it to the appropriate Windows partition.

3. Now we make this script executable by all users using the command:

chmod +x /etc/grub.d/15_Windows

4. After this we need to update the grub2 configuration file so that the script we created is always loaded at boot time. The following command accomplishes that

grub2-mkconfig -o /boot/grub2/grub2.cfg

And there all done. The next time you boot your computer, you should see the Windows option in the grub2 menu.

I found the guide originally here.


A must read for nexus 7 owners who want to get plasma active on their device


We are very happy to announce the first testing release of Plasma Active for Nexus 7. Plasma Active, in a nutshell, is a Linux distribution (based on Mer as a core) that is specifically optimized for tablet computers.

Tuomas Kulve and me had been working on the Mer “hardware-adaptation” for Nexus 7 that enables to run Mer-based distributions like Plasma Active on the Nexus 7. Based on this hardware-adaptation and the work from Plasma Active we created an installable “image” that can be used to “flash” the current Plasma Active 3 on the Nexus 7.

Event though very much already works reasonably well, there are still some glitches. So, please don’t expect a 100% working system. We released this as testing version in order to get more feedback and with the hope that others may also contribute to the Mer Nexus 7 hardware-adaptation as well.

Here are two photos of…

View original post 678 more words

The Nexus 7: My views

Before I start , I must make it clear that it is not an in depth review of Nexus 7, you would find a lot of those on the internet. I am just narrating my own experience from an Indian’s point of view , which a lot of people should find useful.

First of all, I am a final year undergraduate and was thinking of buying a tablet for the last 6-8 months or so. Earlier I wanted to buy the Micromax Funbook but then I thought that if I am buying a tablet, I should go for a good one, at least a decent one. I am not saying that the Micromax Funbook series is bad, they offer a great value for money but unless you are in dire need of a tablet and have a 7-8 K budget limit, I wouldn’t advise you to buy it.

I started checking out the Nexus 7 reviews and found them pretty great. Sure it had some cons, but all of those were fine with me. It didn’t have a back camera , no expandable memory slot and no sim slot ( Now , a 3G version of Nexus 7 is available though, it wasn’t then). I didn’t want a back camera, in my opinion it looks pretty stupid trying to take a snap with a 7″ tablet. I found the on board 16 GB memory pretty decent ( You can always buy a microUSB OTG, connect pen drives or card readers to it if you need). And I primarily wanted to use it indoors, where wifi was almost always available so no issue there too.

It wasn’t available in India officially then , but I found some sellers were offering imported versions on eBay, tradus and indiatimes shopping. I found it the cheapest on tradus, 16K for the 16GB model of nexus 7, so I bought it from tradus.

When I first held it in my hands, it felt pretty nice. The size and weight was perfect, the back had a dimpled plastic which gives it a good grip and you feel that its made to be held in your hands.

Then I switched it on and the whole Jellybean experience combined with a 1.3 GHz quad core Tegra 3 processor and 1 GB of ram blew my mind . I had heard that there were serious lagging problems in older Android tablets, but there were none on nexus 7. It felt smooth as butter thanks to the hardware and Google’s project butter on Jellybean. Its also worth to point out that it was the first and probably the only 7″ tablet to pack a quad core processor.

As of today , I have had the tablet for more than a month and I am still pretty happy with it. I used it to browse the web, play games, watch movies/ tv shows and read Books. It does all of that flawlessly. Watching movies and reading books is an absolute delight thanks to its form factor and its 1280×800 display. The 4000 mAH battery has enough power to get it through any task. I got 9+ hours of screen time while reading a novel and some light browsing with the wifi on. It still had 25% of battery left then.

Also worth mentioning is the stock android experience. Companies like Samsung , Sony, LG, HTC put their own customized UIs over the stock android which may be good in some ways but it puts a lot of bloatware on the phone. It also means that those devices receive updates much later after it has been released,but not the nexus line up. The stock android means that you get the core android OS without any customization which actually looks pretty cool. It is the first to receive any updates from Google , so if you like to stay on the bleeding edge of technology , it would suit you perfectly.

Its kind of like my constant companion now, it helps me to move out of my laptop for lighter tasks and I find that great. Its a good travelling partner too, I watched movies on a journey from my college to home of about 3 hours and it was a pretty good experience.

To conclude, I would strongly recommend Nexus 7 to anyone looking for a tablet with a 10K+ budget. For people who want everything in a 7″ tablet, they can go for the Samsung Galaxy Tab2. I haven’t used it so no idea how good it is but I found the reviews generally positive.

Some musings about the evolution of technology

I remember reading an article about wireless charging when I was in class 9 or so. It described how a professor from MIT ( most probably) got very frustrated when he had to get up in the middle of the night to set his phone down for charging. He came up with an idea of wireless charging with the help of Magnetic Resonance of some kind. It even said that they achieved positive laboratory results, though it was still very much in its infancy.
This article sparked my interest as a boy. I didn’t have a mobile phone of my own much less a laptop but somehow the concept seemed pretty nice to me.
Recently I read on the internet about some smartphones capable of charging from just kept on some charging pads. Its not strictly the thing I read about but its definitely close, there aren’t any wires at least. Some more advancements into this field were also suggested from two other related stories I came across. One was Intel developing wireless charging technologies in its Ultrabook series notebooks  which would enable them to charge phones by just placing them side by side. The other story was Apple applying for a patent similar to the technology the professor was trying to develop. A wireless charging solution which would charge all gadgets in a room wirelessly.  It came with a side note though, the magnetic resonance used to charge the devices could also wipe off data from our magnetic cards like Credit/Debit cards etc. Hopefully that will be resolved when it is actually implemented.
It made me realize that how fast technology is really evolving. I know its kind of rhetoric but seeing such an example  brings it into perspective.
I  being a bit of a geek myself  is always interested in stuff like this and people like me can understand my excitement. I am not in the future telling business but maybe after 3 years, 5 years or 10 years, wireless charging will be as commonplace as Wifi connectivity is in devices today (Phones, Laptops, Tablets).
Something worth waiting for I think, now that the world hasn’t ended .:)

PyQuery: The power of Jquery on Python

Today, I suddenly thought of an idea, to extract the performance of individual players from a scorecard displayed on a website. This was conceived as part of improving the cricket simulation web application I developed (‘Freepl’) but that”s on a different context

So I downloaded a scorecard from Cricinfo and started analyzing the page and it was pretty nicely structured with each data being stored in tags having proper CSS classes and ids.

e.g. the name of a batsman batting in the 1st innings could be found in this hierarchy: “#inningsBat1 .inningsRow .playerName” (for those who do not have much idea about CSS selectors, a ‘.’ represents a class and a ‘#’ represents an id These selectors are applied to different HTML tags for styling and javascript accessibility.) .

I first started testing out the patterns using jquery and it was really easy getting all the information I needed. But my objective was to do this in a back end technology which would also update databases on the go. For this I turned to django/python and while I was searching for a suitable HTML/XML parser I came across the HTMLparser module. It was good but didn’t offer the power of the jquery selectors. That’s when I came across Pyquery. Its a module which offers the functionality of jquery in python. Furthermore it was created with the same mindset as mine which is missing the power of Jquery on python.

It offers a similar kind of functions like jquery, not all of them yet, but a lot of them. The complete api reference is available here. e.g. the following python code would open the scorecard available here and extract the name and runs scored of the batsman batting at number 5 in the first innings .

from pyquery import PyQuery as pq

d = pq(url = ‘‘)

name = d(“#inningsBat1 .inningsRow”).eq(4).find(“.playerName”).find(“a”).html()

runs = d(“#inningsBat1 .inningsRow”).eq(4).find(“.battingRuns”).html()

print “Name: ” + name + “\nRuns Scored: “+runs

which would print

Name: S Badrinath
Runs Scored: 2

which is the case.

Now for a little explanation for the code:

d = pq(url = ‘….. line opens the url and defines a PyQuery type object d, in this case. Now once we have defined that , d can be used just as we use ‘$’ in jquery.

the name looks for the 5th entry(indexed from 0) found using the “#inningsBat1 .inningsRow” and finds the “playerName” class within it and gets the html content of the anchor(<a>) tag using the html() method.

Similarly for the runs scored.

This would greatly help in extracting data from sites later on and in many other tasks , as the best of both worlds have combined , the power of Jquery selectors within Django

Porting of KDE games from deprecated libraries

There has been a lot of discussion in the Kdegames mailing list regarding the porting of the games from deprecated libraries like KGameRenderer and KGameTheme to new rendering methods and Graphics stack. This is a very good opportunity for new contributors to start contributing to Kdegames. Although some of the ports might be a bit difficult but there are easy ones too once the code of a game specially the rendering portion of the code is understood. The port table is available here A basic understanding of Qt/C++ would be required, but the junior jobs should get one up to speed for tackling the ports.

For people who want to start contributing to Kdegames , it is advisable to go through the following steps in order

1. Subscribe to the Kde-games-devel mailing list ( . For those who do not know what it is, a mailing list is basically a kind of a forum where people post their queries or doubts or submit their patches. When they do that, all the people who are subscribed to this mailing list get notified by mail so that they can entertain their queries or the maintainers of the games can review the submitted patches.

2. Try to hang out in the official IRC channel (#kde-games on freenode) . You can have direct conversations with people from Kdegames here.

3. Post your willingness to contribute in the mailing list. It is more recommended than posting in the irc channel .One thing that has to be followed after posting in the mailing list is patience. People are busy and are from a lot of different time zones. They reply according to their convenience which has to be respected.

After following these steps , you should get a junior job which would surely help you get familiar with the source and in general to contribution if its your first time contributing.

Kdegames is a small group of developers and contributors and despite that they have done an awesome job. Although I haven’t been in Kdegames for very long but I really like this group and I would definitely want more people contributing to Kdegames which would help it become even better than it already is.

TicTacToe: A Qt quick approach to the classic game

Finally something interesting on (mostly) Boring Talk :P. In this blog post I am going to write about a new application that I developed. Its TicTacToe, the classic board game of Xs and Os , one that doesn’t involve a lot of strategy or time but is fun to play nonetheless. I developed it using Qt Quick which is basically QML integrated with Qt code.  The reason why I chose TicTacToe was simple. Although I know Qt Quick, I haven’t done any serious app development using it , so I was looking for something which would be simple to develop but would involve some complex interactions among the User Interface and the code

TicTacToe allows one to play TicTacToe with the computer where the decision of who moves first is made randomly. Its so because I feel like the player going first has a distinct advantage.. TicTacToe has an undo feature where the user can undo his/her last move and hence the corresponding CPU move is reverted as well. One thing I would admit is that it is a little difficult to beat the CPU at present 😉

Some screenshots of the game:

Default Game Canvas

CPU winning

Human Winning!

Help Image

If someone wants to check it out , its available at .

Now, I am moving on to how I developed TicTacToe and how it works , in brief (Non Geeks are forewarned)

As we all know designing UIs using QML is a piece of cake. Using QML fluid and intuitive UIs can be developed with very less effort. It didn’t take me long to design the basic interface of the game. But once it was done, I was faced with the task of writing the game logic i.e. how the game would react to the user interactions. I decided to write an AI class which would handle all the tasks of calculating which position to mark on the board. It models the board using a 3×3 matrix denoting vacant positions by -1, computer played positions by 0 and human played positions by 1. It has several methods at its disposal which helps it to calculate an optimum return move. Initially I thought of going through some generic algorithms for TicTacToe and implement them in my AI class methods but as it was only a 3×3 board , and as I was focusing on the human computer interactions, I decided to go with the brute force approach. The AI logic primarily goes through the following steps in order to calculate the optimum move.

1. It checks whether it can win in the current move.

2. If not , it checks whether the other player can win in his next move, if so it blocks the move

3. If none of the above are found then it checks whether the other player is trying to create a ‘fork’ i.e. whether the player is creating such a position on the board, where he can win by using two possible moves, thereby ensuring he will win the round.

4. If none of the above are true, the computer picks an empty place on the board and moves there.

The above conditions are checked using simple pattern matching between sets of three positions.

After writing the class, I tested it out by writing some sample code where I could test whether the AI logic is working using console input output.

When the class was finally ready , I set out to integrate the Qt code with QML (Qt Quick in essence). I integrated some JavaScript functions with the QML code to handle the various events that occurred on the canvas. There are events on setting  a particular position to X or O as per the play, code to decide when the board is full and hence the game is a draw, calling the AI class methods etc.  Integrating both the parts , finally TicTacToe was ready.

It took me aruond four days which included classes, interruptions from friends and delays due to the unstable internet connection at my hostel. Considering the above , I think, my first Qt Quick app got written in pretty good time :).

There are still some things missing in TicTacToe. The first and foremost thing is lack of proper documentation. I plan to add it very soon. I would also like to add a clock which would show how long the current round has been going on.

I have plans to add a LAN multiplayer feature too but thats for later on.

That’s all for today (rather tonight ) folks

Applying for GSoC, a tough road

This year I am going to apply for Google Summer of Code popularly known as GSoC. For those who do not know what it is, GSoC is an internship program from Google where Google pays you a hefty amount to hack FOSS softwares. Can’t get any better than this right ? But this program being so lucrative attracts a lot of competition and although there are a lot of organizations who are accepted for GSoC , the number of students is large too.

There are various stages of GSoC. First the organizations which want to participate in GSoC have to apply with their ideas. Google then publishes a list of accepted organizations and students can apply for GSoC for the accepted organizations only. After the GSoC student application period is over, all the mentors in a particular organization vote the proposals for their organization and send it to Google. On the basis of this vote Google selects the students who are going to be part of GSoC .

My interest in contribution has always been in KDE and I am applying for GSoC for a project idea in Kdegames. The idea is “Write a Kde game using QML/Qt Quick” . I am  basically going to port two existing games present in Kdegames. One is KPat, which is basically a Patience like game including a lot of variants and the other is Kigo, the Go game. These games currently use the QGraphicsView/ KGameRenderer to render their graphics and in my project I am going to design a QML based interface for both of these games and integrate the existing game play logic with these new interfaces. Using QML , the interface can be designed fluid and intuitive so that the game play experience of the user is taken to a whole new level altogether. On talking with some of the people in Kdegames like Stefan Majewsky, I came to know that there are plans of porting Kdegames to the tablet platform Plasma Active, and the interfaces designed in QML would also help when these games would be ported. Although the interface would have to be written from scratch but the design would be available without any major changes.

After the interface designing is over, I am also planning to write a multi player module for Kigo. Go is a very popular game in many parts of the world and the IGF (International Go Federation) has over 70 member countries. There are Internet Go Servers (IGS) where people can connect using their clients and play against other players. They also have the option of watching other games in real time. The multiplayer module would enable a player to connect to any go server using his/her credentials and play. There are some such clients available like Cgoban and Jago but they are primarily designed for Gnugo. But the good thing is there are some standardized protocols for Go like Go Text Protocol (GTP) and Go Modem Protocol (GMP). These protocols are meant to standardize the Go games so that it can be played from any system against any system without any problems of compatibility. Jago is an open sourced Go client written in Java and I am going to study its code for porting it to Qt/C++ in Kigo.

I have already submitted my proposal and it is available at . It would be viewable after the GSoC student application period is over i.e. fromApril 6th 2012.

Fingers crossed and waiting for the fateful day April 23rd.

My First Post

Today , I don’t know why I felt like I should have a blog where I can write about the interesting things I find or the things I do which might be of interest to other people.About the title of my blog, I am kind of tech savvy and a little geeky kind of guy, and hence what I talk about often tends to bore people who aren’t like that. Guys like me should find some of the things at least mildly interesting, which is good enough for me.

About me, I am Arjun Basu, pursuing ECE in NIT Durgapur with a keen interest in computers and computer related stuff (programming, hardware etc.) .One thing that I have to confess is that my knowledge in my field of study is poor to say the least, not because I don’t understand stuff, just that I am too uninterested to get a deeper understanding of those things.I rather study or know about stuff which I actually like and I am marginally good at like programming and related stuff. Everyone must be wondering why I am studying ECE instead of CSE , many of my friends have the same question too , and its a sad little tale meant for another time.

Anyways I think that’s enough for my first post. So , Goodnight All