script

MySQL Shell scripts - Start a MySQL server and client on a non-standard port

MySQL shell scripts and port FAQ: Can you share some MySQL examples that show how to start MySQL on a non-standard port (non default port)?

For a variety of reasons you may want or need to run your MySQL server on a different port than the default MySQL port of 3306. In those cases the easiest thing you can do is create a Unix/Linux shell script to start your MySQL server on some other port.

Unix/Linux shell script reference page

Linux shell script test syntax

All of the shell script tests that follow should be performed between the bracket characters [ and ], like this:

if [ true ]
then
  # do something here
fi

Very important: Make sure you leave spaces around the bracket characters.

I'll show more detailed tests as we go along.

To perform tests on files use the following comparison operators:

A Perl script to convert Nagios/Unix epoch time to a human readable format

I had to work with Nagios a lot this morning, in particular reading through the nagios.log log file. If you're ever read that log file, or looked at some other Linux/Unix log files, you've seen records that display the time in an epoch time format, which looks like this:

1219822177

If you can read the epoch time format and know the actual human readable date and time, you're a better person than I am (or you've been looking at Nagios, Linux, or Unix log files too long).

Debug Ant build problems with echo statements

Ant FAQ: How to use echo commands to debug Ant build scripts.

I've been moving back and forth between a ton of different computers lately -- Mac, Linux, and Windows computers -- and I had some problems with an Ant build script. This particular Ant script is complex, and I kept making mistakes, and needed a good way to debug the build process as I set up my application on these different systems.

A Bourne shell script that loops through all files

Linux shell script for loop FAQ: Can you share an example of a Linux shell script for loop, for instance, to do something for every file in the current directory?

Here's a shell script that you'll find on all the Unix, Linux, and Mac OS X computers I've worked on. The general process of this script is "for every file in the current directory do XYZ".

Ant WAR task - A sample Ant build script that builds a WAR file

You'll probably have to know a little bit about Java, Ant, and build files for this sample build.xml file to be any use to you, but if you're looking for a sample Ant build script that can be used to create a war file, or one that simple uses a war task, this example might work for you.

I'm not going to provide any explanation of any of this right now, but if I have time in the future I'll come back here and add a few comments about how this build script works.

Syndicate content