Tuesday, January 3, 2012

Making a bootable pendrive of Windows 7 using Linux

Creating a bootable USB drive of Windows 7 (or even Vista or XP) in Linux the non-nerdy way. So this doesn't involve using the dd command anywhere.

The steps involved are :

  1. Get the required Windows OS iso image. I shall use the Windows 7 example.
  2. Format your USB drive to NTFS. Use Disk Utility in Ubuntu to do it or any other way you prefer.
  3. Mount the image, use the following set of commands to mount the iso image.

    Code:
    $ su -
    # mkdir -p /mnt/disk
    # mount -o loop disk1.iso /mnt/disk
    # cd /mnt/disk
    # ls -l
  4. Copy everything present in the /mnt/disk directory to your formatted USB drive.
  5. You now need to manually install the Windows MBR into your USB drive. To do this, install this very handy tool called ms-sys

    Install it :
    Code:
    tar xvf ms-sys-2.1.5.tar.gz
    cd ms-sys
    make
    make install #as root
    Write a Windows 7 MBR to your USB drive (as root)

    Use the "ms-sys -h" command for other the right option for other Windows Operating Systems
    Code:
    ms-sys -7 /dev/sdX
    Replace 'X' with your USB drive letter, its usally 'b' so its /dev/sdb.

    Once you are done, you have a Windows 7 Bootable USB drive.
If you are stuck anywhere, or encounter any problem please do ping us or leave a comment and we will get back to you as soon as possible.

Tuesday, December 20, 2011

Repontik

In the last project, there was a mention about what were going to do as our 7th semester project. Well, its almost the fag end of this semester and we have finally half way through what we started out to do. After a few weeks of nightouts on every alternate day, fueled by redbulls, tzingas and any other beverage that had alarming amounts of caffeine in them, we were racing against time to meet the deadline of our reviews and meetings with our guides, we finally converted caffeine into code.
So, the status finally stands " Code pushed, it works! and it kicks ass too! "

The ultimate aim of the project was to redefine how you interact with your computer. Voice being the primary medium of instructing your computer to carry out tasks. So, no more clicking on My Computer to reach your music, all you need is to 'tell' your computer to "play song kolaveri" and your computer fires up your music player and the song. And you can give fancier instructions like "play the song that I listened to last night" and it shows you the results. Sounds like 'siri' of the iphone 4S fame? Yes, its very similar to what siri does, but we had the same idea before the release of the 4S and the world got to know about siri.

So, we are midway through what we have set out to achieve. We have a working prototype 'Repontik' which seems similar to a normal file browser but does a *lot* more and developed a framework on top of Nepomuk,a KDE based Social semantic desktop,  which helps us achieve our version of siri for the desktop.

The capacity of our hard-disk drives has increased tremendously over the past decade, and so has the number of files we usually store on our computer. Using this space, it is quite common to have over 100,000 indexable items on the desktop. It is no wonder that sometimes we cannot find a document anymore, even when we know we saved it somewhere. Ironically, in some of these cases nowadays, the document we are looking for can be found faster on the World Wide Web than on our personal computer. And we have a solution to this problem - "Repontik"

Repontik is a browser to browse all your resources in your computer, and a resource can be either a file, music file, contact, bookmark etc. The word repontik is a amalgamation of the words 'Resource Nepomuk Semantic KDE'.




But the standout feature of the Repontik is that you no longer have to navigate to your desired file/resource by clicking on series of folders and navigate through 3 or 4 levels of folder hierarchy. All you need to do is to enter details about the resource you are looking for in the search box and you are given the resources which match the criteria. Details here can mean either the name of the file, any word in the content of the file or any other meta data related to the resource like the date of creation, last modified etc.

There are filters provided on the left hand side of the browser, which can be used to used to fine tune the search results. Eg, you could filter the results to show only audio files or videos, or filter them based on rating of the files. One of the most exciting feature is the filter the results based on the usage count, so now you can search for resources that you have never used/opened. So, searching for those movies that you have never watched from the bunch of movies that you have stored on your computer just became easier. Or to delete files that you never use to free up space on your computer.

Along with it, the user is provided with recommendations related to the resources. The recommendations are based on the content and linked resources to the selected resource. The user click tracking is done, so that the resource that is accessed the most pops out on top of the search results. This is much like how Google search results are displayed. So, basically we are bringing Google like search to the Desktop.

There a few extra features, one of which is where the user is provided with a GUI module to manually create a link between 2 resources. Linking 2 resources helps in easier searching and they pop up as part of the recommendation when one of the files is selected. Another interesting feature, which was suggested by our guide Dr. Kavi Mahesh was to search for duplicates in the system and delete them. This was done, and you can use it to remove all the duplicates present in the system and free up more space. Usage count of each resource is provided to help decide which resource to be deleted.

