Friday, 14 December 2012

How to set up proxy auto config on Ubuntu Desktop

Suppose you are using your Ubuntu Desktop laptop at home and workplace. Assume that when you are at your workplace, the corporate network your laptop is connected to is behind proxy. You then have to turn on/off proxy depending on where you are. Of course you can manually update proxy settings of Ubuntu Desktop every time your network changes, but that's quite cumbersome. That's when proxy auto-config helps.Read more »

Thursday, 13 December 2012

How to enable logging in OpenStack via devstack

Devstack is a shell script used to automate the building process of the entire OpenStack development environments. In OpenStack deployment created by devstack, debug output of individual OpenStack services goes to their corresponding interactive screen sessions. For debugging purposes, however, you may want to enable logging in OpenStack services. If you are using devstack to install OpenStack, you can easily enable logging in OpenStack by using devstack.Read more »

Wednesday, 12 December 2012

How to set up a transparent proxy on Linux

A transparent proxy sits between clients and the Internet, acting as a gateway for the clients. It's called transparent because clients are not required to configure anything for the proxy. A transparent proxy is useful when it's not possible or desirable to modify client configurations, while it's necessary to intercept client's requests.Read more »

Tuesday, 11 December 2012

How to use a custom DNS server on Ubuntu Desktop

In Linux, DNS servers are specified in /etc/resolv.conf. However, a proper way to configure custom DNS settings on Ubuntu Desktop is not manually modifying /etc/resolv.conf, but using a separate GUI-based network management program which controls the content of /etc/resolv.conf.Read more »

Monday, 10 December 2012

How to find the IP address of VMware virtual machine

When you run a virtual machine (VM) created by VMware Player or VMware Server, there can be circumstances where you don't have console access to the VM. For example, you could be running your VM without VMware Player GUI, or you may have trouble opening a remote console from VMware Server. If you don't have access to VM console, you will need to remotely ssh to the VM by using its IP address. But how do you find out its IP address in the first place?Read more »

Friday, 7 December 2012

How to manage a wired network on Ubuntu Desktop

On Ubuntu Desktop, a separate GUI program called NetworkManager is responsible for configuring network settings (e.g., wired network, wireless network, proxy settings). However, on a fresh installation of Ubuntu Desktop, your wired network is NOT managed by NetworkManager, but by /etc/network/interfaces.Read more »

Thursday, 6 December 2012

How to backup a hard disk on Linux

If you would like to backup your hard disk, there is a simple way to do it by using "dd" command. The dd command utility is used to copy files or disk images from one location to another. Using dd, you can backup an unmounted disk as a (compressed) disk image which is then stored in a separate local or remote disk. Here is how to backup and restore a hard drive using dd command.Read more »

Wednesday, 5 December 2012

How to use svn behind proxy

If your Linux host is behind a corporate proxy, and you are trying to access a svn repository located outside the corporate network, you will need to configure proxy settings in svn, so that svn traffic can traverse the proxy properly.Read more »

Tuesday, 4 December 2012

How to configure http proxy exceptions on Linux

When you are behind http proxy, you need to configure proxy settings for your applications in one way or another. Typically you define http_proxy environment variable pointing to your proxy, so that all http requests go through the proxy. But what if you want to bypass http proxy for specific destination web servers? That's when you need to configure http proxy exceptions.Read more »

Monday, 3 December 2012

How to diff remote files over ssh

Diff command line utility compares contents of two files (or directories), and shows how they differ line by line. It's straightforward to use diff if both input files are located on local host. But what if input files located on two different hosts? You can actually diff remote files over ssh. Here is how.Read more »

Friday, 30 November 2012

How to edit a remote file over ssh

When you need to edit a file hosted on a remote host, it will be nice if you can edit the remote file over ssh with vi command, as if it were a local file. Of course you could set up NFS over ssh tunnel to achieve that, but that will be an overkill if this is just one-time usage. So how can I edit a remotely located file over ssh?Read more »

Thursday, 29 November 2012

How to checkout a specific version of git repository

A public git repository is often shared by multiple developers who constantly contribute new code and fixes, and users who check out code to try it. Along with code itself, a git repository contains full commit history of the code, as well as revision tracking information. As such, you can easily checkout a particular version of specific files from git repository if you want. In order to checkout a specific version of git repository, see the following examples.Read more »

Wednesday, 28 November 2012

How to view a list of MySQL users and their privileges

