Home » Downloads

Downloads

Here’s a small collection of system administration-related scripts found throughout this site. Some people ran into problems trying to copy-paste code, so this should make things a bit easier. The list below has links to compressed scripts (zip), a brief description of the script, and a link to the related post that describes the script in greater detail.

Bounce Veritas HA resource
The following is a Korn shell script that can be used from command line or cron to bounce a Veritas HA Cluster resource. This can be useful to resolve certain problems with Oracle databases running under VHA Cluster… (more)

 

Kill a process that exceeded allowable CPU utilization threshold
Let’s say there is a process on your Unix/Linux system that sometimes tends to consume all CPU resources and become unresponsive. At the same time, you do not want to terminate the process at the first sign of trouble, because momentary high CPU utilization may be legitimate. The solution is to continuously calculate the running average of CPU utilization… (more)

 

MySQL string search-and-replace script
A day will eventually come when your need to find and replace a string of text in your database. You don’t know which row, or which column, or which table. Heck, you may not even know which database. Your options are: spend the rest of the summer hunting down the elusive table cells, or use the weapon of mass replacement described below.. (more)

 

Increase file size upload limit in PHP/WordPress
By default, WordPress will not allow you to upload a file larger than 2Mb. This limit is not set by WordPress itself, but by detaul PHP configuration. This configuration file is usually /etc/php.ini, but normally your Web hosting provider will not let you modify this file. Below is a possible fix you can try… (more)

 

Restart MySQL and Apache when running low on memory
Heavy traffic, hungry SQL queries, leaky applications will eventually leave your server low on memory. Apache will go on a hunt for swap space and MySQL will start freezing in thoughtful contemplation. Your hard drives will start scratching like a pack of homeless dogs and suddenly everything will become very very s l o w w w… (more)

 

Duplicate Solaris boot disk using dd
The following Korn shell script will make a bootable copy of the boot disk on a Solaris system. The script uses dd and requires that the source disk and destination disk have the same geometry… (more)

 

Duplicate Solaris boot disk using ufsdump/ufsrestore
The following script will duplicate a Solaris boot disk. The script uses ufsdump/restore as opposed to dd, so disks of different sizes can be used… (more)

 

Modify Veritas HA resource configuration
The following interactive Korn shell script can be used to make common changes to the configuration of Veritas HA Cluster resources. The script enables you to view the listing of available resources; view resource configuration; online and offline resources; modify several parameters in resource configuration… (more)

 

Calculate Veritas NetBackup statistics for each client
The following script will calculate total size of data backups for each Veritas NetBackup client over the past week (or as defined by the “daysago” variable in the script). The final output will be uploaded to a Web server. The output format is: clientname,backup_size_Gb… (more)

 

Backup WordPress installation
Whenever a new WordPress version comes out, I get an itch to upgrade as quickly as possible. Generally, this is not a good idea, unless you enjoy working out new software bugs and dealing with broken plugins. Still, sooner or later you still have to upgrade and there is always a chance that something will go terribly wrong. You always need to make a backup… (more)

 

Duplicate WordPress installation
Whenever you upgrade your WordPress installation or do development work, it is always a good idea to be working on a copy of your main site and not on the real thing. Copying WordPress installation is not exactly difficult, but it is a bit tedious, which is the reason why many Webmasters apply changes directly to the production site and hope for the best… (more)

 

 

Treex
This is a simple script that will produce a listing of first-level subfolders in the directory of your choice and their sizes. For example, if /home is out of space, this script will show you how much space is consumed by data in each subfolder. The script is clever enough to stay on local filesystems and not to cross mountpoints…. (more)

 

 

Diskhog

Once you narrowed down the offending directory with the treex script, you can use the diskhog script to identify the largest files that may be good candidates for compression or archival. Similarly to treex,diskhog will stay on local filesystems and will not cross mountpoints… (more)

Print Friendly, PDF & Email