MackPexton.com

Resources

I post the following here as I consider them to be potential resources that might be of use to others. They are current projects and projects that have not gone out of date yet.

Installing Awstats for Multiple Web Sites on Debian Linux
Finding instructions on the web to install Awstats for multiple hosts on a Linux system is difficult. And Debian packages Awstats differently that the default installation available from awstats.org. I recently installed Awstats on a Debian Linux 7 (Wheezy) server hosting multiple web sites. These are my notes.
Myra Portal Maker
This has been a fun project over the last couple of years. I've been assembling open-source pieces and parts and a mixture of my own work into a portal system. Originally concieved as a secure way for employees to access their shared folders from the web (web logs automatically record everyones access to every file, VPNs do not), it has become an easy way for employees to provide remote access to files for their providers and suppliers. Employees can simply make folders and copy files to them and the portal software will dynamically build the web view. Pictures, even large pictures straight from a camera, are automatically sized and displayed in a gallery and as a slide show. Employees designated as editors can annotate folders, monitor uploads, and create documents. Documents are standard HTML files which can be edited "in place" over the web, or of course, by using your favorite HTML editor and copying them to the portal folder.
Sorry, there isn't a demo set up yet that the public can view, just some screenshots.
Punchclock
Punchclock is a drop-in enhancement to the Open Source PHP Timeclock software. It offers a couple of different entry screens — one for a central location and one for personal use on PC's or mobile browsers. It computes overtime, tracks timecards, and has a flexible export screen. Installation is very easy. You simply download the tar file and unpack it in the directory where the PHP Timeclock software is installed. That's it.

The demo and screen shots have been removed by request.

More development of PHP Timeclock and Punchclock can be found at https://github.com/andrew867/timeclock.

SirsiDynix - Embedding eLibrary into Your Website (download)
This is a copy of a wiki article I wrote for the Sirsi Users Group describing a methodology to wrap your web site around the SirsiDynix iBistro or eLibrary catalog software. By installing a couple of custom files and following this simple methodology you can make your library catalog look like it is an integral part of your web site. The custom files are hosted here as Sirsi did not allow them to be uploaded to their site.
Backup to USB Drive (download) (text)
This is a shell script that backs up your Linux system to USB drives. The drives are automatically mounted and dismounted if needed — you do not need to login to mount your usb drive — just unplug the current backup drive and plug in the next. A drive is considered to be a backup drive if it has a top level directory named "backup". The script can be viewed here. Update: I recently added a USB3 board to one of my servers and had to modify the script to tolerate extra conditions to operate more reliably.
Archive File
The archive_file script is my oldest script and I still use it every day. It is great tool for Linux/Unix sys admins who alter system files and want to track their changes (and cover their butt). It is a simple Bash script that can be used for individual archives or archives shared among Unix/Linux groups. I usually install the script as soon as I have an account on a server. Version control systems like Subversion require a non-trivial setup, are not always available, and are used to post your changes to a repository after you change a file. I use archive_file to save the current version of a file just before I change the file so I can easily backtrack the changes I make to a system.

Javascript

imageMagnifier (javascript) (demo)
I have looked at several image magnifiers over the last couple of years and have ended up making one for myself. This magnifier like most uses a high-resolution image to show in a circular magnifier. The magnifier can be a circular magnifier and it can be turned on and off. The script is very flexible and can be used in many different scenarios. It's easy to retrofit existing web pages without altering the HTML code. There are several examples demonstrating its usage.
mTabify (javascript) (minified) (demo)
Believing that servers should produce only semantic HTML (just the facts, ma'am) and that layout decisions should be applied separately, and believing that the decision to display information in a tabbed format or not is a layout decision, I wrote mTabify to inject the necessary additional HTML into the document so the information can be displayed in a tabbed format. Written as a jQuery addon, simply select which panels are to be displayed in a tabbed format and specify the tab names, like: $('#div1,#div2,#div3').mTabify('Tab 1, Tab 2, Tab 3');. There are several options to mTabify including the ability to specify exactly where the tabs are to be located in the document, whether they should be before the panels, after the panels, or both before and after the panels as they are in this example.
Accordion Menu (javascript) (minified) (demo)
This accordion menu script is an adaptation to Marco van Hylckama Vlieg's (http://www.i-marco.nl/weblog/) nice and compact accordion menu. I modified it because his script uses the A tags in the HTML for his click handlers and I wanted to use *standard* HTML for the menus where the A tags are links to their own index pages and hovering over the menu items is what opens the sub-menus. My accordion menu script attaches the click handlers to the LI tags and leaves the A tags alone. I also enhanced the use of multi-level menus and the initial opening of the menus to their current selection. This annotated script shows the actual changes made to the original. Here is a demonstration. The script can also make a nice dropdown menu.
Freeze Header (javascript) (minified) (demo)
The freezeHeader jQuery extension freezes a header element as it scrolls out of view. It clones the header element and displays the clone at a fixed position over a scrolling region when the real header scrolls out of view. This demonstration shows what I mean.
Breadcrumbs (javascript)
Breadcrumbs is a small Javascript program that automatically constructs the breadcrumb links commonly seen across the top of web pages. The program looks at the current url and breaks the path out into links to the path components. The left-most component, unless specified in the options, is set to be the left-most component of the domain name, so if your url is http://example.domain.com/path/to/file.php, the left-most component is set to "example". The right-most component, if not specified in the options, is set to the page title as defined in the <title> tag.
Typewriter (javascript) (jQuery addon)
I have a typewriter function that types out text on a web page. Quite often, this is seen as a moving marquee, but this function can type any paragraph. It also can include HTML tags and links. The pauses before and after each typed character can be specified to make the typing appear more natural.

Timers

Here are three short Javascript programs that track time in some way.

Countdown (javascript)
Count down from an arbitrary number:
Elapsed Timer (javascript)
Show the elapsed time since the timer was started:
Flash (javascript)
Flash a document element for a brief period of time.
Top of page.