The aim of the of the Repontik is to cut down the navigation time of reaching to any resource, and provide a user experience similar to what a web search engine provides. That is, the user gets the resource he wants immediately, preferably at the top of the search results.

So, we now have the framework to build more semantic applications on top of this, and the desktop siri will be built using this. We plan to develop this as part of our next semester project. And there will  be a update on its progress very soon.

One last thing, the whole project is open source. The code can be found here
The Repontik is for the KDE platform, uses Nepomuk and runs on the Linux operating system. Please contact Phaneendra (phaneendra DOT hegde AT gmail DOT com) for further details on the implementation.

PS : Thanks to our own Phoenix (Vivek) for suggesting the name 'Repontik' for the resource browser. 
PPS : Thanks to Sebastian Trueg and all other KDE developers for the constant guidance throughout the development of this project. And we are indebted to Dr. Kavi Mahesh, our guide for this project for his support and encouragement and the final 'S' grade. ;)

Saturday, July 16, 2011

What are we upto

Well, this is not one of the technical posts. The 3 of us are in the middle of our summer break, and frankly I (Phalgun) am making the best use of it. The other 2(Nitheesh and Phaneendra) have been doing it since the first summer break. Yes, I'm a little slow in catching up with stuff  and I like to talk a lot about myself.

Its been a productive break for the 3 of us. Let me start off with the best news, Phaneendra got into Google Summer of Code 2011!! After many days of deliberation,whether we (I applied too!) would actually stand a chance, it was indeed a great thing.He is working on a project called 'Fancy Bookmarking', its one of KDE's projects. He has been blogging about it here. And he is making a butt load of money.(Don't yell 'treat treat' now)

Next up, Nitheesh got into Intel as an intern. He was handpicked by the hot shots of Intel when they came to our college.He always wanted to get into Intel and finally has.He is working on Android and other embedded systems ("That's pretty much what I can legally tell you" was what he said when I pressed for details) And yes, he is making a butt load of money too, and said he is only interested in treating people who are going to install awesome window manager on their comps.That's when I stopped pestering him for one.

About me (finally!), I got into a startup called MobStac as an intern and am working on some hardcore web development. MobStac is pretty chilled out, and has a great bunch of guys working there.

Now, after we are done with our summer breaks and internships, what next was one of the highly discussed topics in our recent meetings. And (drumroll)finally we decided what we wanted to do today! I'm not supposed to tell you what it is. "That's pretty much what I can legally tell you"


If you haven't noticed, all the 3 of us have been blogging privately. Somehow, this blog is back alive, and I hope to write some more in the coming days. Until then, we are busy with our new found work, ciao.

PS : Started to monetize the blog finally.Drumroll again.

Which Linux?

…being a linux user I’ve tried out various linux distros, trying to find the one that suits me the best.

Each of them are wonderful in their own way. Many of the distros are made for a specific set of users. Some aim at security, some at being small and off course some to replace windows :)

 But none of them seem to satisfy me. Some distros provide wonderful UI and customization but hog a lot of memory. Few of them are very fast and small but does not provide a good GUI. Most of the time, there are so many unwanted features that I hardly use.

So I decided that I’l build my own based on my requirements. In the beginning I thought of using ‘Arch’ as it comes with a plane and simple base system upon which I can add my required modules. Moreover since ‘Arch’ is based on rolling release, the fact I would not have to frequently upgrade to newer stable versions was comforting.

Then I came across this project call ‘linux from scratch’(LFS). I’m glad I found that project. LFS provides step-by-step instruction to build a custom linux from source code. I couldn’t ask for more. This is the next best thing to writing my own OS.

LFS lets me create a basic system. similarly there are other xLFS, that lets you to continue on the base system to create more advanced and customized systems .

So, if there are others out there who also want a customized linux, then  http://www.linuxfromscratch.org/ should be your first step.

saving grub from windows

lost your grub after installing windows? here is a simple way of getting it back.

[note: assuming windows being installed on top of ubuntu(using grub2) ]

1: boot from a live cd and open a terminal

2: sudo fdisk -l

this will show the partitioin table. Here is my partition table

Device Boot   Start         End              Blocks    Id  System

/dev/sda1                   63        771119      385528+   de  Dell Utility

/dev/sda2   *        772096   105629695    52428800   83  Linux

/dev/sda4       105631722   625141759   259755019    f   W95 Ext’d (LBA)

