Sunday, April 19, 2009

Why do you do the things you do?

Its Sunday and a person whom I have much respect asked a question this morning: "Why do you(we) do the things you(we) do?"

In response to that question, of the many possible answers that were swimming in my head, the very first and simplistic answer in three words were: "Because I can." senyum Now now, context is everything... so what I really meant with that simple answer is that I am a person who enjoys new experiences.

From a techie perspective, this means that I really loved it when I get the chance to try out something new (ie software feature, engineering technique blah blah)... so that's why I do the things I do.

However, as I begin to reflect deeper, I found myself with 2 other answers and they are: "Because I want to be counted... and because I want to be of good help." Hence, the reason behind writing it down on my blog today. The transition from experiential (Because I can) to being part of something bigger (to be counted) and contributing towards it (be of good help) is a change in perspective in my professional career.

I started this Blog because I could (experiential). Slowly, it became a place where I realized that the technical (experiential) stuff I put here is just part of the much larger Open Source Software community... well, granted I have not contributed a single line of OSS code (yet) but I contibute by writing stuff I've tried and succeeded... so that others do not need to waste cycles repeating them.

I dig OSS because I could ... and now, because I believe that it can really be of benefit to everyone... even to those who don't realize that their productivity is a result of OSS running seamlessly behind the scenes in their daily routine.

With the launch of SUSE Linux Enterprise 11, and having seen some of the plans and roadmaps, I believe it is becoming more relevant and will be of good help to people looking for technical solutions to real-life business problems/challenges.

As I'm writing this entry, I'm waiting for some code/binary download to complete as I'm in the midst of preparing a few good demos for the official launch of SUSE Linux Enterprise 11 in Singapore this coming Wednesday (22nd April). Will be looking forward to share my experience soon. senyum

Tuesday, April 7, 2009

nVidia 3D desktop effects with Xen on SLED 11


YES! I did it! I've moved all my machines from SUSE Linux Enterprise 10 SP2 to SUSE Linux Enterprise 11. senyum As you can see from the screenshot above, 3D effects (Desktop Cube) with Windows XP running as a virtual guest on Xen on the right.

Those who knows me understands that this is not just about popping in a DVD and installing a vanilla OS. To be truly productive in my environment, I need to be sure (ie test, test, test) this new SLE 11 can meet and/or exceed my expectations on function/feature and interoperability with my essential applications.

So here is my first entry on how I customized my SUSE Linux Enterprise Desktop 11. I need desktop applications and eye-candy (3D effects) as well as the Xen virtualization engine. On my Thinkpad T61p, I have an nVidia Quadro FX570M. I want to be able to boot into a Xen kernel and still have the wonderful 3D desktop effects.

Pre-Reqs: Ensure you have installed the C/C++ Compiler and Tools installation pattern and the kernel-source package.

1) Download the latest nVidia Linux driver. At the time of this writing, its version 180.44. To find out which is the latest driver, check out this sticky thread on nvnew.net. Alternatively, you can go directly to nvidia.com, provide information on your card and have it re-direct you to the right driver via this link.

Note 1: Since this is a proprietary driver, obviously it would not be packaged with the default SLED 11. Nonetheless, upon vanilla install, the open source nv driver did a good job and was able to display high-res (1920x1200). Unfortunately, I did not have as much luck enabling the 3D desktop effects.

Note 2: The steps below is considered a manual/hard way of installing nVidia drivers. The advantage is you can use the latest (greatest?) driver from nVidia immediately. However, the down-side is you will need to recompile this driver every time you upgrade your Linux kernel (all other updates are ok). For an easier way, also known as the repository way where we use the nVidia Online Repository via YaST, to download and automatically install pre-compiled drivers. Please refer to these online docs [here and here] for a general idea between these 2 install options.


2) With SLED 11 (default, non-Xen kernel) running, switch to TTY1 (Ctrl-Alt-F1). Login as root and switch to runlevel 3 via the command <init 3>. Execute the NVIDIA driver you have downloaded. You might need to make that driver executable first via <chmod +x NVIDIA-Linux-x86_64-180.44-pkg2.run > and execute it < ./NVIDIA-Linux-x86_64-180.44-pkg2.run >

The driver installation program is rather straight-forward (most of the time just hitting Enter and choosing Yes). The program will inform you it cannot find any pre-compiled driver, just hit Enter and it will go ahead and compile the driver for SLED 11. If you are running a 64-bit SLED 11, it will offer to install 32-bit compatible "stuff", just accept it with Yes. Finally, it will offer to edit your configuration files, accept it with Yes. Easy. kenyit

