A man will die, but not his ideas.
Tuesday, June 02, 2009
Fixing Some of Guest OS Issues with VMWare Workstation on Linux
- When the virtual machine image is stored on an NTFS partition, NTFS-3G hogs the CPU and freezes the machine very frequently leading to very slow performance of the virtual machine and possibly preventing you from using files on that partition during the freeze periods. The reasone is a bit complicated, but a temporary solution is mentioned here. Just add the following line to the .vmx file of the virtual machine.
mainMem.useNamedFile=FALSE- Cannot connect to sound card because it is busy. Make sure knotify and Enlightened Sound Daemon (ESD) are not running. Kill those two processes (if they are active) and restart the vmware service just to make sure.
- On Linux, VMWare frequently stopped my Shift/Ctrl/Alt keys from working when going back from the guest OS (was XP in my case) to Linux. A solution to this problem would be to use the setxkbmap command to reset the keyboard layout.
- The arrow keys and other special keys are not functioning properly or not functioning at all. Create a config file in ~/.vmware directory and add this the following to the file then restart the vmware service.
xkeymap.keycode.108 = 0x138 # Alt_Rxkeymap.keycode.106 = 0x135 # KP_Dividexkeymap.keycode.104 = 0x11c # KP_Enterxkeymap.keycode.111 = 0x148 # Upxkeymap.keycode.116 = 0x150 # Downxkeymap.keycode.113 = 0x14b # Leftxkeymap.keycode.114 = 0x14d # Rightxkeymap.keycode.105 = 0x11d # Control_Rxkeymap.keycode.118 = 0x152 # Insertxkeymap.keycode.119 = 0x153 # Deletexkeymap.keycode.110 = 0x147 # Homexkeymap.keycode.115 = 0x14f # Endxkeymap.keycode.112 = 0x149 # Priorxkeymap.keycode.117 = 0x151 # Nextxkeymap.keycode.78 = 0x46 # Scroll_Lockxkeymap.keycode.127 = 0x100 # Pausexkeymap.keycode.133 = 0x15b # Meta_Lxkeymap.keycode.134 = 0x15c # Meta_Rxkeymap.keycode.135 = 0x15d # Menu Labels: linux, ubuntu, VMWare, XP
Posted by A ::
6:05 AM ::
0 Comments:

Post / Read Comments
-------------------------------------
Sunday, May 17, 2009
Removing .svn files manually from a managed directory..
I made a copy of an Eclipse project I was working on because I wanted to experiment with some things and didn't want to affect the original code. However, that project was managed by SVN and consequently all of the subdirectories of resulting copy also had the .svn subdirectories in them. I wanted to quickly delete all these subdirectories manually from the command-line. Here is what I did.
Use find to locate all the subdirectories having the given name within the desired directory. For example, for locating subdirectories with the name .svn within the current directory, use the following:
find . -name .svn
Now we pipe the results to xargs and use the rm -r as the command of choice for xargs. xargs will execute the given command on all the results obtained from the find command.
find . -name .svn | xargs rm -r
Note:
Because Unix filenames can contain blanks and newlines, please read the man pages for xargs for information regarding using xargs with such files.Labels: Eclipse, Java, linux, Subversion
Posted by A ::
7:48 AM ::
0 Comments:

Post / Read Comments
-------------------------------------
Tuesday, August 07, 2007
Fedora 7 on HP Compaq tc4400 - Part 1
Again, I've been very busy with too many things at once. Attempting to finish my thesis, instructing the summer training sessions at college, supervising two graduation projects for this year, completing an advanced digital design course, and taking a RHCE course. So, as you can see, no time to blog once again.
Between this and that, I tried to find some time to play around with the HP Compaq tc4400 Tablet PCs that came as part of a research grant to our department: 21 tablets along with external DVD-CD/RW optical drives, an HP all-in-one InkJet printer, a 5 MP HP digital camera, a wireless access point, a data show projector, and an educational laptop cart. These little tc4400s are equipped with everything (except a built-in Webcam): bluetooth, WiFi, IrDA, finger print reader, etc.

But since the tc4400 comes with Windows XP Tablet PC Edition installed and since I haven't tried installing a Linux distro on a laptop before, I decided to try to prove to a keen Microsoft colleague of mine that Linux can do whatever the Tablet PC Edition can and a lot more. So, I downloaded the latest Fedora release, Fedora 7, and started an exploratory journey accompanied by Linux and the tc4400.

