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
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
How to do that Mysql thing in MSSql?
Ever wonder how to translate something you normally do between Mysql and MSSql?
Here is a good list of parity between the two.
Also, one section left open by that article is date formatting. After reading that, you can see why it was left out. It is quite a topic on its own.
Date Formats in MSSql
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.
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.
asp.net formview problem updating data
Very strange behavior with formviews on asp.net. For some reason, if I declare the SqlDataSource on the page source but then do the binding of the SqlDataSource to the formview in code behind, no error are shown but the data does NOT get updated on edit.
So instead of doing this in code behind
summary.DataSourceID = "summaryDS";
summary.DataBind();
I need to do this on the page
<asp :FormView ID="summary"
runat="server"
DataSourceID="summaryDS">
Develop and Debug – Android On A G1
This is a great way to debug your Android app on a G1 or any Android driven device via USB. It is a much better way to go than the emulator if you have the resources.
How not to show customer appreciation
Showing that you appreciate your loyal customers is a good thing to do, but doing it the T-Mobile way is not very appreciated. I just received a promotion from T-Mobile for being in the top 5% of their most loyal customers. It gives me a free companion plane ticket if I buy one from them at regular price. What a nice thing for them to do, right? I decided price out a flight from Oakland, CA to Tampa, FL for March 2009. The cost of a single round trip ticket was $815! Then I thought maybe it was spring break week for college students and Florida is a popular destination and therefore would drive the price up. So I checked Expedia.com and found the exact same flight for two passengers at $845. So what T-mobile is telling me is that my eight years of loyalty is worth, $30. The fact is that I was more content with them before they sent me this promotion. Now that I know my loyalty is only worth $30 to T-Mobile, I should shop around for a higher bidder. Maybe I can get $35!Â
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>
Update Delayed on Mysql and PHP
Wouldn't it be nice if we could use UPDATE DELAYED in mysql just like we do use INSERT DELAYED? Unfortunately, the work around mysql created for this is to insert a record into the events table in order to separate UPDATE statement into another thread. There is a large overhead to inserting to then execute an update.
If you are using PHP with mysql, there is another work around. PHP has a function called, register_shutdown_function, which will execute a function during the shutdown of processing a script file. So if we add an UPDATE LOW_PRIORITY sql statement wrapped in a function that is passed to register_shutdown_function, we can allow the user to receive the page without delay while the UPDATE statement waits until all locks on the table has been release before proceeding.
function update_delayed()
{
$sql = "UPDATE LOW_PRIORITY table_name SET col1 = 'something'";
mysql_query($sql, $conn);
}
register_shutdown_function('update_delayed');
I wonder if there are even better ways to handle this problem.