Monday, June 23, 2008

Windows 2.03 on a Virtual Machine

Virtual Machines can be proven very useful tools. I have been using QEmu for some time now but I recently switched to VirtualBox (commercial, but free of charge, edition) because I desperately needed the USB support. Here is a screenshot showing my four desktops while in one of them is a virtual machine running XP in fullscreen mode:


Apart from running a "useful" OS on the virtual machine (it's useful because I needed to use a 3G GPRS USB modem which doesn't work on Linux) you can also run old or rare OSes. I tried Warp but I couldn't install it just like Windows 1.0. So I tried Windows 2.03 which did install and run properly. I also made a video with a quite lengthy tour showing most of their programs. (it's five minutes long!)

Here it is:

Saturday, June 14, 2008

Hanoi Towers Solver

I just made a small program that solves, step by step, the Hanoi Towers puzzle for any number of disks. I though it's worth uploading it, so here it is. As always, it's a console application with nice (for my taste) ASCII graphics. It runs on both Linux and Windows as it is written in Lua. I included two Lua interpreters (for both OSes). To run it just drag and drop the .lua file on the interpreter. (after unzipping everything, of course). Here is screenshot: (When giving the number of disks remember that the total moves for the solution are 2^(number of disks)-1. And you will have to press as many Enters as the moves.)

Thursday, June 5, 2008

Ubuntu Hardy Heron on a Sony Vaio VGN-FZ31E

This article probably also applies to: VGN-FZ38M


Yeap I bought it. I though that since it had an NVidia card and it was Centrino based etc it wouldn't have any incompatibilities with Linux. (aaaargh if I only knew...) Anyway.

The laptop came with Vista. I was going to keep them for a week or so just to make sure I don't miss any of the Sony specific programs that was preinstalled. Well I couldn't bare them for more than 24 hours. I made some factory restore CDs and repartitioned the whole drive which now only has Ubuntu installed in it.

What worked out of the box:

The SD/MS reader (104c:803b). It works out of the box with SD cards but the MS PRO slot doesn't work for me and I have found no way to make it work.

Graphics Card (10de:0426): The NVidia GeForce 8400 GT worked perfectly with the closed source drivers that Ubuntu installed. The temperature sensor works OK too.
Nevertheless I recreated the xorg.conf (for no specific reason). Here is the new one.

DVD-Drive (PIONEER DVD-RW DVRKD08): It works OK. I recorded a data DVD with Brasero (for some reason it couldn't verify the burned disk afterwards but it worked perfectly). I also installed Diablo 2 through Wine. The CD protection of Diablo 2 works OK and recognizes the original CD.

CPU (Intel(R) Core(TM)2 Duo CPU T5450 @ 1.66GHz): Both cores are recognized and the temperature sensors work OK. The same goes for frequency scaling.

Wireless and LAN (8086:4229 and 11ab:4351): They both work perfectly right out of the box.

What didn't work out of the box but works with some tricks. Before trying the tricks enable the extra repositories (universe, multiverse etc) from System->Administration->Software sources).

Camera (05ca:183b): HAL loads a wrong module for the camera that in addition to not working, makes the laptop crash when you try to suspend it. So you must remove the misbehaving module from the kernel and prohibit reloading it.

  1. Type the following in a console (you can find the console in Applications->Accessories->Terminal):

    sudo gedit /etc/pm/config.d/unload_modules

    Give your password and then copy and paste the following line at the end of the file:

    SUSPEND_MODULES=uvcvideo


    Save the file and close the text editor.

  2. To download the r5u870 drive you will need svn, so in a console type:

    sudo apt-get install subversion

    (answer yes to any questions you may encounter)

  3. To download the source of the driver, type in the console:

    svn co http://svn.mediati.org/svn/r5u870/trunk r5u870

  4. Now that all files are downloaded go into their directory by typing:

    cd r5u870

  5. Install the build-essential package before trying to compile the drivers by typing:

    sudo apt-get install build-essential

  6. Compile the driver by typing:

    make

  7. and then install the driver by typing:

    sudo make install

  8. Now instead of restarting you may just load the module into the kernel by typing:

    sudo modprobe r5u870

    When you reach this point the camera will only work with some applications like Skype.


    If you open Cheese (a very nice application for capturing video and still pictures from your camera, install it by typing sudo apt-get install cheese) you will notice that it doesn't recognize your camera. That's because the system doesn't recognize it as a Video4Linux camera.

  9. To fix this you will have to download this file and copy it to /usr/share/hal/fdi/information/20thirdparty . If you don't know how to do this just type the following two lines in the console:

    cd /usr/share/hal/fdi/information/20thirdparty
    sudo wget https://bittit.info/publicDro/10-r5u870-webcam.fdi

  10. Now either restart you computer or execute this in the console:
    sudo /etc/init.d/hal restart

    Now you should have a perfectly working camera! Oh, you may now delete the sources by typing:

    sudo rm -r ~/r5u870


Sleep and Hibernate
: They don't work initially. The computers go to sleep but when awaken it stays in a black screen. Fixing the camera will fix this problem too. :-)

Sound Card (8086:284b)
: Well, playback worked out of the box but when opening the sound options there were no recording controls and the sound was coming out only through the builtin speakers, plugging in headphones changed nothing. To fix all these problems follow these simple steps:

  1. Optional step. I suggest that you don't use Pulseaudio because I found it a bit buggy. To switch back to ALSA go to System->Preferences->Sound and change everything to ALSA.

  2. Type the following in a console:

    echo "options snd-hda-intel model=vaio" sudo tee -a /etc/modprobe.d/snd-hda-intel

  3. Restart you computer.

  4. Open the sound controls by clicking the sound icon next to the clock.

  5. Select File->Change Device->HDA Intel (Alsa mixer)

  6. Then goto Edit->Preferences and select everything.


  7. Play around with the controls. Don't forget to look at all three tabs (in the third tab you will find the record selection switches: Internal Mic, PCM, Mic Jack)

Bluetooth (044e:3010): It is properly recognized by the system but it will not work. Here is a way to fix it:

  1. In a console type:

    sudo gedit /etc/rc.local

  2. Now append the following line before the exit command (if there is one) near the end of the file:

    hciconfig hci0 reset

  3. Now save the file and close gedit.

This way the bluetooth will work correctly but if you switch it off and again on (using the hardware switch in the front side of the laptop) it will stop working so you also have to do the following:


  1. Right click on an empty space on your panel and select "Add to panel..."

  2. Then create a new custom launcher and in the command textfield copy and paste this:

    gksudo hciconfig hci0 reset
This way when your bluetooth stops working, just click on the new launcher that you made and it will ask for your password and then reset the bluetooth device so that it will start working again


VGA-out:

Open a console and type:

cp /etc/X11/xorg.conf ~/xorg.conf.back

This will back up your xorg.conf file just in case you mess it up.
Now you will have to install the NVIDIA settings manager. To do this just type:

sudo apt-get install nvidia-settings

And then run it by typing:

sudo nvidia-settings

The NVIDIA settings manager will open. (you might need to resize this window because for some strange reason it initializes too small)


Now select X Server Display Configuration and then click on Detect Displays to detect the connected display. Now you will be able to configure the two screens using the options in the Display and the X Screen tabs.

From ere you may also set the resolution to for your laptop's monitor to the correct one (1280x800). If you select a resolution from the Resolution drop-down-list (it's visible in the above picture) the drop-down-list on its right will be enabled and you can then select the desired refresh rate.