If you are running a multi-user MySQL database, handy commands that show a list of all existing MySQL users and their privileges may be on your cheat sheet. To find out all MySQL users and the permissions granted to each user, log in to your MySQL server, and run the following MySQL commands.Read more »

Tuesday, 27 November 2012

How to convert pdf files to jpg format on Linux

While PDF (short for "Portable Document Format") is a widely used document format supported by a variety of applications on multiple platforms, you may want to convert pdf files to jpg format for several reasons. For example, you may want to embed a pdf file into PowerPoint or OpenOffice Impress presentations, in which case jpg/jpeg images will be easier to work with. Converting a pdf file into jpg also makes it unnecessary to load a separate plugin or external application for web browsers to render it. If you are looking to convert pdf files to jpg/jpeg format on Linux, the following guide will help.Read more »

Monday, 26 November 2012

How to enable X11 forwarding using ssh

X11 forwarding is a mechanism that allows graphical interfaces of X11 programs running on a remote Linux server to be displayed on a local client machine. Behind the scene, the X11 output of a remotely running program is authorized to be sent to localhost via an X11 connection between client and a remote server. SSH has an option to securely tunnel such X11 connections, so that X11 forwarding sessions are encrypted and encapsulated. If you would like to set up X11 forwarding over SSH, check out this guideline.Read more »

Friday, 23 November 2012

How to convert jpg image file to pdf format on Linux

Jpg is without any doubt the most popular format used to share images on the Internet. However, there are several advantages in using pdf images compared to jpg images. For one, while jpg is a raster format with lossy compression, pdf is a layout format that contains both vector and raster graphics. Read more »

Thursday, 22 November 2012

How to start VMware server remote console without web interface

In VMware Server, console access for virtual machines (VMs) is obtained by using VM remote console plug-in of web browsers. However, as VMware Server is no longer supported by VMware, its remote console plug-in has not been usable in the latest web browsers. For example, VM remote console plug-in is broken for Firefox version 3.6 and higher. When you attempt to launch VM console window on the latest Firefox via console plugin, you will get an error saying "Cannot access virtual machine console. The request timed out."Read more »

Wednesday, 21 November 2012

How to install an old version of Firefox on Linux

There could be several reasons why you want to stick with a specific (old) version of Firefox web browser, instead of updating it to the latest version. Some of your favorite add-ons could no longer work after Firefox update; you may want to try out an old Firefox extension which has not been updated for too long a time to be compatible with the latest Firefox; some web application's user interface may no longer be accessible after you have upgraded your Firefox, etc.Read more »

Tuesday, 20 November 2012

How to compress png files on Linux

PNG (short for "Portable Network Graphics") is a raster image format designed to replace limitations of GIF image format in terms of data compression and color precision. The size of a PNG image file can vary significantly based on several factors including color depth, interlacing, precompression filter, compressor used, etc. If you would like to compress a PNG image file losslessly on Linux, read on.Read more »

Monday, 19 November 2012

What are popular packet sniffers on Linux?

A packet sniffer captures live packets from networks, decodes them according to protocol specifications, and optionally takes actions according to the parsed packet contents (e.g., in case of security detection systems). It is a very useful tool to diagnose networks or protect against security attacks over networks. The following are several popular open-source packet sniffers available on Linux.Read more »

Friday, 16 November 2012

How to install httptunnel on Linux

Httptunnel is a GNU/GPL-licensed free software that allows one to create a bi-directional tunnel encapsulated by HTTP, between client and server. HTTP-encapsulated tunnels are useful when you want to use games, IM clients, or P2P sharing applications across restrictive firewalls or proxies which tend to block pretty much everything except well known traffic such as HTTP traffic. Httptunnel consists of hts (server) and htc (client) components to establish HTTP tunnels in between.Read more »

Thursday, 15 November 2012

What are available iptables management tools with GUI?

Netfilter is a packet filtering system within the Linux kernel used for intercepting and processing network packets. Iptables is a user-space program that relies on netfilter to implement stateless/stateful packet filtering for network firewalls, and address/port translation for NATs. There are many applications and tools that ease complex iptables management tasks with convenient graphical front-ends. Here are some of those iptables management tools with GUI.Read more »

Wednesday, 14 November 2012

How to upload photos to Flickr on Linux

