Tuesday, 9 October 2012

How to limit the CPU usage of a Linux process

If you are a Linux system admin, there are cases where you would like to limit the CPU usage of a certain process such that at no time does the process eat up more than X% of CPU resource. cpulimit is a Linux program that can do exactly that, i.e., limiting the CPU usage of a Linux process in percentage. It monitors the CPU usage of a specified process as a daemon, and adjusts its CPU utilization dynamically.Read more »

Monday, 8 October 2012

How to convert wmv to avi on Linux

Windows Media Video (WMV) is a media container and compression format used for Microsoft's proprietary codecs, and as such there are not many software that support playback of WMV files, besides Microsoft's own products such as Windows Media Player and Windows Movie Maker. On the other hand, Audio Video Interleaved (AVI) is a container format for various standard multimedia codecs such as DivX, Xvid, MPEG4, etc., and hence enjoys wider software compatibility.Read more »

Friday, 5 October 2012

How to backup files to a remote FTP server using lftp

lftp is a command-line FTP client with several advanced file transfer features. For example, lftp can upload or download a whole directory tree recursively and selectively, or resume interrupted file transfers. A popular use case of lftp is to mirror local files or folders to a remote FTP server. While rsync is a popular mirroring software tool, it uses its own file synchronization protocol, and so does not work over FTP.Read more »

Thursday, 4 October 2012

How to enable ssh access on Vyatta router

A fresh installation of Vyatta does not have SSH access enabled by default. Thus, if you would like to SSH to a Vyatta router, you first need to enable SSH service. In order to enable SSH access on Vyatta router, enter the following commands via its console.Read more »

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 »