Thursday, February 19, 2009

Further X-periments on Qemu

After installing Qemu and ghci, I needed to run "gobby" to access some mutually edited files. But that needed X. So I could not avoid X altogether. Here is what I did to install X.

First start up Qemu using

$ qemu debinst.qcow

where debinst.qcow is the qemu hard disk which we installed in the previous blog. Log in as root. Now we are ready to do the actual installation.

Do the customary

# apt-get update
# apt-get upgrade

as root. Though it is not strictly necessary as the following will upgrade whatever it needs automatically.

Now we start the main installation. First we need X.

# apt-get install xorg

This will take some time as it will retrieve something around 40MB of data and then install it. Next one needs a window manager to use the X. I wanted something light and hence went for xfce. I might have used fvwm or something like that. But I used fvwm and blackbox and icewm for quite sometime and wanted to try something new. So I did

# apt-get install xfce4

This will download around 25 MB of data. The installing of fonts might take some time. Now after it is done, comes the scary part of testing it. So keep your fingers crossed and switch over to the full-screen mode by

pressing Ctrl-Alt-f

while the qemu window is in focus. This will grab the whole screen for qemu. Now run

# startxfce4

That should start xfce. I had done a few more installations. I needed the X for gobby. So I had installed gobby. I needed a web browser. w3m was already installed, but I wanted something more graphical. I tried links2. That seems to be reasonable. It can at least handle gmail and the webmail of my institute.

Friday, January 23, 2009

Some experiments with Qemu

For the last two days I have been playing around with Qemu a bit. The system administrator had installed qemu in my office desktop. As an experiment I tried to install a minimal debian system on it. I downloaded the debian net-installation CD image just because it was the smallest and good for experimenting. With qemu installed and with the iso image of the CD on the hard disk I started the installation step by step.

First the virtual computer should have some virtual hard disk space. Qemu provides a tool to do that. I used the command

$ qemu-img create -f qcow debinst.qcow 5000000

Yes the "create" command creates the hard disk. The switch "-f" specifies the format. I used the native qcow format for the disk as I read that it is the best and it takes less amount of space on your "actual harddisk". So a 5GB virtual harddisk after installating debian took a little less than 1GB of actual harddisk space.

Note I saved my cdrom image (debian.iso) one level below the directory where I am presently in. So for the installation I ran the command

$ qemu -hda debinst.qcow -cdrom ../debian.iso -boot d

So it says qemu to take debinst.qcow as the harddisk for the virtual computer and ../debian.iso as the content of the CD in the cdrom drive. -boot d tells it to boot from the cdrom.

The debian installer kicked in and the installation was smooth. For my experiment I used the guided partitioning with just two partitions; one for the root and one for home. I did not install any extra packages other than the standard ones initially. I actually don't need a graphical interface, so I did not bother to install any desktop environment either. My installation only has the console interface and I am happy with it.

Later on I had installed build-essential just for my programming interests.

Then I wanted to use this installation from my slow dial-up connection from home. (You must be wondering why... Well I don't know... My answer would be just for fun!!!) The problem was it was too slow to forward X over ssh and use qemu. Specially since I am only using the console it does not make sense to forward X, I found out that qemu has the -nographic option. But somehow it was doing nothing if I tried to run

$ qemu -nographic debinst.qcow

Later on I found that

$ qemu -nographic -curses debinst.qcow

did exactly what I wanted. Now I can run qemu from the linux console without having to use X at all.

Tuesday, September 30, 2008

Linux and Alcohol

It was a surprise to me to find so many linux commands having names of alcoholic drinks. I list the three I discovered. Let me know if there is something else!
  • Wine : This is actually a well known application used to run windows applications in Linux.
  • Brandy : This turns out to be a basic interpreter.
  • Beer: This is a security package as far as I understood. Well beer and security??!!!
I have a feeling that the list is incomplete, but I could not find any other either.

Sunday, February 11, 2007

Update on my previous blog on Orbitz

I had posted about Orbitz charging extra for tickets in one of my previous blogs. My wife had written a strong letter to Orbitz the day I published the blog. Well she got back her money the next day. But she got an email from Orbitz saying that

"If your reservation has not gone through and yet your credit card has been charged, then it could be a soft charge.

A soft charge is a temporary authorization that will automatically drop off your account within seven days, if not sooner. A soft charge is when Orbitz ask for funds from a credit card / debit card company but does not actually charge the card. By doing this the funds are taken out of the available credit on the card but not included in the balance that you need to pay to your credit card / debit card company."

Okay! But then that does not explain why they should charge twice for the same ticket. And then they write

"We value you as a customer and look forward to serving you again in the future."

Yeah right! Now that you know she has enough money to buy another ticket, she is of course a valuable customer! :).