/dev/sda5       105631744   315355949   104862103    7  HPFS/NTFS

/dev/sda6       315356013   561134384   122889186    7  HPFS/NTFS

/dev/sda7       621142016   625141759      1999872   82   Linux swap / Solaris

/dev/sda8       561134448   621137159    30001356    83   Linux

3: mount the linux partition on which you want install the grub (sda8 in my case)

$sudo mount /dev/sda8 /mnt/

$sudo mount - -bind /dev /mnt/dev

$sudo mount - -bind /proc /mnt/proc

4: Now chroot into this environment

sudo chroot /mnt

[optional]if you want to change any default setting like timeout options… then look at /etc/default/grub

5: #grub-install /dev/sda

[ in case of error do #grub-install - -recheck /dev/sda ]

6: now unmount and reboot the system.

#exit

$sudo umount /mnt/dev

$sudo umount /mnt/proc

$sudo umount /mnt

$sudo reboot

simple cmd line power management.

I am a cmd line user, so i spend most of my time on the terminal and its really painful to use the gui for some of the common things. Power management is one such case.

Just to put the system to sleep i’ve to go to the menu and then select, suspend. Same for hibernate, or to put the battery to power save mode.

So here is the simple way to do the same tasks from the cmd line.

pm : power management. check out the man pages for its various options.

pm-suspend : suspend/sleep the system

pm-hibernate : hibernate the system

pm-powersave : set the battery to power save mode

using these commands are way more simpler than using the gui :) [provided you are cmdline user]

Restoring Grub entries…

If you’ve lost your grub entries after installing a new os, here’s a simple way of adding it back to your grub.Lets take the common situation where fedora has been installed along side ubuntu.In this case, the grub which you’l see is that of fedora, so you’l have to add the ubuntu entry into fedora’s grub.
first, boot into fedora and open the file ‘/boot/grub/menu.lst’.This is the file that has the entries which are visible when the grub is loaded.
Amongst other things, the file would have a few statements that would look like

####################################

title Fedora (2.6.35.12-90.fc14.i686.PAE)

      root (hd0, 1)

      kernel /boot/vmlinuz-2.6.35.12-90.fc14.i686.PAE ro root=UUID=912d5b84-5c9c-4NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb

        initrd /boot/initramfs-2.6.35.12-90.fc14.i686.PAE.img

###################################

these four lines are responsible for your grub to show the title ‘fedora…’ on the grub menu and boot it. To be short, the first line denotes the name to be displayed in the grub menu.The second line provides the hard disk and partiion (in which that particular os is existing) to be set as the root in the path. The third line is the full path to the kernel image of that os and the arguments that have to be passed for booting and the fourth line is the path to the initrd image


so if you want to add ubuntu(or any other) to the grub menu, all you have to do is to provide these parameters in the fedora’s menu.lst file.These parameters will already be present in ubuntu(or any other) grub file.

mount your ubuntu partition and open the grub menu file(/boot/grub/menu.lst or grub.cfg).If the other os uses grub2 then you’l have to use grub.cfg instead of menu.lst
Since ubuntu is now shipped with grub2, grub.cfg will have entries similar to

###################################

menuentry ‘Ubuntu,  with Linux 2.6.32-28-generic’ —class ubuntu —class gnu-linux —class gnu —class os{

          recordfail

          insmod ext2

          set root=’(hd0, 8)’

          search —no-floppy —fs-uuid —set f18af736-8d79-43e5-815e-0033f9c31ffe

          linux   /boot/vmlinuz-2.6.32-28-generic root=UUID=f18af736-8d79-43e5-815e-0033f9c31ffe ro   crashkernel=384M-2G:64M, 2G-:128M quiet splash

          initrd  /boot/initrd.img-2.6.32-28-generic

}

###################################

it has a differnt format, but contains the same information

1st line is the title

in the 4th line (hd0, 8) is the harddisk and the partition in that hard disk where the os is existing

6th line is the path to that os’s kernel and its boot options7th line is the path to the initrd image of that os

so all you’ve to do now is to add these entries into fedora’s menu.lst fileIn our case, the new entry in the menu.lst file would be

###################################

title ubuntu

      root (hd0, 7)

      kernel /boot/vmlinuz-2.6.32-28-generic root=UUID=f18af736-8d79-43e5-815e-0033f9c31ffe ro  crashkernel=384M-2G:64M, 2G-:128M quiet splash

      initrd  /boot/initrd.img-2.6.32-28-generic

###################################

Note: in grub.cfg the partition was 8, but we use 7 in menu.lst because for this version of grub the partition number starts from 0

Now save the file and reboot. You’l have this new option in the grub menu