Afterwords don't forget to click on Save to X Configuration File.

If you mess up then type this in a console to restore your backup:

sudo cp ~/xorg.conf.back /etc/X11/xorg.conf

To delete your backup type:

rm ~/xorg.conf.back

Tip: To get rid of the annoying NVIDIA splash screen type this a a terminal:

sudo gedit /etc/X11/xorg.conf

Then find all the Device sections and add this line inside them:

Option "NoLogo" "True"


Then save and exit.


What doesn't work and still I have found no solution:

The Fn buttons don't work. In fact the sound controls work, the next track, previous track, play, stop buttons work too. The S1 (customizable button), the AV MODE and the brightness control buttons doesn't work. I am still looking for a solution. The MS PRO slot doesn't work and I still haven't found any solution.

What I haven't fully tried yet:

S-Video out, HDMI output. I'll try them some time... (Shawe in the comments says that HDMI works OK but without any sound.)


References:
http://ubuntuforums.org/showthread.php?t=706530
https://bugs.launchpad.net/ubuntu/+bug/147757
http://wiki.mediati.org/Installation
https://launchpad.net/ubuntu/+source/alsa-driver/+bug/33719

PS: If I fix more problems I will update this post so you might want to check back later. If you find any problems or omissions please leave a comment.

PS2: It seems like someone did a partial translation of this article into Catalan. Here is a link to it. :-)

PS3: Thank you for your comments and the info you provided!

Linux On Laptops

Monday, June 2, 2008

ZVista

There are a few programs that manage to make me angry every time I use them. But nothing compares to Windows Vista. It must be by far the worst OS I have ever used. I mean, Microsoft must have really tried to create such a mess, it can't suck by accident.



It's sooooo sloooooooowwwww..... I have friends with Vista on their laptops, some of them just use them for office and internet, not a single game or other application. Well it takes around 10 minutes to do a restart! Before some days I was waiting 7 minutes for the shutdown before forcing a power off myself! (no it wasn't even installing updates)



Apart from the speed issues there are million other problems. It's amazing how they managed to mess up every single aspect of the OS. Even the console (the command prompt) doesn't support drag and drop!!! WHY??? Are they crazy? I mean, did they actually pay someone to do this??? In addition to this the changed the layout of the start menu to a more flat one. They also made changes to Windows Explorer. I was looking into a folder containing C source files with the details view mode, well, Vista insisted to show me artist name, album, etc for every source file! For some unknown reason it though this was a music folder! (Perhaps it wouldn't do so if there was a Visual C++ project file in the directory >:-P ) All of the above make Vista the worst OS for a programmer or even someone that wants to do more than surfing and writing in Microsoft Office!



Another really stupid aspect is that dialog that pops up every time you try to alter system files. I really like the extra security that it offers but a virus managed to infect a system without even triggering this dialog! (I accidentally run the virus on a friend's computer) So no extra security actually, just extra confirmations to get on your nerves.



Vista is really a stupid OS for stupid (trendy) people that want to see glossy windows, but even their 3D effects are inferior to what Compiz offers to Linux users (and of course Aero needs even better hardware).



The funny thing is that I am planning to buy a new laptop but they all ship with Vista preinstalled! Of course the first thing to do will be to get rid of them but I don't even like the idea that I will actually pay for this crap!





The dialog reads:

33 days and 0 hours remaining

Copying 1.506 items (6.03GB)

from Local Disk (C:) (C:\) to FREECOM HDD (G:) (G:\)

About 33 days and 0 hours remaining



Well, this was not Vista's fault (drive G: was problematic) but it describes, a bit dramatically, what you will go through if you use this NOS (Non Operating System)



Want some more?

Get a life...



PS: ZVista is pronounced like the word "delete them" or "clear them" in Greek.

Popular Posts