If you are a Linuxer who is also a passionate photographer, you will probably have a Flickr account, and want to know about how to manage your photos in your Flickr account on your Linux computer. While any web browser can be used to access your Flicker account on the web, it probably cannot beat a dedicated Flickr client software with streamlined user interface and pre-configured authentication. Here I will focus on how to upload photos to Flickr using dedicated Flickr client for Linux.Read more »

Tuesday, 13 November 2012

How to force login password prompt in single user mode

Linux provides so-called "single user mode" or "rescue mode" in which a multi-user Linux system boots into a single user with superuser privilege. The single user mode is useful when you need exclusive access to shared system resources, e.g., when conducting maintenance or security audit of root file system, and updating critical system settings such as resetting root passwords.Read more »

Monday, 12 November 2012

How to ping a specific port of a remote host

Ping is a networking utility used to test the reachability and round-trip time (RTT) delay of a remote host over Internet Protocol (IP). Ping utility does so by sending out a series of Internet Control Message Protocol (ICMP) echo request packets to a remote host, and waiting for corresponding ICMP response packets from the host. However, you cannot ping a specific port because ICMP belongs to layer-2 IP layer, not layer-3 transport layer (e.g., TCP/UDP). In order to ping a specific port of a remote host, you need to use layer-3 transport protocols which have a notion of port numbers.Read more »

Friday, 9 November 2012

How to run fdisk in non-interactive batch mode

Fdisk is a command-line utility for disk partition management on computer operating systems including Linux. It's not common that you want to automate fdisk (i.e., running fdisk in a batch mode), since (re)-partitioning your system is a rare thing, and you are typically dealing with a very small number of partitions at once. However, if you are trying to automate virtual machine (VM) provisioning, partitioning and formatting (VM's hard drives) in batch mode may no longer be so unrealistic.Read more »

Thursday, 8 November 2012

How to install software packages in non-interactive batch mode on Debian/Ubuntu

If you are a system admin, you may have wondered how to install a list of software packages in one shot. Manually installing software programs on multiple Linux systems would be a tedious job, and your time can be better spent elsewhere. If you seek to install software packages in non-interactive batch mode, you can check out this guideline. This is for Debian/Ubuntu systems.Read more »

Wednesday, 7 November 2012

How to install VMware Player on Ubuntu Desktop

VMware Player is a closed-source multi-platform virtualization software that is freely distributed by VMware. VMware Player has a convenient graphical user interface for virtual machine (VM) management, and with built-in NAT/bridged networking, there is no hassle in configuring VM networking, unlike other hypervisors such as KVM and Xen. Installing VMware Player on Ubuntu Desktop is straightforward, except that there are some caveats to take care of, which will be described in the following.Read more »

Tuesday, 6 November 2012

How to install tcpreplay on Linux

Tcpreplay is a suite of command-line utilities that are used to "replay" previously captured packet dumps in a real network. In order to use tcpreplay, you first need to capture live network traffic using packet capture tools such as tcpdump, rewrite TCP/IP packet headers of the captured packets appropriately (usually MAC and IP addresses), and then re-inject the packets on to any arbitrary network under consideration.Read more »

Monday, 5 November 2012

How to build a custom kernel module or device driver for XenServer

Citrix allows one to build any custom kernel module or hardware driver for XenServer, by offering Driver Development Kit (DDK). A DDK is essentially a virtual machine with all the kernel headers and development tools needed to extend the XenServer kernel. The following guide is on how to use DDK to compile a custom kernel module or hardware driver for XenServer.Read more »

Friday, 2 November 2012

How to find recently modified files on Linux

There are various occasions where you would like to search for files that have been changed/created in your Linux system recently or within any time frame. For example, as a system admin, you have done some configuration on your Linux system, but forgot where it was saved. You want to verify whether/how your Linux file system has been tampered with by someone recently. If you would like to find recently updated files on Linux, you can use find command as follows.Read more »

Thursday, 1 November 2012

How to enable Korean language input keyboard on Ubuntu

If you would like to use foreign language input on Ubuntu, there are two ways to enable foreign language input. One method is using Smart Common Input Method platform (SCIM), and the other one is to use Intelligent Input Bus (iBus).Read more »

Wednesday, 31 October 2012

How to set up QoS bandwidth rate limit on Vyatta router

If you are running a network shared by multiple devices, you probably want to set up QoS policies (e.g., average bandwidth rate, burst size), so that network bandwidth is properly shared by them. Vyatta software router supports powerful QoS settings. You can easily define any QoS policy, and bind the policy to a specific network interface/port, or to specific types of traffic, etc.Read more »

