≡ Menu

July 2010

You might find the following three Linux / Unix shell scripts helpful. Display processes based on either %CPU or Memory Usage. Display which user is utilizing the CPU the most. Display system’s memory information – total, used and free. 1. List Processes based on %CPU and Memory Usage This script list the processes based on [...]

{ 6 comments }

Unix Shell Script to Execute Oracle SQL Query

Question: Can you provide me a shell script that will accept oracle credentials, sql query to be executed and displays the output? Answer: The shell script given below prompts some basic information and displays the output of the SQL. You can use the same concept and hard-code some of these values in the shell-script itself [...]

{ 8 comments }

Log Effectively Using Custom Perl Logger Module

For any custom written user services and processes, you should maintain a log file to view the status of the service, or to troubleshoot any issues with the services/processes. Perl CPAN offers few modules which provides the automated object interface for handling logging for services. In this article, let us write our own Perl logger [...]

{ 1 comment }

Emacs Macro Tutorial: How to Record and Play

Using Emacs Macro feature you can record and play a sequence of actions inside the editor. This article explains how to perform record and play inside Emacs editor with an example. If you are a Vim editor fan, refer to our How to record and play inside Vim editor article. High Level Steps to Record [...]

{ 3 comments }

Three Sysadmin Rules You Can’t (And Shouldn’t) Break

When I drafted this article, I really came-up with 7 sysadmin habits. But, out of those 7 habits, three really stood out for me. While habits are good, sometimes rules might even be better, especially in the sysadmin world, when handling a production environment. Rule #1: Backup Everything ( and validate the backup regularly ) [...]

{ 67 comments }

In bash shell, when you use a dollar sign followed by a variable name, shell expands the variable with its value. This feature of shell is called parameter expansion. But parameter expansion has numerous other forms which allow you to expand a parameter and modify the value or substitute other values in the expansion process. [...]

{ 25 comments }

Question: While downloading using wget, I get the following error “Connecting to <URL>.. failed: Connection refused.”. I’m behind a proxy server. How do I fix it? Answer: Export the http_proxy variable with your proxy server name or ip address and then try downloading as explained below. Connection refused error while using wget If http_proxy environment [...]

{ 5 comments }

In this article, let us discuss about how to setup tftpboot, including installation of necessary packages, and tftpboot configurations. TFTP boot service is primarily used to perform OS installation on a remote machine for which you don’t have the physical access. In order to perform the OS installation successfully, there should be a way to [...]

{ 4 comments }