Finally, edit the /etc/X11/xorg.conf file and change "Off" to "On" in the following line:

Section "Extensions"
Option "Composite" "on"
EndSection


3) Test that the nVidia driver works by going back to runlevel 5 via the command <init 5>. You should get full GUI. Log in and enable the 3D desktop effects Computer -> Control Center -> Look & Feel -> Desktop Effect. Check the Enable desktop effects checkbox.

Tip: After clicking on the checkbox, a dialog box asking if you want to keep the new settings appear. WAIT! DO NOT click Yes for another 3-5 seconds. This allows time for the 3D engine to initialize and should anything go wrong, it will revert back to 2D in 30 seconds automatically. Only when you see 3D effects (ie try moving the opened windows around), then click Yes on the dialog box to keep these settings.


4) As root, copy the compiled nvidia driver to another location and rename it for safe keeping. This is important because you will need to run the nVidia installer program again against the Xen kernel. This process will over-ride and remove this previously compiled driver for the default kernel.

As root and in your root directory (/root), execute the following command:
< cp /lib/modules/2.6.27.19-5-default/kernel/drivers/video/nvidia.ko ./nvidia.ko.default >


5) Reboot SLED 11 into the Xen kernel. You should fail to enter runlevel 5 (Full GUI) as the required nVidia driver for Xen has not been compiled yet. Log in as root on TTY1 and Re-run the nVidia installation program but do it via this "magic" line:

< IGNORE_XEN_PRESENCE=y CC="gcc -DNV_VMAP_4_PRESENT -DNV_SIGNAL_STRUCT_RLIM" ./NVIDIA-Linux-x86_64-180.44-pkg2.run >

The nVidia driver installation program will run again (see step 2) and this time, it will compile the driver against the Xen kernel. Highly recommend you take a copy of the newly compile nVidia driver:

< cp /lib/modules/2.6.27.19-5-xen/kernel/drivers/video/nvidia.ko ./nvidia.ko.xen >

Once successfully completed, go into runlevel 5 and voila!

6) To ensure that you can have full desktop GUI and 3D effects on both SLED 11 Default and Xen kernel, verify and copy the correct <nvidia.ko> files previously backed up (nvidia.ko.default and nvidia.ko.xen) respectively to:

(nvidia.ko.default) -> /lib/modules/2.6.27.19-5-default/kernel/drivers/video/nvidia.ko
(nvidia.ko.xen) -> /lib/modules/2.6.27.19-5-xen/kernel/drivers/video/nvidia.ko

Done and done! senyum

Tuesday, March 24, 2009

SUSE Linux Enterprise 11 is Official!

The day is finally here! SUSE Linux Enterprise 11 is now officially launched today! peace

Main page at Novell.com -> http://www.novell.com/linux

Thursday, March 19, 2009

TARing across the network with SSH

I'm getting old and I really thought I did blog about this... until I announced that its there on my blog at my workshop only to find that its NOT. soal

Anyway, the scenario is you want to tar up some files (or directories) but you want the resulting tar file on a remote machine connected via the network. This saves you some hard disk space locally and you get to do it in one step as opposed to tarring things locally and then copying it over the network.

The prerequisite is the target server has Secure Shell Daemon (SSH) running.

Here it is (and some variants):

tar -zcvf - ./<directory> | ssh <user>@<remoteIP-or-Hostname> 'dd of=<filename>.tar.gz'

Explanation: TAR and GZIP the entire <directory> but send the bits over stream via SSH to remote machine, as <user>, and write the bits into the file <filename>.tar.gz. senyum

tar -cvf - ./<directory> | ssh <user>@<remoteIP-or-Hostname> 'gzip > <filename>.tar.gz'

Explanation: TAR the entire <directory> but send the bits over stream via SSH to remote machine, as <user>, and GZIP the stream into the file <filename>.tar.gz. Similar to first but divides the work of TAR and GZIP across 2 machines... workload management, woo-hoo! encem

tar -cf - ./<directory> | ssh <user>@<remoteIP-or-Hostname> 'tar -xf -'

Explanation: TAR the entire <directory> but send the bits over stream via SSH to remote machine, as <user>, and UN-TAR the stream into the same directory and file structure of the source machine. senyum