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 »

Monday, 27 August 2012

How to create a Linux LVM partition

In Linux, Logical Volume Manager (LVM) manages physical disk drives by using the notion of "logical" volumes. A "volume" could be a partition or an entire disk drive. Among other things, LVM allows you to create one or more logical volumes out of one or more physical volumes, resize logical volumes on-the-fly, and move logical volumes across different physical volumes. Such flexible disk management of LVM is a great advantage as re-partitioning is often necessary while you are running your system. If you would like to try out LVM, here is a 3-minute guide on how to create a Linux LVM partition.Read more »

Friday, 24 August 2012

How to plot ratios of values with Gnuplot

Gnuplot is a tool that can generate script-driven graphics, including plots of functions and data samples. Gnuplot contains a useful scripting language that allows you to process raw data files while producing graphics. For example, you can plot ratios of different values contained in raw data files.Read more »

Thursday, 23 August 2012

How to measure the average CPU utilization of a Linux process

Sometimes you may want to know the CPU usage of a particular Linux process. Since the CPU usage of a process can fluctuate over its lifetime, you will want to measure the average CPU usage or CPU utilization of the process. For this purpose, a Linux tool set called sysstat may come in handy. sysstat contains a collection of performance monitoring tools for Linux, reporting statistics on disk I/O, CPU, memory, networking, and other system activities. One of the utilities contained in sysstat is pidstat which measures the average CPU usage of Linux processes. In order to use pidstat, you need to install sysstat as follows.Read more »