The tc4400 doesn't come with an internal DVD/CD drive. And although the research grant comes with external drives, it is enough that I managed to get the tablet home with me. So, how in the world will I install Fedora 7 without a drive? Well, the beauty of Linux, as I have mentioned in previous posts, is that it is all about choice. Fedora can be installed from a DVD/CD, over the network, or even from an ISO image that resides locally on an attached hard disk drive. OK, but how will I boot the installer? As it turns out, I can place a boot image on a USB stick and use that stick to boot anaconda, Fedora's installer.

First, I downloaded diskboot.img from the Fedora Project main download server (you can use any other mirror). I then needed to get that image on my old 256 MB USB stick. This is usually achieved using the dd command from any machine having a Linux distro on it. But since currently I only had Windows, there had to be another way. Sure thing, there exists dd for Windows and RawWrite Studio. I used the former to write the diskboot.img to my USB stick after formatting it using HP's DiskFormat tool.
After setting the machine's BIOS to boot from USB, I was now standing at the boot menu for the installer. So now I needed a partition with a file system that Linux can read without problems to put the ISO image on. This turned out to be another challenge since the tc4400 came pre-partitioned into 2 partitions: one NTFS and the other FAT32. Fortunately, my dear friend Blade has brought me an 80 GB external Toshiba hard disk drive that attaches via USB as a gift. I can't thank you enough man. I never liked NTFS. And every time I partition a hard disk, I always use FAT32. And that's what I did with the external hard disk. I created a folder on one of the drive's patitions and placed the DVD ISO image in it.
When faced with the installer menu, I pressed ESC to get to the boot prompt and typed linux askmethod to inform the installer that I want to be asked about the location from which I will install Fedora. From the list of options, I chose Local Hard Drive and selected the partition and folder where the image resides. Presto, the installation was quickly up and running, simple as that. The installation process was straight forward and did not take much time (this depends on the number of packages being installed), nor did require many reboots (only one in fact, compare that to a famous OS we know).Labels: linux, Tablet PC
Posted by A ::
10:34 PM ::
5 Comments:

Post / Read Comments
-------------------------------------
Friday, January 05, 2007
My Little JMF Adventure
About ten days ago, I was assigned the task of implementing an application that required the ability to capture, play, and stream audio/video. Yes, it is the task that I've mentioned in previous posts which made me re-install Windows and caused a lot of GRUB problems. Anyway, since I'm pretty much busy this month, I decided I'd go the easy way, try what .NET has to offer, and use Visual Studio.NET 2005. Little did I know that I was probably making a bad decision.
After a few days of frustration and sinking in the pond of DirectShow(.NET), COM, COM Interop, C, C++, wrapper classes, delegates, and the likes, it was obvious that there had to be a better way. So, being the Java fan that I am, I decided to give the Java Media Framework (JMF) a try. I recall hearing about JMF back in 2002 when some elder students used it in their graduation project but I never really got the chance to look into it. And since I was sick and wanted to relax for a few days, it was a good chance to learn something new and test drive NetBeans 5.5 which I had already downloaded and installed on both Linux and Windows.
I installed JMF 2.1.1e (also on both Linux and Windows) and started Googling around and reading the JMF 2.0 API guide. I was really fascinated by the architecture and it had almost everything I needed. I'm really surprised why Sun has not made any attempts to further improve the framework and add more functionalities to it since 2004 or so. JMF even comes with a ready made application (with source code) called JMStudio that you could use as a player/streamer or to test JMF capabilities. In addition, I found some excellent sample code available on Sun's Web site. So, I launched NetBeans on Windows and started coding away. I first wanted to see whether I could capture the video stream from my Webcam since JMStudio was able to do so. I coded a simple application that performs the task. But when I launched the app, nothing appeared on the JPanel. I looked around for errors and searched online for answers but with no luck.
Finally, I noticed in some example an invocation to the pack() method of the JFrame. So, after everything else failed, I tried doing the same. Magically, after launching the application again, the captured video stream appeared on the JPanel. I don't know the reason yet, but I will check what the magical pack() method does. OK, that looks promising. Now for the real challenge. Let's try it on Linux. Ubuntu detects my Philips Webcam with no problems. So, first I wanted to double check using JMStudio. However, attempting to launch JMStudio failed with a NullPointerException. Now what?!
Looking around at Sun's forums, I found many posts recommending to make sure that the CLASSPATH and other related system variables are properly set. Some even went to say that Java 5.0 doesn't work with JMF. I discovered that this wasn't ture, since I was using the 5.0 version of the SDK. The solution to this exception is to set the AWT Toolkit to the Motif toolkit via the awt.toolkit JRE property when launching the application (java -Dawt.toolkit=sun.awt.motif.MToolkit JMStudio). JMStudio was up and running, and able to capture live video stream from my Webcam. Now to test my application.
Hmmm, there seems to be a problem (an obvious one I might say). In my application I created a MediaLocator using the "vfw://0" URI. But what should the URI be in Linux. After all, "vfw" stands for "Video For Windows". Amazingly, I discovered there was something called "v4l" (video4linux) on Linux. Refer to Capture Requirements sections in the JMF 2.1.1 - SW/HW Requirements. Some links to resources related to video4linux can be found here. The URI used for the MediaLocator will basically the same except that the "w" should become an "l". This even shows up if we launch the JMFRegistery application which comes with JMF alongside the JMStudio. Now, references to objects belonging to the com.sun.media.protocol.vfw package should be replaced to similar objects in the com.sun.media.protocol.v4l package. So far, so good. I got it working on Linux without any hassle.
Did I say having the camera working on Linux was a real challenge?! I was definitely wrong (although it took a while to figure out). The real challenge is using RTP to stream the captured video and receiving it on another side. This basically took most of my time to get right. What really saved the day was the excellent JMF 2.1.1 Solutions found at the Sun Developer Network (SDN). For your information, JMF also supports RTSP. So, ironically, in the end, it seems that the solution I was trying to avoid in order to save time turned out to be the most effective. I managed to finish the task in just 3 days and had a wonderful (sometimes difficult) experience with JMF.
Update:
According to the JavaDoc of the Window class, here is what pack() does:
"Causes this Window to be sized to fit the preferred size and layouts of its subcomponents. If the window and/or its owner are not yet displayable, both are made displayable before calculating the preferred size. The Window will be validated after the preferredSize is calculated."
After reading this, I'm not quite sure calling pack() is the right solution to the problem. But, at least it is working.
And here they are folks...

The Camera Server

The Monitoring (Client) Application
Notes:
When attempting streaming, especially on Windows XP systems, avoid obtaining the local IP of the machine using the getLocalHost() method of the InetAddress class because there might be many interfaces connected to the PC and the return value of the method will most likely be unpredictable. And even if there was only one network interface connected, Microsoft has a very stupid virtual connection entitled "Microsoft TV/Video Connection" that appears suddenly on Windows XP machines when a Web-cam or a TV/video card gets connected or starts functioning. And by the way, don't bother disabling it, simply because it won't allow you. The only solution Microsoft has to offer regarding this is to "restart the computer"! As it is explained in their knowledge base, "This behavior is by design"!!! I don't know why I suddenly recall Stephanie Tanner from Full House saying: "How ruuuuuude!!"Labels: Java, JMF, linux
Posted by A ::
6:53 PM ::
4 Comments:

Post / Read Comments
-------------------------------------
Friday, December 29, 2006
Reminders to Self
Reminder to self.
Download the cups-pdf package:
sudo apt-get install cups-pdf
(or via Synaptic)
sudo chmod +s /usr/lib/cups/backend/cups-pdf
"In order to ensure CUPS-PDF is running with the required root privileges you have to make ‘root’ the owner of the cups-pdf backend and set the file permissions of the backend to 0700 (root only)."
In Gnome:
System > Administration > Printing
New Printer
Local Printer & Use A Detected Printer click on PDF Printer
Choose “Generic” as the manufacturer
Choose “postscript color printer rev3b”
Leave the driver set to “Standard (suggested)”
Note:
Printed documents are stored at ~/PDF
- HowTo: Verify Checksum of Downloaded Files
md5sum filename
Then compare resulting checksum with the one provided in the ".MD5" file. If they match, then the file has most probably been downloaded correctly with no errors.Labels: linux, ubuntu
Posted by A ::
2:57 AM ::
2 Comments:

Post / Read Comments
-------------------------------------
Wednesday, December 27, 2006
Auto-Mounting Windows Shares in Ubuntu 6.10
OK, I finally managed to have Ubuntu running on my PC. And just so that no body jumps to conclusions, the issue was not resolved. I downloaded Edgy Eft Desktop CD and re-installed Ubuntu. Of course, I had to start configuring everything back the way it was. I have two NICs and share my Internet connection with my brother's PC via Firestarter. And among the things that I needed to configure was accessing the shared folders on his PC which was running Windows only. In order to not forget the process once again, and help others who might be looking for how to perform this, I'm listing the process here.
First, we need to install the smbfs package via apt-get or Synaptic. By the way, smbfs is not smbclient. Then we should create a file containing necessary credentials for accessing the shared folder. You could name the file anything you like (e.g. cred, smbcred, or sambapass). The file should contain the following fields:
username = windowsuser
password = windowspassword
domain = WINDOWSDOMAIN
You can use gEdit for editing the file. And by the way, in my case, I left the password and domain fields empty since they are not applicable.
Next, decide where you would like the shared folders to be mounted. I created a folder named "mounts" in my home directory and created a sub-directory for each shared drive on my brothers PC. Finally, we need to edit /etc/fstab so that we don't have to perform the mounting process every time we boot the machine. Before doing so, it is advisable that you create a backup copy of the file just in case.
In order to edit the file, you need to have root privileges. Thus, you could for example run gEdit via gksudo and provide the password. After that, you could open the fstab file from within gEdit and be able to edit its contents. What you need to add is a line for each shared drive/folder specifying were it should be mounted, file system type, what credentials are necessary for accessing the share, and setting the owner and group for all files in the share. For example:
//10.0.0.2/c /home/informer2000/mounts/sliders-2_c smbfs credentials=/home/informer2000/sambapass,uid=informer2000,gid=informer2000 0 0
Please note that there should be no line breaks in the line (i.e. all the above should be in one line). Now, all you have to do is save the fstab file, open the terminal and type sudo mount -a and if everything went well you should be able to access the shares from the directories at which they are mounted. In addition, the mounting command is not required after that because they will be mounted automatically when Ubuntu starts.Labels: linux, ubuntu
Posted by A ::
3:13 PM ::
2 Comments:

Post / Read Comments
-------------------------------------
Tuesday, March 28, 2006
Eclipse on Ubuntu
Still haven't fixed the IT8212 IDE RAID controller's problem with Ubuntu on my machine until now. However, today I managed to install Eclipse 3.1 on Ubuntu Breezy Badger on a dual-booting machine I've set up at the college's lab. It took some time since I'm still novice with Linux and did not have any idea about its packages and the many administration utilities it has. But in the end, I did it. Thanks to the nice guide at Ubuntu's wiki titled EclipseIDE, "How to install Eclipse in Ubuntu" by Ivar Abrahamsen, and the "Java Development on Ubuntu" series of posts on David Coldrick's Weblog.
Of course, I had to download all necessary files and packages on my home PC and then copy, install, and configure them on the lab's machine since there was no Internet connection over there. Thus, I did not use apt-get in the installation process. The packages I needed were available at Debian's packages site in the utils section of the stable distribution (fakeroot 1.2.10), the misc section in the unstable distibution (java-package 0.27) and the utils section of the unstable distribution (fakeroot 1.5.8). Only downloaded the ".deb" files. One package upon which the java-package depends was available with Ubuntu and did not need to download it, just used Synaptic.
Finally, you have configure Sun's JRE to be the default because somehow the GCJ runtime conflicts with it. This can be done by executing the following command which will ask you about the one you'd like to be the default:
sudo update-alternatives --config java
Alternatively, use Synaptic to remove the java-gcj-compat package and everything should be OK.
Update:
Discovered that all necessary packages could be obtained from Ubuntu's packages site. Duh!!!Labels: Eclipse, Java, linux, ubuntu
Posted by A ::
9:37 PM ::
3 Comments:

Post / Read Comments
-------------------------------------

Unless otherwise expressly stated, all original material of whatever nature created by the blog's author and included in the "A man will die, but not his ideas." weblog and any related pages, including the weblog's archives, is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.
* Java and the Java Coffee Cup Logo are trademarks or registered trademarks of Sun Microsystems,Inc. in the U.S. and other countries.