I hope this thing stops in the future.

Wednesday, February 07, 2007

Does Orbitz misuse Credit Card information?

This is a non academic blog entry. But this is a serious issue, as it concerns all of us who use plastic money to buy things over the net. My wife's latest experience in this matter has been very bitter.

She was buying a ticket to come to India. She was looking at various travel agents from whom you can buy a ticket online. So she checked Orbitz too. It was quoting quite reasonable and cheap fares. We decided to go for it. So she paid online using her Debit card as a Credit card. All was fine till then. She promptly got an email notification about her itinerary. The shock came when she checked the bank account. She had been charged twice for the same ticket. Now a round trip ticket to India is not something cheap. And paying it twice is a financial shock. She called up Orbitz. They said that they don't know of the transaction and that she must contact the bank. When she called up the bank, they said that the transaction is not recorded yet and she has to wait till it does. Now it is two days and she hasn't got even a little bit of cooperation - neither from her bank nor Orbitz.


This brings me to the question, who is responsible for this? Is Orbitz safe? A google search gives an idea it is. A closer search reveals the following site http://www.ripoffreport.com/reports/ripoff170312.htm . Now, these people also had negative experiences. Well is it Orbitz or is it that the whole process of Credit card transaction is flawed?

Friday, December 01, 2006

Open Day 2006

The Open Day is an annual event in which some selected school students from some selected schools come to visit TIFR for a day. They are taken around laboratories and are given an exposure on how science is done.

We also had put up a Mathematics laboratory (whatever that means). It was more of a puzzles and games laboratory, where the puzzles and games were based on mathematical facts. For example, Shameek did experiments with geometry by introducing the school students to the Möbius band. Arati explained to them the mathematics behind the shape of the bubbles. They learnt about the types of tilings from Anupam. Sagar introduced them to Sperner's lemma. They realized that their hobbies can also have deeper meanings, when Mimansa told them about the mathematical aspect of Origami. Somnath showed them how to use mathematics to solve the problem popularly known as Towers of Hanoi. Four color theorem was done by Shane.

I decided to do something related to probability. I did Buffon's needle problem. I had wrote a flash program to simulate the experiment and used a laptop to demonstrate how one can estimate π by throwing needles on the floor. Those who want to know more about Buffon's needle problem, can visit my short write up here.

I have made a web-page on the small application I had written. You can find it here. You need Flash Player 8 or above to view it properly.

Thursday, November 30, 2006

Funny incidents while teaching maths!

I heard some jokes on teaching mathematics. They may be funny but the sad part is that they are not completely away from reality. It is actually quite a sad situation!

Well here are the stories!

Division of numbers and division of money

Some experts wanted to assess the quality of mathematics teaching in remote villages. They went to one such village, and asked the ninth standard students there to divide 1224 by 6. Most of them answered 24. Yeah! That's right, the students answered 24. The people were shocked. After a whole day of discussions, one of the experts thought of testing their knowledge by asking the following question:
Suppose you have got Rs. 1224 and you have to divide it equally among six people. How much would each person get?
This time the students argued,
The total amount of money is more than 1200. So each person will get at least 200. And the extra is 24 which when divided by six is 4. So each person will get Rs 204!
Laws of cancellation

Sandeep (fictional name) teaches pre-calculus in a class. In one of the assignments he asks the following question:The student answered 1. And gave the following explanation:
You cancel off 'x'. So you only have 'sin' left. Now you can take any value of sin. In particular, sin 90 = 1.
Sandeep of course did not give any points for that problem. The student came to ask why he has deducted marks when the answer is correct. And the student got a calculus book to show that the answer is correct. Then Sandeep tried to explain that the proof the student gave was not logical. The student asked,
Why does everything have to be logical?

Cube roots, Square roots and hands
One student went to his TA saying that she cannot solve "3√x = 2". The TA started to explain.

TA : You are given cube root of x is 2. You have to remove the cube root sign on the left. What would you do?
Student: I'll take cube roots on both the side.
TA: But you already have a cube root.
Student: I do not understand. Still I can take cube roots.
TA:(flabbergasted) Okay, let us first solve an easier problem: How would you solve, "√x = 2"?
Student: I'll take square root on both sides.
TA: But you already have square root on the left.
Student: Oh now I understand. I'll take cube root on both sides.
TA:(almost throwing in the towel) I think you are not getting the point. Let me take up a real life situation. Suppose you are wearing gloves and I want to see your nails, what would you do? Would you wear another pair of gloves?
Student: HOW DARE YOU WANT TO SEE MY NAILS! WHY SHOULD I SHOW MY NAILS TO YOU? (Gets angry and leaves the office)