Wednesday, 3 October 2012

How to run MySQL query in a shell script

When you are writing a shell script as part of some batch processing, there are cases when the script needs to process data stored in a separate MySQL server. The general-purpose script languages such as Perl and Python have separate MySQL modules or interfaces to use, but shell script languages do not have such an interface for MySQL. However, there are ways to run some simple MySQL queries, and process the result even in a shell script.Read more »

Tuesday, 2 October 2012

How to change a XenServer’s local storage repository from LVM to EXT

By default, XenServer create LVM-type local storage repository (SR). The LVM-type local SR does not support VHD-formatted virtual hard disks, and hence may not be an ideal option when you are using XenServer along with OpenStack which has features that require access to individual VHD files, for VM snapshot and migration. On the other hand, with EXT-type local SR, you can get direct access to VHD files.Read more »

Monday, 1 October 2012

How to use local storage for CloudStack VMs

When CloudStack is deploying a VM (including guest VMs and system VMs), by default, the VM is set to use NFS-mounted primary storage as their root partition. The NFS-mounted primary storage is shared among all compute nodes located in the same CloudStack cluster. One of the reasons for using shared primary storage is VM migration. It is easy to migrate a VM from one compute node to another if the VM is backed by the same shared primary storage. If you don't need to migrate VMs, and compute nodes have plenty of local storage, you can configure CloudStack such that deployed VMs use compute node's local storage.Read more »

Friday, 28 September 2012

How to count lines of source code

For various reasons, you may want to know how many lines of source code a given software program is built in. For example, you want to estimate the effort devoted to developing a program, or to gauge the size and complexity of a program before trying it. There is some controversy as to using source lines of code (SLOC) as a metric to determine the size of a software program, since existing programming languages differ greatly in terms of clarify and brevity.Read more »

Thursday, 27 September 2012

How to set up QoS bandwidth rate limit on OpenWRT

OpenWRT is an operating system used for embedded devices such as commodity home routers to route network traffic. It provides rich feature sets for network management, including firewall, QoS policy, port forwarding, monitoring, etc. One of the useful features of OpenWRT is to configure QoS policy such as bandwidth limiting for connected devices. If you would like to configure upload and download rate limiting on OpenWRT, you can follow the instructions below. This setup has been tested on OpenWRT Kamikaze 8.09 with Linksys WRT54GL router.Read more »

Wednesday, 26 September 2012

How to synchronize time with NTP

NTP is a networking protocol which enables one to synchronize clock among different computers using IP packets. NTP is commonly used when one maintains a cluster of hosts to operate compute and storage cloud in data centers. NTP is capable of compensating for variable latency over networks, and can achieve clock synchronization with 1 millisecond accuracy in ideal conditions. If you would like to synchronize time with NTP, follow the steps below.Read more »

Monday, 17 September 2012

How to reload config.boot in Vyatta

Vyatta an open-source virtual router operating system based on a customized Debian distribution. Vyatta can easily be installed on virtual machines (VMs) created by standard hypervisors such as Xen, KVM and VMware, to implement virtual networking for VMs. Vyatta offers a specialized management console as well as web-based management interface to configure system settings such as network interfaces, firewall rules, QoS policy, etc. If you are reconfiguring Vyatta via its management console, you may want to know how to reload Vyatta configuration after you are done.Read more »