Ubuntu 10.04 LTS x64 Desktop on XenServer 5.6

http://forums.citrix.com/thread.jspa?threadID=266677&tstart=0

This is just a quick quide for those wanting to install Ubuntu 10.04 LTS Desktop x64 on XenServer 5.6. Note that the points given will only work with XenServer 5.6 as pygrub of previous versions do not know how to read grub2.

1. Create a VM in XenCenter. I used Windows 2008 R2 x64 as a template.
2. Install Ubuntu 10.04 in any way you like. Just remember that when you get to choosing your partitions that you select EXT3 for your /boot partition because pygrub does not support the EXT4 file system yet. All the other partitions can be made EXT4.
3. Install SSH SERVER just in case something goes wrong so that you can still access your VM once it is installed.
4. The console for the DomU in PV mode is HVC0. You will need to tell getty to this. Copy the existing tty1.conf and edit it to replace “tty1” with “hvc0”.

sudo cp /etc/init/tty1.conf /etc/init/hvc0.conf
sudo nano -w /etc/init/hvc0.conf

5. Shutdown the VM
6. Retrieve the UUID for the VM by using : xe vm-list
7. Retireve the UUID for the VBD disk by using xe vm-disk-list uuid=xxxxxxxxxxxxxxxx
8. Clear out the HVM boot policy by using xe vm-param-set uuid=xxxxxxxxx HVM-boot-policy=
9. Set the PV bootloader to pygrub by using xe vm-param-set uuid=xxxxxxx PV-bootloader=pygrub
10. Set the VBD disk to bootable by using xe vbd-param-set uuid= bootable=true
11. Start the VM and login. If your console appears to hang, try connecting to the VM using SSH. If you missed step 4 the console will appear to hang. However it is actually not displaying the login prompt on hvc0
12. Mount the xs-tools.iso and install the Linux guest utilities.
13. Unmount the xs-tools.iso before restarting the VM.

You will have to setup VNC such that the guest console works. This is discussed in other forums and is therefore not repeated here.

Try http://community.citrix.com/display/ocb/2008/07/02/Installing+Ubuntu+on+XenServer

1 Comment

iPad Models

iPad models

Why would any sensible person get the non-3G version of the iPad? Honestly, Apple and, by extension, AT&T got this right by offering a 3G device capable of full Internet browsing and without a contract. If you don’t have a laptop now, this is a perfect device for typically browsing, email, documents, photos, and even eBooks. You can turn the 3G on/off at will–on a monthly basis.

,

1 Comment

Startup Script for JIRA in CentOS

#!/bin/sh -e
# chkconfig: 2345 90 10
# description: JIRA

# Define some variables
# Name of app ( JIRA, Confluence, etc )
APP=JIRA
# Name of the user to run as
USER=jira
# Location of application's bin directory
BIN=/opt/atlassian/jira-4/bin

case "$1" in
# Start command
start)
echo "Starting $APP "
su -s /bin/sh $USER -c $BIN/startup.sh
;;
# Stop command
stop)
echo "Stopping $APP"
su -s /bin/sh $USER -c $BIN/shutdown.sh
echo "$APP stopped successfully "
;;
# Restart command
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac

exit 0

Leave a comment

Add Retention Policies To Your Openfire Message Archive

I came across a challenge recently to limit the Openfire message archive to keep records for a certain period of time. Unfortunately, the default options for the Monitoring plugin (http://www.igniterealtime.org/projects/openfire/plugins/monitoring/readme.html) do not allow for any such customization. So, it was off to the MySQL database for some hands-on trimming. To better automate the process I created a Perl script to do the work for me.

ofArchiveRetention.pl

#!/usr/bin/perl

use warnings;
use DBI;

# MySQL Configuration
$host = "localhost";
$db = "openfire";
$user = "root";
$pass = "";

# Enter retention period here (in days)
$retentionPeriod = 14;

# ================================ #
# === DO NOT MODIFY BELOW HERE === #
# ================================ #

# Set Date Variables
$currentDate = time();
$modCurrentDate = $currentDate * 1000;
$modRetentionPeriod = $retentionPeriod * 86400000;
$retentionDate = $modCurrentDate - $modRetentionPeriod;

# Connect to the database
$dbh = DBI->connect("DBI:mysql:$db:$host", $user, $pass)
or die "Connection Error: $DBI::errstr\n";

# DEFINE A MySQL QUERY
$messages = "DELETE FROM ofMessageArchive WHERE sentDate <=$retentionDate";
$participants = "DELETE FROM ofConParticipant WHERE joinedDate <=$retentionDate";
$records = "DELETE FROM ofConversation WHERE startDate <=$retentionDate";

# Prepare database queries
$msgs = $dbh->prepare($messages);
$part = $dbh->prepare($participants);
$rcds = $dbh->prepare($records);

# Run database queries
$msgs->execute
or die "SQL Error: $DBI::errstr\n";
$part->execute
or die "SQL Error: $DBI::errstr\n";
$rcds->execute
or die "SQL Error: $DBI::errstr\n";

# Disonnect from the database
$dbh->disconnect();
exit(0);

Set this to run daily in cron:

0 1 * * * perl /root/ofArchiveRetention.pl

10 Comments

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Leave a comment