Tuesday, 30 October 2012

How to benchmark virtual machines

When you are comparing various hypervisors, you may want to compare the performance of virtual machines (VMs) running on different hypervisors. Also, if you are comparing various public cloud providers, you will want to benchmark VMs offered by available providers. Whatever the reason may be, it is useful to know how to benchmark VMs properly.Read more »

Monday, 29 October 2012

How to check openvswitch version

Open vSwitch (OVS) is an open-source virtual switch, featuring programmable switch forwarding capability. The forwarding plane of OVS can be dynamically controlled by an external network controller, such as OpenFlow controller, which enables key innovation called software-defined networking in large-scale virtual environments.Read more »

Friday, 26 October 2012

How to find a rogue DHCP server

If your company has a large corporate network shared by many employees, you may have encountered the case where your host machine is getting an IP address assigned by some unknown DHCP server not under the administrative control of the corporate network, which in turn causes various connectivity issues for your host. When a host machine is trying obtain an IP address via DHCP, it accepts whichever DHCP offer message arrives first. Hence, if a rogue DHCP server is interfering with a legitimate DHCP server by sending out DHCP offers of its own, it can cause various networking related problems for connected hosts by supplying them with unreachable default gateway, private IP addresses, bogus DNS resolver, etc.Read more »

Thursday, 25 October 2012

How to find the IP address of a DHCP server

When a network interface set up for DHCP is being enabled, a host machine broadcasts DHCP discovery message to discover available DHCP servers on the network. Once the host has received a DHCP offer message from any DHCP server, it then sends a DHCP request message to the DHCP server to finalize the lease of an IP address.Read more »

Wednesday, 24 October 2012

/etc/hosts vs. /etc/resolv.conf

When an application performs DNS lookup as part of its operations on Linux, it can leverage both /etc/hosts and /etc/resolv.conf configuration files to resolve DNS names. How these configuration files are used for DNS lookup can vary among different applications, complicating system administration. But Linux libc library and the GNU C Library (glibc) provides a clean solution to this problem, by defining DNS lookup orders with Name Service Switch (NSS). NSS defines a set of databases and their lookup order in NSS configuration file (/etc/nsswitch.conf in Linux). Applications built with those libraries will then perform DNS lookups in a consistent manner.Read more »

Tuesday, 23 October 2012

How to set up QoS bandwidth rate limit on XenServer VM's network interfaces

In a multi-tenant VM environment, you would need to allocate network bandwidth appropriately to all existing tenants/VMs, such that no one can consume available network resources by himeself/herself. Even in a single-user environment, you may want to define QoS policies for your VM (such as per-interface bandwidth caps) for various reasons. If you are using XenServer as your hypervisor, XenServer actually allows you to rate limit outgoing traffic of VM's virtual interfaces. If you would like to set up QoS bandwidth rate limit on XenServer VM's network interfaces, follow the instructions here.Read more »

Monday, 22 October 2012

How to backup a MySQL server

If you are running a MySQL server with critical information in its databases, you may want to back up the databases periodically. A Linux command-line tool called mysqldump allows you to back up MySQL databases without needing to shut down a MySQL server. mysqldump generates as output a text file containing a series of MySQL commands that represent a current snapshot of MySQL databases being backed up. The mysqldump output file can easily be compressed and/or encrypted as needed. The following is how to backup a MySQL server with mysqldump.Read more »

Friday, 19 October 2012

How to apply a XenServer update patch

Citrix distributes patches or hotfixes of XenServer on a regular basis, for fixing bugs or updating security features. A XenServer patch may have dependency on other fixes, in which case you will fail to install the patch without applying all dependent fixes first. If you would like to apply a patch on your XenServer host, you can use either XenCenter client software or XenServer command line interface (CLI). Here I will focus on using XenServer CLI to install XenServer patches.Read more »

Thursday, 18 October 2012

How to install OpenStack on multiple nodes

OpenStack is an open-source cloud management software that one can use to enable Infrastructure as a Service (IaaS) offerings. With major IT powerhouses such as HP, AT&T, IBM backing OpenStack, and a large pool of OpenStack developers contributing code to the project daily, OpenStack is fast becoming a de facto cloud standard. If you want to see OpenStack in action, it's a good idea to install it yourself on a small scale (preferrably at least two nodes).Read more »

Wednesday, 17 October 2012

How to plot using specific rows of data file with Gnuplot

