Citirx XenServer has a nice feature which lets you install a Linux directly from the repository. The one catch is that you have to get the URL right and if you don't you only get the error when you try and start up the VM. I've only tried out CentOS and Debian, the URL's for these distros are:
http://ftp.ca.debian.org/debian/ (Debian)
http://mirror.csclub.uwaterloo.ca/centos/5.5/os/x86_64/ (CentOS)
Note that since our host server is in Canada, I have used the Canadian mirrors. If you're using a different mirror, you'll have to replace the hostname with the hostname of your mirror.
Tech tips, mostly to do with Linux, Ubuntu, Grails, PHP, development tools and so on...
Wednesday, 16 February 2011
Tuesday, 15 February 2011
How to change timezone on RHEL/CentOS
Here’s how to change the timezone on CentOS/RHEL:
cp /usr/share/zoneinfo/Pacific/Auckland /etc/localtime
Tuesday, 8 February 2011
Installing Redmine + SVN on Ubuntu 10.04
I've got a new workstation pc. It's not much (no hardware supported virtualization, onboard graphics) but it does the job. I've decided to take it and basically turn it into the ultimate development machine. That is to say, start right from the beginning and do things properly. The last sentence probably means a lot of different things to a lot of different programmers, so what does it mean to me? Well basically:
* Ability to access the machine remotely (Dynamic DNS + SSH/Web access)
* A Version Control System (Subversion, thank you very much)
* Project management/issue tracking software
* Development web server + database (Tomcat & MySQL)
So, today I will be writing how to get Subversion + Redmine up and running on Ubuntu 10.04. Partly to help someone out there that might be having the same problem and partly because I'll probably be having to install it again in the future and having a written record might save some time :-)
I've installed both Subversion and Redmine from the repositories and generally used the sample configuration which came with the packages, with a little bit of tweaking of course.
Installing Subversion is as easy as running:
Next, I mostly followed the subversion install instructions found on the ubuntu wiki page, setting up a private repository. The wiki writeup is excellent, telling you how to get up and running quickly, whether you use subversion over HTTP/HTTPS/SVN/SVN+SSH.
Redmine was a little more tricky to install, although still a lot easier than I remember it being before it was in the repositories. Start by running:
If you don't use MySQL, use one of the alternates (redmine-sqlite, redmine-pgsql). The sample configuration for Apache can be found at /usr/share/doc/redmine/examples/. I used the 'apache2-alias.conf' file by pasting it into /etc/apache2/sites-available/redmine and running:
After this I got an error saying that one of the apache directives was in the wrong place:
I then tried moving the directive to the /etc/apache2/mods-available/fcgid.conf, however this ended up giving me a different set of errors in the apache error log:
Finally, I commented this line out from both sections and was able to get redmine going without fcgi (Later I realised that I had installed passenger and it was running and that this was probably the reason that fcgi kept throwing the errors.
So, then you can navigate to http://localhost/redmine/ and configure the admin user (default username/pass is admin:admin) and you should have a working Redmine install.
* Ability to access the machine remotely (Dynamic DNS + SSH/Web access)
* A Version Control System (Subversion, thank you very much)
* Project management/issue tracking software
* Development web server + database (Tomcat & MySQL)
So, today I will be writing how to get Subversion + Redmine up and running on Ubuntu 10.04. Partly to help someone out there that might be having the same problem and partly because I'll probably be having to install it again in the future and having a written record might save some time :-)
I've installed both Subversion and Redmine from the repositories and generally used the sample configuration which came with the packages, with a little bit of tweaking of course.
Installing Subversion is as easy as running:
sudo apt-get install subversion libapache2-svn
Next, I mostly followed the subversion install instructions found on the ubuntu wiki page, setting up a private repository. The wiki writeup is excellent, telling you how to get up and running quickly, whether you use subversion over HTTP/HTTPS/SVN/SVN+SSH.
Redmine was a little more tricky to install, although still a lot easier than I remember it being before it was in the repositories. Start by running:
sudo apt-get install redmine redmine-mysql
If you don't use MySQL, use one of the alternates (redmine-sqlite, redmine-pgsql). The sample configuration for Apache can be found at /usr/share/doc/redmine/examples/. I used the 'apache2-alias.conf' file by pasting it into /etc/apache2/sites-available/redmine and running:
sudo a2ensite redmine
sudo /etc/init.d/apache2 restart
After this I got an error saying that one of the apache directives was in the wrong place:
... waiting Syntax error on line 14 of /etc/apache2/sites-enabled/redmine:
SocketPath cannot occur within section
I then tried moving the directive to the /etc/apache2/mods-available/fcgid.conf, however this ended up giving me a different set of errors in the apache error log:
[Sun Feb 13 16:23:33 2011] [error] (13)Permission denied: mod_fcgid: couldn't bind unix domain socket /var/run/redmine/sockets/default/6126.28
[Sun Feb 13 16:23:33 2011] [warn] (13)Permission denied: mod_fcgid: spawn process /usr/share/redmine/public/dispatch.fcgi error
Finally, I commented this line out from both sections and was able to get redmine going without fcgi (Later I realised that I had installed passenger and it was running and that this was probably the reason that fcgi kept throwing the errors.
So, then you can navigate to http://localhost/redmine/ and configure the admin user (default username/pass is admin:admin) and you should have a working Redmine install.
Tuesday, 3 August 2010
MySQL Stored Procedure tip
The other day I was writing a stored procedure, when after making a change it just wouldn't save and kept giving me an error, saying something useful like "There is an error in your SQL syntax...".
After pulling my hair out for a day trying to work it out, I realised that when dealing with MySQL stored procedures you must put all of your declare statements at the start of the sproc.
After pulling my hair out for a day trying to work it out, I realised that when dealing with MySQL stored procedures you must put all of your declare statements at the start of the sproc.
Saturday, 3 July 2010
My new phone - Samsung i5700
I've been looking for a mobile phone for a while now, and after a lot of deliberation I settled on the Samsung i5700. The phone came from Parallel Imported, here in Auckland and after turning on the phone and playing around with it, it was obvious that it originally came from England, most likely from Virgin Mobile.
The first thing to note was that the phone came with Android version 1.5, which I immediately wanted to upgrade to the latest version (2.2) as soon as possible. This lead to my first disappointment. It turns out that the only way to upgrade the phone is by installing the Samsung New PC Studio software. This should've been straight forward enough, except that:
* The software CD which came with the phone had the wrong version of the software, meaning it wouldn't recognise the phone
* Samsung has several different versions of New PC Studio, depending on
- your county
- your provider
* New PC Studio has been replaced by a piece of Samsung software called Kies, which also refuses to recognise the phone
* Once I located the correct version of the software and installed it, it recognised the phone the first time it was plugged, but all consequent attempts to get it to recognise the phone have failed
* The Samsung software is incredibly annoying. It uses too much sound and the only thing I can see myself using it for is to upgrade to the newer version of Android
I swear, Samsung are utter crap at software, and if you had to find someone to write a manual on how not to create useful, bug free software, you should see the guys which created NPS and Kies.
Once I got that out of the way (in the process I had exceeded the download limit on my internet connection) I found that the software was not available to download. i.e. it would not allow me to upgrade the phone. By this time I was furious. The reason that the software wasn't available is that you first needed Samsung to issue the update and then get the mobile provider (probably Virgin Mobile) to push the upgrade to all of the devices. These kinds of problems are exactly what everyone was trying to warn consumers about when they warned of Android fragmentation. In giving too much say to the handset makers and the mobile services providers, Google have created a situation where each middle man tries to "add value" by adding their own proprietary layer. From this consumers point of view, all the middle men do is add shit.
Samsung should stick to making TV's and not try and be a software company. Virgin Mobile should invest money in their infrastructure instead of trying to wring every last dollar out of their clients.
The first thing to note was that the phone came with Android version 1.5, which I immediately wanted to upgrade to the latest version (2.2) as soon as possible. This lead to my first disappointment. It turns out that the only way to upgrade the phone is by installing the Samsung New PC Studio software. This should've been straight forward enough, except that:
* The software CD which came with the phone had the wrong version of the software, meaning it wouldn't recognise the phone
* Samsung has several different versions of New PC Studio, depending on
- your county
- your provider
* New PC Studio has been replaced by a piece of Samsung software called Kies, which also refuses to recognise the phone
* Once I located the correct version of the software and installed it, it recognised the phone the first time it was plugged, but all consequent attempts to get it to recognise the phone have failed
* The Samsung software is incredibly annoying. It uses too much sound and the only thing I can see myself using it for is to upgrade to the newer version of Android
I swear, Samsung are utter crap at software, and if you had to find someone to write a manual on how not to create useful, bug free software, you should see the guys which created NPS and Kies.
Once I got that out of the way (in the process I had exceeded the download limit on my internet connection) I found that the software was not available to download. i.e. it would not allow me to upgrade the phone. By this time I was furious. The reason that the software wasn't available is that you first needed Samsung to issue the update and then get the mobile provider (probably Virgin Mobile) to push the upgrade to all of the devices. These kinds of problems are exactly what everyone was trying to warn consumers about when they warned of Android fragmentation. In giving too much say to the handset makers and the mobile services providers, Google have created a situation where each middle man tries to "add value" by adding their own proprietary layer. From this consumers point of view, all the middle men do is add shit.
Samsung should stick to making TV's and not try and be a software company. Virgin Mobile should invest money in their infrastructure instead of trying to wring every last dollar out of their clients.
Monday, 7 June 2010
Ubuntu 10.04, impressions after a week
As a part of doing a general clean up of my laptop, last Wednesday/Thursday I carefully backed up all of the data accross all of the 5 different partitions (all of which had different operating systems, including three versions of Ubuntu), before deleting the partitions and installing Ubuntu 10.04 LTS as the only OS on my laptop. The process was quite time consuming, having to log into each and every OS and copy anything useful over to the "Data" partition. Ultimately, the effort did pay off in the end though and I'm left a feeling of great satisfaction at the fact that I didn't lose any data and managed to clean up my system.
As for the OS of choice for this rebirth of my laptop, it had to be Ubuntu 10.04. I had used Unetbootin recently to trial both the latest versions of Ubunut and Kubuntu, but ultimately settled on Ubuntu due to its better support of the wireless chipset in my laptop. The wireless is something I've constantly been struggling with over the years, with it behaving strangely, such as reducing power until the connection dies at which point it tries to reconnect. With 10.04 these problems seem largely solved (cross fingers), although my connection still sometimes drops out when I'm on the other side of the house. The other neat little thing is that this newer version of Ubuntu supports the status LED of the wireless chipset.
The few problems which I ran into after the install were to do with third party software and importing items from the previous installs. Google Gears failed to install, and after tracking the problem down it seems that Google is only providing a 64-bit version of the software, meaning that 32-bit users are out of luck. The fix was simply to install the 'xul-ext-gears' package from the repositories, but this could have been better integrated into the interface. The second problem I faced was to do with trying to import all of my old Tomboy notes. I have yet to find a script/program to do this for me and just pointing the synchronisation to the directory containing the old notes doesn't seem to work. It looks like I'm going to have to write some code for this one, not that I mind too much :)
Overall, 10.04 is a very impressive release. I'm more impressed with the stability improvements than any of the new features (social media anyone?).
As for the OS of choice for this rebirth of my laptop, it had to be Ubuntu 10.04. I had used Unetbootin recently to trial both the latest versions of Ubunut and Kubuntu, but ultimately settled on Ubuntu due to its better support of the wireless chipset in my laptop. The wireless is something I've constantly been struggling with over the years, with it behaving strangely, such as reducing power until the connection dies at which point it tries to reconnect. With 10.04 these problems seem largely solved (cross fingers), although my connection still sometimes drops out when I'm on the other side of the house. The other neat little thing is that this newer version of Ubuntu supports the status LED of the wireless chipset.
The few problems which I ran into after the install were to do with third party software and importing items from the previous installs. Google Gears failed to install, and after tracking the problem down it seems that Google is only providing a 64-bit version of the software, meaning that 32-bit users are out of luck. The fix was simply to install the 'xul-ext-gears' package from the repositories, but this could have been better integrated into the interface. The second problem I faced was to do with trying to import all of my old Tomboy notes. I have yet to find a script/program to do this for me and just pointing the synchronisation to the directory containing the old notes doesn't seem to work. It looks like I'm going to have to write some code for this one, not that I mind too much :)
Overall, 10.04 is a very impressive release. I'm more impressed with the stability improvements than any of the new features (social media anyone?).
Sunday, 18 April 2010
Linux Hypervisor in 2.6.32
Just came accross this article on Slashdot, detailing a new feature of the 2.6.32 kernel, dubbed 'Kernel Shared Memory'.
The technology allows you to de-duplicate memory regions in virtual machines running on the hypervisor. What does this mean? It means that you can have a physical server with 10GB of RAM and have 3 times that number of VM's running on it with each having a full 1GB of RAM. In the release notes, there's even a reference to 52 Windows VM's running on a single 16GB server with 1GB memory each!
This of course depends a lot on what kinds of OS's you have running on the server (ideally you want the same OS on all of the VM's to maximise the duplicate memory) and also how similar the memory profiles of those VM's are. But my guess is that in most operating systems, there is a large amount of memory which is common, loaded at boot and then never written to.
From what I can tell, right now only the KVM hypervisor supports KSM, but seeing how general the technology is (it can be used by any process to de-duplicate memory pages) there's no reason why Xen couldn't easily make use of KSM.
The technology allows you to de-duplicate memory regions in virtual machines running on the hypervisor. What does this mean? It means that you can have a physical server with 10GB of RAM and have 3 times that number of VM's running on it with each having a full 1GB of RAM. In the release notes, there's even a reference to 52 Windows VM's running on a single 16GB server with 1GB memory each!
This of course depends a lot on what kinds of OS's you have running on the server (ideally you want the same OS on all of the VM's to maximise the duplicate memory) and also how similar the memory profiles of those VM's are. But my guess is that in most operating systems, there is a large amount of memory which is common, loaded at boot and then never written to.
From what I can tell, right now only the KVM hypervisor supports KSM, but seeing how general the technology is (it can be used by any process to de-duplicate memory pages) there's no reason why Xen couldn't easily make use of KSM.
Labels:
kernel shared memory,
ksm,
kvm,
linux,
virtualization
Subscribe to:
Posts (Atom)