Aug/090
VMware Server must be reconfigured when there is a kernel upgrade
If the linux kernel is upgraded, vmware will not load http://localhost:8222. It requires a reconfigure when this happens. Do the following.
sudo /usr/bin/vmware-config.pl
Jul/090
Forget your mysql root password?
This following line saved my butt when something happened and my root password was no longer working.
sudo dpkg-reconfigure mysql-server-5.0
It will allow you to reset your root password without messing with the data or any other configuration in my.cnf.
May/090
Ubuntu apache2 virtualhost setup problems
If you are getting error messages when starting apache2 like
“Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName”
or
“[warn] _default_ VirtualHost overlap on port 80, the first has precedence”
you need to make sure a couple of lines are in your /etc/apache2/httpd.conf file.
ServerName localhost
NameVirtualHost *:80
Apr/090
VMware bridged network Ubuntu and Windows
Setting up a Windows guest to serve to the LAN that the host Ubuntu is on is simple but a few gotchas to look out for.
My Setup:
1. Host VM Ubuntu withd 2 NICs
2. Guest VM XP Pro serving http through IIS
3. Lan with DHCP exist at Host VM level
4. Host VM uses eth0
5. VMware Server
Getting it to work:
- For the Network Adapter config for the guest VM select the Bridged Network created during install of VMware server (eth1 in my case since eth0 is assigned to host VM)
- On host VM Ubuntu, goto System>Preferences>Network Connections
- Edit eth1
- Uncheck Available to all users
- Goto IPv4 Settings tab
- Change method to Link-Local Only
- Apply and close
- Refresh NICs
- Make sure ifconfig does not show an IP address from the subnet of your LAN on eth1
- Since guest VM XP is to serve http, it should have a static IP
- Goto guest VM
- Set TCP/IP for the Local Area Connection to a static IP within the subnet of the LAN
- Run ipconfig /refresh in command line
- Make sure ipconfig shows the correct IP info just set
- Make sure it can connect to internet
- Make sure Windows Firewall is not blocking http or port 80 (obvious step but it threw me for a loop for a little while)
- Now just check from host VM to see if a test webpage shows up
Apr/099
Ubuntu 9.04 Vmware Arrow Keys Problem
I finally found how to get all those keys working on my newly installed Ubuntu 9.04 with my XP VM. The issue is that all the arrow keys and delete key don’t work. There are others too but not listed. So a bit of googling, I found that you have to map the keys in a vmware config file to solve the problem. So this is what needs to be done.
1. Edit /usr/lib/vmware/config
2. Add the following to the end.
xkeymap.keycode.108 = 0x138 # Alt_R
xkeymap.keycode.106 = 0x135 # KP_Divide
xkeymap.keycode.104 = 0x11c # KP_Enter
xkeymap.keycode.111 = 0x148 # Up
xkeymap.keycode.116 = 0x150 # Down
xkeymap.keycode.113 = 0x14b # Left
xkeymap.keycode.114 = 0x14d # Right
xkeymap.keycode.105 = 0x11d # Control_R
xkeymap.keycode.118 = 0x152 # Insert
xkeymap.keycode.119 = 0x153 # Delete
xkeymap.keycode.110 = 0x147 # Home
xkeymap.keycode.115 = 0x14f # End
xkeymap.keycode.112 = 0x149 # Prior
xkeymap.keycode.117 = 0x151 # Next
xkeymap.keycode.78 = 0x46 # Scroll_Lock
xkeymap.keycode.127 = 0x100 # Pause
xkeymap.keycode.133 = 0x15b # Meta_L
xkeymap.keycode.134 = 0x15c # Meta_R
xkeymap.keycode.135 = 0x15d # Menu
3. Save it
4. Restart vmware
Thank goodness. What a pain this was to use with a whole bunch of keys not working.
Apr/090
GRUB Error 21 Dual Boot Raid
I was installing Ubuntu to dual boot onto a newly added drive on my workstation that already has Windows XP. After the installation, GRUB gives me error 21. I looked through all the forums and help and tried everything from reinstalling GRUB to modifying menu.lst. Nothing worked. Then I figured out what the problem was. My system before adding the new drive had three drives; one with XP OS and two in a Raid 1 array for data. The issue was the Raid 1 array. With the new drive I added for Ubuntu, the computer had four drives. During installation, Ubuntu saw four drives and when installing GRUB, it pointed Ubuntu to boot on hd3,0. However, when GRUB tried to load, the BIOS was showing only three drives and hd3 was non-existent resulting in error 21.
Then I decided to move my SATA cables around so the location of the Ubuntu install does not change no matter if we saw the Raid 1 as one drive or two. So I kept XP on hd0, moved Ubuntu to hd1, and then having the Raid 1 drives to follow with hd2 and hd3. At this point, I reinstalled GRUB and tried to boot up again with the Raid 1 configured in the BIOS. Now I get GRUB error 17! What the heck is that? I found that if I got rid of Raid on the BIOS, error 17 goes away and GRUB comes up without a problem.
I got tired of trying to debug this and decided to just go all Ubuntu and just VM XP for the few things I still need to do on Windows.
Dec/080
Setup Ruby On Rails on Windows
http://wiki.rubyonrails.org/rails/pages/HowtoInstallOnWindows
This is where to get the fastcgi dll.
http://www.fastcgi.com/dist/
Sample Apache virtual host configuration
<VirtualHost *:80>
<Directory “C:/data/projects/testapp/public/”>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all</Directory>
Options ExecCGI FollowSymLinks
AddHandler cgi-script .cgi
AddHandler fastcgi-script .fcgi
ServerAdmin webmaster@testapp.dev
DocumentRoot “C:/data/projects/testapp/public/”
ServerName testapp.dev
ServerAlias www.testapp.dev
ErrorLog “logs/testapp.dev-error.log”
CustomLog “logs/testapp.dev-access.log” common</VirtualHost>
May/080
Mysql on 32bit processor vs 64bit processor
Here is the continuation of the experiment done previously on Mysql on Windows vs Linux. After doing more analysis and observation, it appeared that the difference in speed for the benchmark tests were not related to Windows and Linux but were related to the processor. The previous test just happened to have AMD 64s on the Linux machines and Intel Xeon 32bits on Windows. We hypothesized that the increased throughput of the 64bit processors resulted in about half the time required to return the same query run on a 32bit machine.
So we decided to test the same query again on a Windows machine with an AMD 64 X2. This time the result for the query took 7.35 second, almost the same as the other AMD 64s running Linux.
One more test to run the query on a Windows Intel 64bit chip machine would better solidify our hypothesis.
May/080
Mysql server has gone away
I have a spider crawling the web written in PHP running constantly to insert and update data in a Mysql database. Today, it kept stopping on a records with the error message, “Mysql server has gone away”. It certainly did not time out as just starting the process again would result in this message immediately. The script did not close out the connection to the DB as it had worked just fine for over a year.
Finally, I found that the problem was max_allowed_packet setting in my.cnf was too small. It was set to 2MB and when Mysql receives a query larger than that, it assumes that something must have gone wrong and closes the connection. I increased that parameter to 4MB and everything is working fine now.
Feb/080
Mysql SQL_NO_CACHE Benchmark Problem
I have been trying to benchmark the sql calls to mysql from an application without success. Even when I set the SELECT statement to SQL_NO_CACHE, the results seemed to be still cached. Apparently, Linux does its own caching of disk reads also. That was giving me incorrect benchmark results if I hit the same data twice.
For those using Linux kernel 2.6.16 or higher, you can clear Linux cache with the following command.
echo 3 > /proc/sys/vm/drop_caches
Unfortunately for me, I am stuck on 2.5.xx and will have to figure out another method.