In many cases you probably want to filter a raw data file in various fashions before plotting the data with Gnuplot. In some cases, you may want to use only specific rows (e.g., from line 10 to 100) of a data file in your plot. With Gnuplot, you can specify a range of data to be plotted in two different ways.Read more »

Tuesday, 16 October 2012

How to disable xsconsole autorun in XenServer

Although XenServer's management interface (i.e., xsconsole) is a security protection against XenServer getting tampered with by an unauthenticated user, auto-running xsconsole may be cumbersome for you in certain situations. For example, if you are configuring and testing things out inside the XenServer's local command shell, you probably are not happy with the situation where your command shell is automatically terminated and replaced by xsconsole after some period of inactivity, and you have to re-authenticate against xsconsole to open a new command shell.Read more »

Monday, 15 October 2012

How to set up a DHCP server using dnsmasq

If you are trying to set up a small private network in your home or company, you probably want to set up an internal DHCP/DNS server for your network. Dnsmasq comes in handy in that situation. Dnsmasq is a free lightweight DHCP server for Linux that can serve a small-scale network. It supports static/dynamic DHCP leases and has DNS proxy functionality built in.Read more »

Friday, 12 October 2012

How to launch VMware Player VMs without GUI

If you are a user of VMware Player, you may have wondered whether it's possible to run VMware player without GUI. For example, when you are accessing VMware hosts via SSH remotely, you may want to run VMware Player in shell mode. While you can use X11 forwarding over SSH to launch VMware player's GUI from remote locations, it will be rather inconvenient if the SSH connection is slow. Furthermore, the VM launched inside VMware Player's GUI window will automatically be stopped when you close the VMware Player window.Read more »

Thursday, 11 October 2012

How to enable SSH with ESXi 3.5

ESX is a well-known bare metal hypervisor from VMware that runs directly on a host machine without underlying operating system support. ESXi is a free version of ESX, and while ESXi has a less number of features than ESX, the free hypervisor is good enough for various experimental purposes. In particular, ESXi 3.5 is a 32-bit hypervisor that can be installed on 32-bit processors. Most existing hypervisors such as Xen, XenServer, KVM, ESX/ESXi 4.* are all 64-bit hypervisors requiring 64-bit processors.Read more »

Wednesday, 10 October 2012

How to set up DHCP and NAT on Vyatta router

Vyatta is a feature-rich enterprise class software router. You can download a free community version of Vyatta as well. Vyatta router can easily be built on a physical machine via a well-packaged LiveCD, or on a VMware/Xen VM via ready-made virtual appliance. As a ready-made software router, Vyatta can be configured extremely easily as a NAT gateway with DHCP, DNS and NAT functionality.Read more »

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 »

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 »

How to compile the Linux kernel on Debian or Ubuntu

Reasons why you want to build a custom Linux kernel are numerous. For example, you may want to add driver support for devices which are not recognized by the generic kernel shipped with Linux distros. You may want to optimize the kernel for your hardware, tweak performance tuning options, or turn on or off specific kernel options that cannot modified at run time. If you would like to compile the Linux kernel for any of these reasons, follow these instructions on compiling the Linux kernel on Debian or Ubuntu.Read more »

Saturday, 9 June 2012

How to convert TIFF files to PDF format on Linux

TIFF (Tagged Image File Format) is a popular image file format. Unlike other types of image files, a TIFF file can contain multiple images (e.g., multi-page document scan) in it. TIFF editor software such as GIMP is able to support such multi-page TIFF files. If you would like to convert a TIFF file to PDF format on Linux, you can follow the instructions below.Read more »

Friday, 8 June 2012

How to reboot automatically after kernel panic

There are cases where you encounter kernel panic. Kernel panic may occur while you are playing with some experimental kernel module that someone else wrote, or developing a custom kernel module yourself. Kernel panic can happen due to hardware failure as well. If you would like to reboot your system automatically after kernel panic has occurred, there are three different ways to do it.Read more »

How to convert xlsx files to xls or csv format on Linux

The xlsx file name extension is a new file format based on XML, used by Microsoft Office Excel 2007 spreadsheet application. The letter "x" appended to the existing "xls" extension used by earlier versions of Excel, signifies that the format is based on XML. If you would like to open or edit an xlsx file created by Excel 2007, on an earlier version of Excel or any other spreadsheet application, you need to convert xlsx files first.Read more »

How to allow remote access to MySQL server

