Tuesday, August 24, 2010

Recovering GRUB after windows installation

I finally used my windows upgrade kit to upgrade my laptop from windows Vista to Windows 7. This has been too much delayed because I use ubuntu lucid mostly anyway :).

One of the side effects during the upgrade is to load the GRUB loader menu from which I select the OS to load. Windows overrides that upon installation so it is completely by passed.

Luckily, this is a well covered topic at ubuntu forums since it is a likely thing to occur

A nice guide on how to restore the grub menu can be found at https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD
This is useful if you are using GRUB2, ubuntu 9.10+

To summarize:
  • Use a live CD to boot ubuntu on you computer
  • mount the system partition (or the partition having the /boot directory) in the original installation of ubuntu that you have to a specific location (say /meda/ubuntu_sys)
  • use the grub-install command:
    sudo grub-install --root-directory=/media/ubuntu_sys /dev/sda
Reboot your system and , voila, You ubuntu installation is reachable again.

Thursday, August 19, 2010

Silence

It has been a long while since I updated my blog.. I guess tweeting became an quick way to express and share my thoughts.. although my tweets are mostly non technical :)

If interested, follow me at @modsaid

Monday, March 22, 2010

chrome/blogger incomptability ?!!


This issue has been buzzing me for a while now since I started using the Linux version Google Chrome. For some reason, when I try to publish a comment on a blog post on google's blogger.com, I get nothing, absolutely nothing, the page just refreshes when I click the publish button.
I have to move and open the page in Firefox in order to proceed posting my comment.
I hope whatever the conflict was, that chrome team fix it on this beta version.



Tuesday, February 16, 2010

Ruby script for downloading rails casts

Ryan Bates continuously provide useful Rails tips in this railscasts.com.

I had written a bash script for downloading the videos of the episodes in the past. I do not like streaming much and I'd rather keep the episodes for reference.

One downside of the script is that I had to check the rss feed or the website for new episodes, and run the script manually passing the correct paramters (start and end of episode ids to be downloaded)

Now I decided to get rid of the silly step. so I ported my script to ruby, and it runs down to download whatever episodes are missing using the rss feed and checking what is already present.

The script uses simple-rss gem, so you'll have to get that installed. It also uses wget for downloading. I didn't bother using net/http of ruby, wget is fine for me as a linux user.

The script flow is simple:
  1. Check the current files in the download directory (collecting information)
  2. Grab the rss of railscasts.com
  3. Iterate over rss items and download the ones that are not already present in the download directory
The original script can be found and downloaded from https://gist.github.com/modsaid/5330545.


Windows users will have to override the wget part for downloading. perhaps using net/http or mechanize and making the script more portable,  I'll work on a new version built over mechanize. any contributions are welcomed too :)


Thanks to Hossam Hammady, an updated platform independent version that utilizes Mechnize (Instead of relying on system call to wget)  can be found at https://gist.github.com/hammady/5330925

You can also you pro feed if you have a pro subscription to get all episodes.

One advantage of having it as a script is that now it can be added as a cron job that runs periodically keeping our downloads directory updated.



Friday, February 05, 2010

Gmail search and labels.. a wished feature

Gmail has been my main email engine for years now. I'm totally comfortable with it. The ability to process, distribute and keep up with the flood of emails i get everyday from different resources, and the ability to search and find emails (even the very old ones) easily are the keys behind my loyalty to gmail.

Gmail supports some nice techniques that can be used while searching emails. Besides what you can use in the advanced search form. the command line approach (direct control from the simple search box) proves to be even more powerful.
Anything that can be controlled in the advanced search form, can also be done from the simple one provided that you know the right parameters.

You can specify: to, from, subject, a label, ...
What's more exciting is that you can specify several labels to search in, and several labels to be excluded from search. By default you have "read", and "unread" labels.
A frequent search query of mine is "l:inbox l:unread". this simple search query brings me only the new email that i want to see. removing the noise of message that has already been read.

There is one more thing to wish for though. I wish gmail team can add the simple feature of "saving a search". to be like a view... I do use my search queries repeatedly and frequently.. and got a bit tired of having to write them every single time i check my email... why cannot we have "saved searches" right above the labels or something.

I hope one of Google brilliant team of Gmail finds this suggestion. I do want to tell them: I do admire your product. Nice work guys, keep it up... together we can do even better.