24 March 2012

XenServer: Install Ubuntu Linux From ISO

Download the Ubuntu ISO
Start by downloading the ISO so it’s ready when you want to install
http://www.ubuntu.com/download/server/download

Setup an ISO Share
If you don’t already have one you need a share on which to put your OS and other ISOs.
  1. On a local server setup a shared directory so it’s available on the LAN like \\[Server name]\[Share name]\
  2. In XenCenter start the “New SR” wizard and choose Windows FileSharing or NFS ISO as appropriate.
  3. Enter the share name and Finish.
  4. If you go to the Storage tab on on of the VMs you should see a dropdown with DVDDrive1: and your ISO share and all ISOs should be visible in there.
Ref: http://forums.citrix.com/thread.jspa?threadID=286471&tstart=0

Install the OS
Progress through the installation as normal you may like to refer to my previous post “Installing Debian as a Web Server” for more information.

XenServer: Install XenServer Tools on a Linux Client

To install XenServer Tools on a Linux client login via ssh then carry out the following commands:
  • sudo mkdir /mnt/cdrom
  • sudo mount -t auto /dev/cdrom /mnt/cdrom
  • sudo bash /mnt/cdrom/Linux/install.sh
  • umount /mnt/cdrom/
  • sudo shutdown -r -t 0

02 March 2012

Fix for: XSL Transform Removing Empty Tags

I’m using some XSL to transform into html including ‘empty’ <script> tags which are written with an src element but no content e.g. <script src="somescript.js"></script>

The Problem

Widgets from Google Amazon or others are often out of your control but the trouble is depending on your XSLT settings the XSL transformer might remove the </script> and transform it to <script src="" /> or even worse I’ve seen examples of it try to put the closing tag in for a self closing tag but in the wrong place.

The Fix

I found this question on stackoverflow.com with an answer which hacked fixed it for me. Reposting here in case the original gets (re)moved. Thanks Jasso!
<!-- Identity template for empty elements -->
<xsl:template match="*[not(node())]">
  <!-- Define a dummy variable with empty content -->
  <xsl:variable name="empty" select="''"/>
  <xsl:copy>
    <xsl:apply-templates select="@* | node()" />
    <xsl:value-of select="$empty"/>
  </xsl:copy>
</xsl:template>