Running JBoss5 on Port 80

The default port of JBOSS is 8080. Clients having to access it will place something like this in the URL
http://xxx.xxx.xxx.xxx:8080 or http://somedomain:8080
Assuming you want it to eliminate the 8080 in the URL, you have to change the server setting of JBoss

You have to edit the file $JBOSS_HOME/server/default/deploy/jbossweb.sar/server.xml
where $JBOSS_HOME is the directory where your JBoss is, in FreeBSD it is /usr/local/jboss5 (installed via ports)

1. Look for the line
<Connector protocol="HTTP/1.1" port="80" address="${jboss.bind.address}"
connectionTimeout="20000" redirectPort="8443" >

2. change 8080 to 80

3. Restart your JBOSS server

Then you can access it without the :8080 on the URL

Setting up GRUB for dualboot with Windows XP on Ubuntu 9.04

If you have two hard drives on your PC, the first one being installed with Windows XP, and the second one with Ubuntu 9.04, you wouldn’t want to always edit the BIOS boot entry order to be able to switch from Windows to Ubuntu or from Ubuntu to Windows. Since your primary disk (/dev/sda) is windows and your secondary disk (/dev/sdb) assuming both are in the primary IDE, you just edit the GRUB on Ubuntu (/dev/hdb) and set the primary BOOT disk to the BIOS as the disk with Ubuntu so that when your computer boots, Ubuntu will be the default one. Here are the steps.

1. Set the BIOS primary boot disk to your secondary disk (the one with Ubuntu)

2. Start booting your Ubuntu OS.

3. Open a terminal `Applications -> Accessories -> Terminal`

4. Edit the GRUB entries, type sudo pico /boot/grub/menu.lst

5. Find the entry similar to this.. (usually at the bottom part)

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
rootnoverify (hd0,0)
savedefault
chainloader +1

6. change it to
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
map (hd1) (hd0)
map (hd0) (hd1)
rootnoverify (hd1,0)
savedefault
chainloader +1

7. Save and restart your PC
CTRL + O (save) and CTRL + X (exit from pico)
sudo shutdown -r now

Changing MySQL 5.0 root password in FreeBSD 7.2-RELEASE

So you have forgotten your mysql root password and you now have no access on you mysql server.

Here are the steps to set a new root password. (you need root privileges)

1. Stop the mysql database server
/usr/local/etc/rc.d/mysql-server stop

2. Start mysql and bypass the authentication
/usr/local/libexec/mysqld --skip-grant-tables --skip-networking --user=root &

3. Log in to mysql (without password)
mysql -h localhost -u root

4. When you’re logged and in the mysql command prompt, you set the password.
use mysql;
update user set password=password( 'yournewpassword' ) where user='root';
flush privileges;
exit;

5. Stop mysql by process id (PID)
ps ax | grep mysql
Result
34666 p0 I 0:01.53 /usr/local/libexec/mysqld --skip-grant-tables --skip-networking --user=root &
kill -TERM 34666

5. Start mysql via /usr/local
/usr/local/etc/rc.d/mysql-server start

6. Log to mysql and use your new root password
mysql -h localhost -u root -p

7. Enjoy