If you have installed MySQL fresh (e.g., "sudo apt-get install mysql-server" on Debian/Ubuntu, and "sudo yum install mysql-server mysql" on CentOS/Fedora/RedHat), MySQL server binds on local loopback address (i.e., 127.0.0.1) by default. This means that you can access MySQL server only from the local host, but not from any remote host. You can verify this by running netstat as follows.Read more »

Saturday, 2 June 2012

How to edit a PDF file for free

pdftk (PDF Toolkit) is a command-line tool which enables you to edit PDF files. pdftk is freely available on Linux, MS Windows, MacOS X and FreeBSD. So using pdftk, you can edit PDF files for free. If you would like to install pdftk on Linux, proceed as follows.Read more »

How to mount HDFS using FUSE

Hadoop Distributed File System (HDFS) is a distributed, scalable filesystem developed as the back-end storage for data-intensive Hadoop applications. As such, HDFS was designed to handle very large files with "write-once-read-many" access model. Not being a full-fledged POSIX compliant filesystem, HDFS cannot be directly mounted by the operating system, and file accesses with HDFS are done via HDFS shell commands.Read more »

How to install SSH on Linux

Secure shell (SSH) is a network prototol providing shell services on a remote machine via a secure channel. OpenSSH is an open-source implementation of the SSH protocol, allowing encrypted communication over a network via a suite of software. If you would like to set up SSH on Linux, you can install OpenSSH as follows.Read more »

Friday, 1 June 2012

How to install GNOME desktop on CentOS

Suppose you have set up a "minimal" version of CentOS without X-windows on your machine before. Now you wish to install GNOME desktop on the CentOS system in order to run some desktop applications. If you would like to add GNOME desktop to CentOS minimal installation, you can do the following.Read more »

How to add an additional hard drive to Xen VM

There are cases where you would like to add an additional disk to a Xen guest VM, and make the newly added storage available to the VM. In order to add an additional hard drive to Xen VM, do the following.Read more »

How to disable SELinux

Security-Enhanced Linux (SELinux) is a set of kernel enhancements and user-space tools to enforce mandatory access control and security policies. When SELinux is enabled on your system, there may be cases where you would like to turn off SELinux temporarily, for example when you are experimenting with Apache or NFS server, and SELinux gets in the way, blocking necessary port access.Read more »

How to find and kill zombie processes on Linux

A process is called a zombie process if the process has been completed, but its PID and process entry remains in the Linux process table. A process is removed from the process table when the process is completed, and its parent process reads the completed process' exit status by using the wait() system call. If a parent process fails to call wait() for whatever reason, its child process will be left in the process table, becoming a zombie.Read more »

How to find the number of CPU cores on Linux

Multi-core CPU processors are common nowadays, including dual-core processors (e.g., Intel Core Duo), quad-core processors (e.g., Intel Core i5), and hexa-core processors (e.g., AMD Phenom II X6). Also, many server-grade physical machines are equipped with more than one CPU processor. In order to find the number CPUs, and the number of cores per CPU, you can refer to /proc/cpuinfo.Read more »

Thursday, 31 May 2012

How to install dos2unix on Linux

DOS-based text files use a pair of carriage return (CR) and line feed (LF) as a new-line delimiter. On the other hand, UNIX-based text files simply use LFs to terminate each line. In order to convert a text file from DOS format to UNIX format, you can install the following package.Read more »

How to change hostname without reboot on Linux

In order to change hostname on Linux, you need to update a configuration file containing hostname, and then let the kernel know that hostname has been changed. The latter step is needed since the kernel still remembers an old hostname until the next reboot. In order to change hostname without reboot, do the following.Read more »

How to install iftop on Linux

iftop is a command line tool that shows a list of active network connections between local host and any remote host, sorted by their bandwidth usage. The list of top-ranking network connections (in terms of bandwith usage) is periodically refreshed in a text-based user interface. Using iftop, you can visually check the bidirectional bandwidth usage of different network connections in real time. In order to install iftop on Linux, follow the instructions below.Read more »

How to check Linux version

Knowing which version of Linux kernel you are running is important because many software or libraries require certain kernel subsystems and features be available in order to run properly. Knowing the kernel version can also be helpful in diagnosing systems or debugging software problems.Read more »

Wednesday, 30 May 2012

How to add a static route permanently on Linux

