Articles in Commands & Shells
Improving WordPress Performance
WordPress is a great blogging engine and decent CMS. Unfortunately, most available WordPress themes- even those claiming to be “minimalist” – are bloated and slow to load. Heavy CSS stylesheets, multiple Java scripts, numerous graphics …
Use Perl inside Shell scripts
Perl is a far more powerful programming tool than any shell script. Sometimes you want to borrow some of that power without having to rewrite your entire shell script. There is an easy way to integrate Perl snippets inside your shell script.
Installing and Configuring Ganglia
Ganglia is a distributed performance monitoring application used primarily for tracking status of high-performance compute (HPC) clusters. Ganglia is a royal pain in the ass to install and configure even for a seasoned Unix sysadmin. …
Log Monitoring with Swatch
Swatch is a Perl-based log monitoring tool that can match regular expressions and perform automated actions. The tool is useful for monitoring system log files in real time with an option to run external commands …
Linux User Activity Management
The following is a detailed look into managing Linux users and the system resources they utilize. Disabling user access; halting, killing, and re-nicing user processes; controlling disk space allocation are all points covered by this …
Korn Shell Arrays
Here are a few useful examples of how to use data arrays within Korn shell. Arrays are a great tool for storing user input and other data for quick, on-the-fly access. If, for example, you …
A simple text string search script
Sometimes you need to locate a text string in various configuration files. You don’t know which files. You can just use “grep *”, but the output is rather messy and you can only search in …
Contacting the sysadmin from command line
If you are a sysadmin, communicating with your users is an important aspect of your job. Phone, e-mail, SMS, and various service request systems are commonly used by most businesses. The problem with all these …
Changing time
Unix systems record several time parameters associated with files. Sometimes you might need to set time parameters on a file to a particular value. Or you might need to modify a file without changing any …
CUPS printing on Solaris 10
Download the Companion CD for Solaris 10 GA on: Solaris 10 Companion cd download
Generating complex SQL queries with shell scripts
It is sometimes necessary to use complex select and insert queries with dozens of variables. Writing such queries by hand is a tedious process and the chance of making a mistake is high. A few …
NFS-mount “Permission denied” error
NFS is a relatively uncomplicated functionality of any Unix system. However, from time to time you are bound to run in the “permission denied” error while trying to NFS-mount a filesystem. Everything seems to be …
Wget Google image collector
Google Images is an extremely useful tool for webmasters, designers, editors, and just about anybody else who’s in a hurry to find just the right photo or clipart. However, this Google tool has a couple …
Using pkg-get on Solaris
Pkg-get Installation Notes
Pkg-get is an open-source, Sun-approved software installation and management tool for Sun Solaris. You can use pkg-get to install a variety of pre-compiled software without having to worry about version compatibility, patch requirements, …
Exporting spreadsheet data to MySQL
The following is a process for migrating spreadsheet data to MySQL database using a Shell script in a Unix environment. To follow this tutorial you must already know how to create MySQL schemas and tables. …
Cygwin X-server configuration
To connect with Cygwin to a Unix X-server in XDMCP-broadcast mode, create a shortcut as shown below. In the target field enter:
Handling errors and trapping system calls
In the course of writing a shell script it is important to consider possible error and unexpected interrupts. Let’s say you wrote an interactive script that allows users to archive old files to free up …
Passing shell variables to awk and sed
By default awk and sed do not expand shell or system variables and do not pass their own variables back to the shell. To use shell variables awk and sed statements must be included in …
Solaris performance monitoring
The following is a brief overview of common performance monitoring tools for Solaris, including built-in tools, freeware add-ons, and commercial applications.
Souce: http://www.sunperf.com/perfmontools.html
Built-in Tools
vmstat
The vm in vmstat stands for Virtual Memory, of course. So let us …
Wget examples and scripts
Wget is a command-line Web browser for Unix and Windows. Wget can download Web pages and files; it can submit form data and follow links; it can mirror entire Web sites and make local copies. …
Create boot block on Solaris disk
To make a Solaris disk bootable you need to install the boot block on the disk. This should be done, for example, after copying the primary boot disk to the secondary disk.

Latest Comments