A static route is defined by statically configuring a next-hop router IP address for a specific destination network. You can add a static route by using "route add" command. However, a static route so added is not persistent across reboots. If you would like to add a static route permanently on Linux, do the following. In this example, I assume that you wish to define a static route for network 10.10.0.0/16 via 10.10.5.5 on eth0.Read more »

How to install Google Chrome on Linux

Google Chrome is a free web browser based on WebKit layout rendering engine. Since its public release in 2008, Google Chrome has steadily grown its user base, and now it drives approximately one-third of all web browsing activities worldwide, largely thanks to its lightning fast speed and strong security protection. If you would like to install Google Chrome on Linux, you can follow these instructions below.Read more »

How to install Eclipse on Linux

Eclipse is a software development environment with extensible plug-ins, toolkits, and run-time libraries, supporting development in Java as well as other languages such as C/C++ and PHP. In order to install Eclipse SDK on Linux, you can do the following.Read more »

Tuesday, 29 May 2012

How to set system-wide environment variables in Linux

In Linux, when a user logs in, login shell executes /etc/profile script. This script customizes environment variables system-widely for all users. Part of what /etc/profile script does is to source all .sh files placed in /etc/profile.d directory. Therefore, in order to set system-wide environment variables in Linux, you can create a custom file with .sh extension in /etc/profile.d as follows.Read more »

Monday, 28 May 2012

How to run iptables automatically after reboot on Debian

If you have customized iptables rules, and would like to load the customized iptables rules persistently across reboots on Debian, you can leverage if-up.d scripts that are located in /etc/network/if-up.d. On Debian, any script that is marked as executable and placed in /etc/network/if-up.d is executed when a network interface is brought up.Read more »

How to configure network interfaces in CentOS

In Red Hat Enterprise or CentOS Linux, you configure network interfaces by using configuration files located in /etc/sysconfig/network-scripts/. For each network interface (e.g., eth0), there should be a corresponding configuration file (e.g., ifcfg-eth0) in the directory. If you would like to enable and configure a network interface, do the following.Read more »

How to log in to system VMs in CloudStack

In CloudStack, there are two system VMs (Console Proxy VM and Secondary Storage VM) that are automatically created by CloudStack for each zone. Console Proxy VM (CPVM) provides console access to tenant's guest VMs, while Secondary Storage VM (SSVM) downloads and maintains VM templates used by tenants. While setting up CloudStack, you may experience problems with either of the system VMs.Read more »

How to install Perl modules from CPAN

Perl has a mechanism to import Perl modules which are external software libraries written in Perl. The CPAN is a public repository of a number of useful Perl modules contributed by Perl developers worldwide. Since the number of core Perl modules that come with Perl is rather small, you often need to search CPAN and install external Perl modules from CPAN. Read more »

Sunday, 27 May 2012

How to convert MTS to MP4 for free

My 3-year old camcorder is Canon Vixia HF100. It delivers excellent quality videos via optically stabilized 12X zoom lens. One caveat of the camcorder, however, is that video files are saved in AVCHD format, which is a HD video format developed by Sony and Panasonic. AVCHD videos typically have .mts or .m2ts file extensions. Read more »

How to install HDFS and Hadoop using CDH3

Cloudera's Distribution (CDH) provides streamlined installation of Apache Hadoop via Cloudera Manager. Besides Apache Hadoop, CDH also allows installation of other components such as Hive, Pig, HBase, ZooKeeper, etc. in a modular fashion. The free edition of CDH Manager allows you to build and monitor a Hadoop cluster consisting of up to 50 nodes. Read more »

Friday, 25 May 2012

How to install and configure Tinc-VPN on Linux

tinc is an open-source VPN software with a number of powerful features not found in other VPN solutions.  For example, tinc allows peers behind NAT to communicate with one another via VPN directly, not through a third party.  Other features include full IPv6 support and path MTU discovery.Read more »

Tuesday, 22 May 2012

How to set up a NFS server on XenServer

Suppose you would like to set up a NFS server on your XenServer-running host for whatever reason, so that other hosts can mount a NFS share exported by the XenServer host.Read more »

Friday, 18 May 2012

Wednesday, 16 May 2012

How to install CentOS in text mode

By default, CentOS provides a graphical user interface for installation. Sometimes such rich interface would be inconvenient when you are installing CentOS on a VM through slow VMware console. If you would like to install CentOS without GUI, do the following to enable text mode installation.Read more »

Friday, 11 May 2012

How to install additional packages in XenServer

I noticed that the default repository maintained by Citrix for XenServer is virtually useless. Read more »

Wednesday, 9 May 2012

How to install Maven on CentOS

Apache Maven is a project management software, managing building, reporting and documentation of a Java  development project. In order to install and configure Apache Maven on CentOS, follow these steps.Read more »

Tuesday, 8 May 2012

How to install Java 1.6 in Linux

On Debian platform, Sun's Java is available via the non-free repository. If you would like to install Java JRE or JDK on Debian Linux, do the following.Read more »

Friday, 4 May 2012

How to reset root password in MySQL

If you forgot the root password in MySQL, and would like to reset it, do the following as root.  In this example, replace "NewPassword" with your own password.Read more »

Saturday, 28 April 2012

How to use high-resolution gettimeofday in Perl

In order to use microsecond-resolution time (e.g., gettimeofday) in Perl, you first need to install Time::HiRes CPAN module.Read more »

Wednesday, 25 April 2012

How to enable ssh login without entering password

Assume that you are a user "a" on host A, and wish to ssh to hostB as user "b" without entering its password.  Do the following while logged in as user "a" on hostA.Read more »

Tuesday, 24 April 2012

How to reload sysctl.conf

Linux provides a sysctl interface for checking and modifying kernel parameters which are listed under /proc/sys directory. You can persistently set those kernel parameters via /etc/sysctl.conf. Read more »

Friday, 20 April 2012

How to install OpenVPN on CentOS/Redhat

In order to install OpenVPN on CentOS/Redhat, you first need to set up a RPMforge repository which contains many additional software tools in rpm package format for these distributions.Read more »

Wednesday, 18 April 2012

Friday, 13 April 2012

How to set up a PPTP VPN connection between Linux and Windows XP

Point-to-Point Tunneling Protocol (PPTP) is a VPN tunneling protocol based on a client and server model. Microsoft Windows comes with a built-in PPTP client software, and so PPTP VPN is popular among Windows-running computers. PPTP server and client software is also available on Linux platform.Read more »

Friday, 6 April 2012

How to convert ps/eps file into jpg image file

You can use gs to convert a ps or eps file into a jpg image file in Debian/Ubuntu.Read more »

Tuesday, 3 April 2012

How to use git behind proxy on Ubuntu

The following fix has been confirmed to work on Ubuntu server 11.04 and 11.10.Read more »

Thursday, 29 March 2012

How to detect IP address conflicts in Linux

IP addresses are a scarce resource that is shared by different users and devices. Having an IP address conflict means that there are more than one network device or computer that claims the same IP address. IP address conflict may occur when a DHCP server has assigned an IP address to one computer, and the same IP address happens to be statically assigned to another network device by someone. Read more »

Friday, 23 March 2012

How to set a default route persistently in Linux

If you have more than one network interface, you have to designate one network interface as the default route. In order to set a default route persistently in Linux, you can do the following. I assume that there are two interfaces: eth0 & eth1, and that you wish to use eth0 as the default route.Read more »

Friday, 16 March 2012

How to mount CD-ROM drive in Linux

In order to use CD-ROM/DVD drive in Linux, you first need to mount it. I will describe below how to mount CD-ROM/DVD drive in Linux.Read more »

Thursday, 23 February 2012

How to load a kernel module at boot time

Loadable kernel modules are a convenient way to modify the running kernel without rebuilding the kernel from scratch. One can also free up memory resources by unloading any unnecessary kernel module. A kernel module can be loaded or unloaded on the fly by the modprobe command. When loading a kernel module with modprobe, the command will also load any prerequisite module(s) automatically. Read more »

Friday, 3 February 2012

How to migrate SVN repository

Subversion (SVN) is a version control system, maintaining versions for files and directories. SVN uses FSFS (Fast Secure File System) as the backend storage to store revision histories. Read more »

Tuesday, 31 January 2012

How to add an additional vif to VM in XenServer

Assume that you know the name-label of the VM.

1) create a network for the new interface to be attached to, and returns the network-uuid Read more »

Sunday, 15 January 2012

How to clone a VM in VMware Server 2.0

When you need to create multiple VMs with vanilla Linux installed, cloning an existing VM saves you time with installation and configuration of new VMs. If you are using VMware Workstation, VM cloning process is streamlined with a built-in Clone Virtual Machine Wizard. However, if you are using VMware Server, it does not have such functionality, and you need to clone VMs manually. In order to clone a VM in VMware Server 2.0, you can follow these step-by-step instructions.Read more »