|

Sys Admin and The Perl
Journal CD-ROM version 12.0
Version 12.0 delivers every issue of Sys Admin from 1992 through 2006 and every
issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!
Order now! |
|
 |
|
 |
Updating a Public Calendar Automatically Randal L. Schwartz Schwartz whips up a little Perl magic for updating the public version of his activities.
Starting, Stopping, and Replacing Users' Cron Jobs John Spurgeon, Ed Schaefer John and Ed describe Bourne shell scripts for temporarily disabling and restoring a user's cron jobs.
Automating the Management of Network Devices through the Command-Line Alan Holt Holt describes how to automate the remote management of a domain of network devices using the Python programming language.
Export Behavior, Not Data Randal L. Schwartz Schwartz answers the question “how do I include a file?” and explains why the naive approach to this problem can sometimes cause trouble.
SortingHat — Which Server Do You Belong In? John Spurgeon, Ed Schaefer John and Ed describe the use of a Korn shell script called SortingHat for organizing files.
The Replacements Randal L. Schwartz Schwartz takes a look at the extremely useful substitute operation.
Miscellaneous Unix Tips: Answering Novice Shell Questions John Spurgeon, Ed Schaefer In this article, the authors cover a few of the novice questions they've fielded.
Distributing Software Modules Using rsync John Spurgeon, Ed Schaefer The authors provide a shell script for distributing software packages.
Codysseus: A Geek Travesty by Erudil Stephen B. Jenkins Our storyteller relates the tale of the mighty Codysseus and his beautiful and faithful wife, Perlelope.
Show Me Your References Randal L. Schwartz Schwartz reviews the standard forms of creating references and then using those references by dereferencing them.
Korn Shell Nuances Ed Schaefer, John Spurgeon We use the Korn shell almost exclusively. This month we'll investigate an eclectic mix of topics pertaining to the Korn shell and related shells:
How can you tell which shell you are using?
What happens if the shell isn't specified on the first line of a script?
Setting the environment variable PS1.
Writing Email Auto-Responders Hal Pomeranz Email auto-responders are a quick and easy way to extend the functionality of your email system. They can provide instant feedback for potential customers, help guide existing customers toward appropriate support resources, interface with CRM and helpdesk systems, and just generally alleviate a lot of grunt work that would otherwise have to be done by a human being. However, these programs typically run with elevated privileges so extreme care must be taken when implementing such a system.
Formatting Reports with Template Toolkit Randal L. Schwartz Recently, a Usenet posting (yes, I still read that) discussed using Perl to determine the disk block usage for various users on the system. Apparently, the poster had noticed a discrepancy between the number of blocks reported by du and the total blocks returned by summing Perl's -s function applied to each file. I replied that you can't use -s, because that's merely the length of the file, and thanks to sparse Unix files, the value wasn't necessarily the number of blocks used. Also, a large file consumes indirect blocks to locate the blocks as needed.
Processing User Input: Timeout Mechanisms Ed Schaefer, John Spurgeon Waiting for a user to respond to a program that is requesting input can be an issue. How do you provide a timeout mechanism in your shell scripts? In this column, we consider three methods. We touch on the read command's -t option; we discuss manipulating the terminal driver with the stty command; and we present our own script, called timeout_countdown, that can kill another process if the user doesn't respond within a certain amount of time.
Perl 6 is Coming! Randal L. Schwartz As I write this, I've just spent a week at Yet Another Perl Conference (North America) 2006, held this year in Chicago. This is the first YAPC I've been able to attend since 2001, because the intervening conferences have been either in Canada (inconvenient to attend) or during the week of a Geekcruise (with the cruises taking priority for me).
Processing User Input: Waiting for a Key Press Ed Schaefer, John Spurgeon Dealing with user input can be challenging. Should a program wait indefinitely for the user to respond? How do you design a shell script to time out after a specified period of time? In this article, we present a method for determining whether a program is waiting for user input. In a subsequent article, we'll discuss ways to implement a timeout feature in your shell scripts.
Practicing Best Perl Randal L. Schwartz Roughly a year ago, my friend Damian Conway published a hefty tome called Perl Best Practices. In it, he managed to gather 256 strongly suggested ideas and behaviors that had made his Perl hacking more successful for him and his customers over the years. As a reviewer on the book, I was happy enough with what I had seen to provide a quote that was eventually selected for the back cover:
As a manager of a large Perl project, I'd ensure that every member of my team has a copy of Perl Best Practices on their desk, and use it as the basis for an in-house guide.
Converting Dates to Week Dates Ed Schaefer, John Spurgeon Dates are often identified by a year, a month, and a day of the month. An alternative notation, common in European countries and in manufacturing industries, uses a year, a week number, and a day of the week to specify a date. The main difficulty with using weeks to specify a date is identifying when the first week of a year should begin.
Sorting with the Schwartzian Transform Randal L. Schwartz It was a rainy April in Oregon more than a decade ago when I saw the Usenet post made by Hugo Andrade Cartaxeiro on the now defunct comp.lang.perl newsgroup:
Archiving Korn Shell History Files John Spurgeon, Ed Schaefer Shell history gives users the ability to manipulate commands previously entered at the command line. It is not an auditing tool. Nevertheless, systems administrators often resort to looking at shell history files to trace user activity. When used as an audit utility, shell history has serious drawbacks. For example:
Once a shell history file contains the maximum number of commands, old commands are removed as new ones are entered.
History files may be modified by a user who is trying to cover his tracks.
Timestamps are not available to determine when a command was executed.
History files are typically stored in the user's home directories making it difficult to process the information.
It can be tricky to tell who executed certain commands if someone used su to become another user, such as root.
Inside-Out Objects Randal L. Schwartz In my previous article, "Generating Object Accessors", which appeared in the January 2006 issue, I created a traditional hash-based Perl object: a Rectangle with two attributes (width and height) using the constructor and accessors like so:
Implementing Standard Login Scripts Ed Schaefer, John Spurgeon Consider a server model where numerous Unix servers are distributed across numerous production sites hosting database engines and other software applications. Also, assume that only the local systems administrators have command-line access. We think standardizing the administrator's login scripts is a good way to maintain high application availability.
Getting to Know Your Network -- Part I Luis E. Muñoz If your job is like mine, you've heard the words "vulnerability management" a lot during the past couple of years. Generally speaking, "VM" comprises all the tasks we must do -- such as patching, device and machine inventories, and security audits -- to keep our networks working despite the various software flaws exploited by malware.
Generating Object Accessors Randal L. Schwartz The traditional Perl object model is rather simple. Create a hash, use a reference to that hash as the object (appropriately blessed so that we can find the associated package of methods), and use the hash elements as the member variables. So, for a class Rectangle, we write the constructor as:
John & Ed's Scripting Screwups John Spurgeon, Ed Schaefer We believe that you don't learn anything or do something without making mistakes. Because this is our last column of the year, we'd like to discuss this year's blunders and enhancements...
Simplifying Solaris Patches Paul Guglielmino Maintaining large numbers of systems over time can cause small (and sometimes large!) differences in the system configurations. Some of these differences may occur in the system's patch levels. Perhaps an ad hoc patch for the development environment never made it to production or space issues prevented a patch from getting installed. Regardless of the reason for these differences, it's good to have a way to measure the accuracy of your configurations. When issues arise, knowing these differences will aid you in troubleshooting problems.
Asserting File Attributes Using Solaris Packages Ed Schaefer, John Spurgeon Over time, file attributes in a multi-user environment tend to drift from their original values. Some of these changes are acceptable, but detecting and correcting undesirable modifications can be a challenge for systems administrators.
Queuing Jobs with qjob Ed Schaefer, John Spurgeon Most systems administrators are familiar with using the cron facility or the at command to schedule jobs. Sometimes an attempt is made to schedule jobs so they don't conflict with one another. For example, it may be necessary to limit the number of resource-intensive jobs running at the same time to avoid overloading the system. Or you may need to prevent jobs from simultaneously accessing a shared resource. This can be challenging, especially if commands must be run frequently and the time they take to complete is significant and variable.
Techniques for Production-Grade Scripts Brian Martin Systems administrators have many responsibilities including maintaining and upgrading operating systems, supporting the development staff, serving as the help desk (fixing printers and supporting users), and more. We never have enough time, so we write scripts. We write scripts for ourselves and our users to turn complex tasks into simpler, faster ones. Some of these scripts run quickly, with someone right there watching the results. Others run unattended, often overnight or as the result of a crontab entry. Some scripts are fairly unimportant -- it's nice to have a pretty graph of network statistics, but hardly catastrophic if the script fails. Other scripts are vital, either to the operation of the system, or to the operation of the business.
Implementing an Effective Abuse Management Process -- Part III Luis E. Munoz In the two previous articles on abuse management, I described the Mail::Abuse package, discussed receiving and analyzing abuse reports, and showed how to configure the abuso script for the network. In this third and last part, I show how to test your setup so that Mail::Abuse automatically analyzes the abuse complaints sent to the contact addresses at your site.
Vulnerability Assessments with Nmap and Nessus Wyman Eric Miles The need for network vulnerability assessments is a fact of life for systems administrators. It is often necessary to discover new applications that have been installed, verify adherence to policy, and look for unpatched systems. In the event of a compromise, comparing the operating system's view of services to that of the network is a simple way to verify the presence of a rootkit. Two excellent tools exist for this purpose, Nmap and Nessus.
Nicer Configuration Files Randal L. Schwartz I see a lot of configuration file modules in the CPAN. Perhaps too many. Perhaps this is a task that (like so many others) attracts every new junior Perl programmer into the "I can do better than those" mindset.
Implementing an Effective Abuse Management Process -- Part II Luis E. Munoz A good Abuse Management Process (AMP) combines policy enforcement with incident response in a way that is scalable, reliable, cheap, and swift. In this series of three articles on abuse management, I will share some tips and tricks about building an AMP. Last month, I described the Mail::Abuse package and focused on receiving and analyzing abuse reports.
Using GraphViz for Database Schema Visualization Mihalis Tsoukalos This article will try to combine the power of Perl and GraphViz in order to partly visualize a DBMS. I will provide a quick introduction to GraphViz, and then present the use of GraphViz for illustrating Entity Relation (ER) diagrams. Finally, I will demonstrate a Perl script for visualizing all the tables of a user in an Oracle DBMS using GraphViz.
Creating Informix HPL Jobs in Scripts Ed Schaefer, John Spurgeon If you are administering Informix OnLine databases containing very large tables, the High Performance Loader (HPL) bundled with the engine can be a godsend. Loading or unloading a very large table using the HPL is usually much faster than executing the Informix load or unload commands from a utility such as isql or dbaccess. The HPL is also faster than a typical application program that uses embedded SQL.
Eight Ways to Reverse a File John Spurgeon, Ed Schaefer In this article, we present eight ways to reverse a file.
Implementing an Effective Abuse Management Process -- Part I Luis E. Munoz As a systems administrator, you likely have an important role in keeping your network secure. This is a complex and often resource-intensive task in today's networks. Two important activities that are basic to ensuring security are enforcing the compliance of established site policies, and maintaining an incident response process.
The OpenLDAP Perl Backend Reinhard Voglmaier OpenLDAP is the reference implementation for the LDAP protocol. The OpenLDAP distribution [1] is not just an LDAP server but also offers a framework containing everything necessary to build an LDAP workbench. And, most importantly for projects with a small budget, it's completely open source and free.
Avoiding SQL Injection Attacks Randal L. Schwartz In recent months, the entertainment news was abuzz with how socialite Paris Hilton had had her Sidekick phone "hacked", revealing phone numbers for many famous people, interesting notes about possible profit participation in the "stolen" sex tape, and lurid pictures, all of which were broadcast widely on the Internet. But the quiet word amongst computer security professionals was that this wasn't a matter of hacking into her phone at all, not that the entertainment news people would know or care. Instead, certain individuals have claimed responsibility through a well-known security flaw on T-Mobile's Web site, with which the phone is synchronized. Thus, it wasn't the phone that was the source of information -- it was the Web site.
John & Ed's Miscellaneous find Tips Ed Schaefer, John Spurgeon Here are four of our favorite miscellaneous find tips:
* Ignoring directories when using the find command.
* Finding files with a modification time within a date range using the -newer option.
* Using GNU find's printf and fprintf options.
* Setting find's PATH to a file.
Manipulating Floppy Disk Images on Solaris Ed Schaefer, John Spurgeon With the advent of CD and DVD burners, USB flash drives, and high speed networks, floppy drives are becoming passé. For some administrators, however, floppies are still a convenient way to transfer and store small amounts of data. Moreover, a floppy drive may be required to install hardware drivers and other software that is still distributed on diskette.
See Your Files and Descriptions with "List" Jim Pinson The Unix/Linux world loves short file names, especially for commands. In a world dominated by "ls", "cp", and "mv", longer filenames such as "md5sum" seem almost extravagant. The short file names certainly save us a lot of effort when we type commands, especially those long pipe commands we seem to favor.
Using Screen in Scripts Ed Schaefer We expected reactions to our "Using Unknown Passwords" column, and we were right. We'll cover reader feedback before continuing with this month's column.
Book Review: C++ Coding Standards: 101 Rules, Guidelines, and Best Practices Jeffrey L. Taylor Reading this book reinforces a trend I noticed more than 10 years ago when GUIs became mainstream — programming applications in C, particularly C++, is for professionals. The required body of knowledge has simply grown too big for casual programmers. However, if you choose to program in C++, you need this book — or one like it — within reach. Borrowing it, reading it once, and returning it won't do. Read it now and re-read it as part of your entering-alpha-test code review.
Understanding the Command Line Randal L. Schwartz In past columns, I've talked a lot about the Perl language, but have never said much about perl at the Unix shell command line. So, let's fix that by looking at some commonly used command-line constructs for Perl.
Using Unknown Passwords Ed Schaefer, John Spurgeon Often, several administrators have root privileges on a system. In cases where people are allowed to log in as root or use su to become root, more than one person needs to know root's password.
Checking Your Bookmarks Randal L. Schwartz Like most people, I've bookmarked about a third of the known Internet by now. Of course, sites go away, and URLs become invalid, so some of my lesser-used bookmarks are pointing off into 404-land.
BIND Management Using ProBIND Mark Barrow I was recently hired to sort out the management of a clients BIND DNS servers. They had deployed multiple BIND DNS servers running on Solaris to serve both internal and external DNS for themselves as well as primary and secondary DNS services for many of their customers. The current solution involved editing the zone files on each master server (Internal/External), then reloading the DNS into a test namespace to check for errors (using nslookup, etc.) before deploying to the production namespace and running a Perl script to reload all of the servers. Although extremely stable, it was necessary that skilled sys admins spend a lot of time managing the solution. They wanted a solution that that could be maintained by other office staff.
The Magic of mod_perl Frank Wiles I often run into people who are confused about what mod_perl is. Some people think mod_perl is only useful to speed up CGI scripts. Some oddly believe it to be a heretical and incompatible version of the Perl programming language, while others are very confused and think mod_perl is just another fancy way of saying Perl/CGI. Fortunately, all of them are wrong. With the upcoming release of mod_perl 2.0 (mod_perl 2.0 is very near release as of the writing of this article and likely will be released before this is published), I wanted to better explain mod_perl.
Insecure by Default Lukasz Wojtow It seems so easy -- download Apache, throw PHP together with some database, and you have a new server for dynamic Web pages. It's true; building Web servers has never been easier or cheaper. The price paid for ease of use and installation, however, is loose configuration -- designed not to create problems on startup but not to be the most secure. This article describes how configuring MySQL, PostgreSQL, PHP, and Apache with their default settings can lead to security breaks. Some of the issues covered can be applied only to shared hosting, where an attacker owns a virtual host and has unprivileged, local access to the system.
Entrap: A File Integrity Checker Ed Schaefer, John Spurgeon Verifying the integrity of files is an important systems administration task. Well-known systems administration authority Æleen Frisch says that "minimally, you should periodically check the ownership and permissions of important system files and directories." One method for verifying files is to take a snapshot of the system in a pristine state and compare it against subsequent snapshots.
Commonly Used Parsing Techniques Randal L. Schwartz I write a lot of Perl code that contains a significant amount of text parsing -- to find the interesting bits of the text (data reduction) or to break the text into pieces (lexical analysis). In this column, I'll show how I use regular expressions to accomplish those tasks.
Checking Email with PHP Russell Dyer As a consultant I'm often away from my office and will miss email from clients. With Web access to my email server, I can read and send mail; however, I don't have time to keep checking email when I'm working. Instead, I've written a program in PHP that checks email for me. I have cron run it every 15 minutes. If there's a message, PHP sends a text message to my cellular telephone letting me know. In this article, I will review this PHP script as a learning opportunity.
Trapping Special Characters in the Korn Shell Ed Schaefer, John Spurgeon Have you ever needed to know whether a user pressed the up arrow key or some other unprintable character from within a shell script? The Korn shell provides no command for detecting whether a user has pressed a special character (arrow keys, function keys, and control key sequences). With a little programming, and by setting certain terminal driver options with the stty command, you can detect these keys. In this column, we'll:
-Discuss special key composition and how to use the stty command in a shell script to break down the composition.
-Present shell function GetKey, which determines whether a special key has been pressed (the unprintable control characters are embedded in the script).
-Present shell function NewGetKey (a rewrite of GetKey), which does not use embedded, unprintable control characters, thus improving script portability.
-Conclude by presenting a "C" utility -- keycode -- that, with the press of a key, displays the key and its value in decimal, octal, and hexadecimal.
Unix Monitoring Scripts Damir Delija It is impossible to do systems administration without monitoring and alerting tools. Basically, these tools are scripts, and writing such monitoring scripts is an ancient part of systems administration that's often full of dangerous mistakes and misconceptions.
Using PHP to Back Up MySQL Russell Dyer The importance of backing up data can't be stressed enough, and this also applies to backing up MySQL databases. One of the keys to making regular backups is to automate the process. You could buy a backup program that will copy the data files from a filesystem to archive media. However, for more dependable backups, MySQL would have to be shut down before a backup program were run, which could make MySQL unavailable to users for quite a while. A better alternative is to write a PHP script that will use a utility like mysqldump.
Web Interfaces in MySQL with Perl, Part 3 Russell Dyer In part 1 of this four-part series on developing Web interfaces to MySQL using Perl, I explained the development of a CGI script (book-list.cgi) in which some basic information is extracted from a table in MySQL. The fictitious database that was used for the examples, incidentally, was that of a small library. Minimal data on each book was displayed in a table format on a Web page. Each line of data included a link to another CGI script (book-detail.cgi) that would retrieve details on the book selected, the complete record for the book.
In part 2, I explained the development of that second script. It also acted as a form for an administrator to be able to create new records or to edit existing ones. Data for new and modified records was to be sent to yet another script (book-save.cgi) for the data to be validated and saved.
In this article, I will work through the development of this third script.
Strictly Speaking about "use strict" Randal L. Schwartz In many of my writings about Perl, I give the strong admonition to place use strict at the beginning of the program. I've often explained the line with a few short phrases, but I thought it would be interesting to focus on this one construct in detail for a change.
PHP and XML Russell Dyer XML is very useful in standardizing data that's shared between diverse systems. Most databases and programs can export and import plain text and that's all XML is. So if you've been asked to interface data from your organization's system with the system of another organization, consider using XML for the exchange. It's an agreeable medium.
Implementing Semaphores in the Shell Ed Schaefer, John Spurgeon Welcome to the inaugural edition of our Scripting Solutions column. Every other month, we will review scripts that solve systems administration problems, illustrate programming techniques, or highlight pitfalls to avoid. Our emphasis will be on sh/ksh/bash shell scripts using mostly traditional Unix tools. If you have any questions or comments, please email us at sascripts@yahoo.com.
PHP and MySQL Russell Dyer One of the most popular programming language and database engine combinations for the Web is PHP with MySQL. This combination works well for many reasons: primarily the speed, the stability, and the simplicity of both applications. The two are used extensively on a variety of Web sites. As a systems administrator, you can use the pair for storing data on users, hardware, and system documentation, for example. In this article, I will explain the basics of how to connect to MySQL and how to query MySQL with PHP.
Lightweight Persistent Data Randal L. Schwartz Frequently, you have data with a strong will to live. That is, your data must persist between invocations of your program and occasionally even be shared between simultaneous invocations.
Scanning Apache Logs with PHP Russell Dyer On my Web site, I have a few key Web pages located in a directory requiring user authentication. For some documents, though, I want to know when they are accessed and who accessed them. For instance, I might put a business proposal in a private directory and send emails to several prospects asking them to read my proposal. So I can learn whether the document was viewed and which prospects viewed it, a PHP script scans my Apache access log regularly and sends an email to my cell phone telling me if it discovers a match. In this installment of my series on PHP, I will describe this PHP script to explain a little PHP programming and to give you some ideas on how PHP might be used for systems administration and log monitoring.
Useful Scripts for Overworked Administrators Mark Prager I work for a startup company, which means we face the usual problems of financing. Because many automated system tools are very expensive, I have written several scripts to help automate some of my daily tasks that monitor our system. I write these scripts in ksh and csh, and, where necessary, a few small C programs because these seem to be the least complicated. The C programs were compiled with gcc. Similarly, the scripts usually come out self-documenting, which means I can leave them running and return to them several months later and still understand what I was trying to do. Also, the scripts run under Solaris 2.5.1-7.0, and can easily be used on other UNIX operating systems.
The Art of Spidering Reinhard Voglmaier Every Webmaster will encounter a robot sooner or later. He or she will typically find proof of the activities of "strange browsers" in logfiles. So, what is a robot? A robot (also known as a spider) is a procedure that visits Web sites with the objective of gathering information. The robot does not limit itself to getting the information from just one Web page, but also tries to get the links mentioned in this page. If it kept going in this way by following all the links, it would eventually spider the whole Internet. This means the robot needs limits defined in its configuration file that tells it where to stop, which I'll discuss later in the article.
Poor Man's Search Engine David Carlson What do you do if you want a keyword search engine on your Web site but have no funds for this? Some freeware solutions are available but may also deliver annoying ads. However, if your Web site is not heavily used, you may be able to develop your own "quick and dirty" solution. This article shows how I handled this problem in Linux. The result was an open-source, freeware search engine called QSearch. It consists primarily of a bash shell script and a compiled CGI program written in C++. Although our server uses Red Hat Linux and the Apache Web server, the software may be adaptable to other settings.
Fuzzy Text Searches with agrep and afind Yefim Nodelman, Alex Golomshtok In the past few years, the advents of storage and networking technology and the Internet have contributed to a dramatic increase in the amount of information accessible from the desktop. Users are now faced with the problem of information overload -- it can be difficult to locate the resources relevant to their needs. Under these conditions, the ability to effectively search through vast amounts of data becomes a primary requirement for any modern computing environment.
Apache User Maintenance with PHP Russell Dyer For a sys admin managing a Web site, especially an intranet site, the maintenance of Apache users can be bothersome. Sometimes it may be preferable to allow department managers to maintain their own users: adding and deleting usernames, changing passwords on the Linux server, etc. Unfortunately, it is not feasible to give non-technical managers server access to Apache's htpasswd program or to the user file for managing usernames. However, by configuring Apache and writing a simple set of PHP scripts, you can set up a fairly secure Web interface through which non-technical administrators can maintain Apache users.
Building a Web-based Java Application Server with Apache JServ Don Gourley, Wei Wu From the early days of the World Wide Web, systems developers have looked for ways to generate dynamic Web pages, especially for content based on information in databases. Application servers are now available that integrate directly with Web servers to extend Web server processing, without the overhead or complexity associated with previous mechanisms for dynamic content (such as CGI or scripts embedded in Web pages)(Figure 1).
Script Manager Ed Quillen Scripting is an invaluable tool for UNIX systems administrators. We constantly fix complex problems with a script here and a script there to keep everyone happy. When a seemingly insignificant and very hard-to-find script breaks for some odd reason, the whole house of cards can fall. The person who wrote that script may be somewhere in Redmond selling penguin dolls or something, and you have to fix the problem. Collecting the following basic pieces of information about scripts will help you solve most scripting problems:
LogViewer Andy Sackrieter , Darrin Husmann On our work as both consultants and systems administrators, we recognized the potential of log files as a valuable nugget in the enterprise systems rhetoric. System and application log files are where competent systems administrators usually find the true cause and applicable solution protocol to most system and application issues. After exhaustive searches, we realized that an easy-to-use, semi-autonomous log viewing application that offers a client-graphical user interface did not exist. So, while learning the Perl programming language, we wrote the application described in this article.
Link Management System Reinhard Voglmaier There are many good books discussing the different phases of creating a Web site, such as Web planning, Web design, and so on. Reading these books leads the Webmaster into an ideal world and returning to the everyday job may then be frustrating, because the Webmaster finds herself facing a poorly designed and perhaps even more poorly planned Web site. This is because most Web sites are grown over time. As a site grows, the initial lack of planning is felt more strongly. When attempting to move a whole directory, it can seem as if the site either must remain as it is or will need to be redesigned from the ground up. Neither approach is the best one; the former will keep the site in the unorganized state, and the latter will waste a lot of good work.
Making a Wish: The Web-Interface Shell Shawn Bayern Without even realizing it, your computer-illiterate neighbor may have recently been a UNIX user, having purchased goods or services using a Web site hosted on a UNIX server. Ten years ago, users sat at command-line terminals and engaged in text-based dialogs with a machine. Increasingly, however, the honor of using command-line shells is being reserved for systems administrators, and it has become their job to protect users from errors like "Command not found" and from having to set a PATH.
Perl and the Practical Systems Administrator Randy Appleton Systems administrators are very busy people. Sometimes a bit of common sense programming can go a long way toward eliminating some of the repetitive tasks associated with systems administration. Perl can be used to automate many recurring tasks. AccountCheck is an example Perl script that automatically checks for problems that can occur when user accounts are made and deleted without every necessary step being completed. Partially created or deleted accounts can be a security hazard, acting as hidden doors to let intruders enter a system. Most systems have such hidden doors. This Perl script checks for all the common types of errors that can occur. It checks the following:
Up and Down Yufan Hu As a systems administrator managing more than one system at geographically separate locations, ensuring that all the systems are up and running is of vital importance. This is especially true when these systems receive 24x7 client access. To achieve this goal, some kind of proactive monitoring tool is necessary. This article describes a simple tool written in Perl, which helps me keep an eye on most major services running on a local or remote server, and sends an alert to my pager and email box whenever the up/down status of the service is changed. It discusses some issues related to the design and use of the tool, such as monitoring multiple services on one server, multiple servers, and reliability.
Using vi Tag Files Ed Schaefer Administering large software projects requires editing objects in multiple source files. If the desired object, function, etc. is not in your working source file, you probably won't remember where in the source hierarchy that object resides. The vi editor provides a tag file facility that allows a developer or admin to move the vi editing session to the desired object and changes the current working source file with just a key stroke combination. This article covers the use and structure of vi tag files. Creating tag files with the UNIX ctags utilities is also presented.
Managing an LDAP Database with Perl and Apache Reinhard Voglmaier One of the most tedious activities in systems administration is password management. This means not only to create, modify, and delete accounts, but also to handle requests from users who forgot their passwords and, even more time consuming, to explain what password has to be used on which system under what application. In Sys Admin, June 2000, Lizmari Brignoni described the basics behind the LDAP protocol (Lightweight Directory Access Protocol). This protocol is widely used for user authentication. It allows one application to access information maintained by another one. A good example is the use of data stored in an email system by the company telephone book made accessible via a Web application.
Constructing Objects Randal L. Schwartz To construct an object in Perl, you must select a valid package name for the object's class, populate that package with subroutines to define the methods, set the value of @ISA within that package to define the base (parent) classes for that class, and then create a blessed reference.
Python in Systems Administration: Part VI -- Wrapping up Python Cameron Laird This is the sixth installment of this series on Python in systems administration. Many of you have emailed me about ways the language has helped in your duties, and suggestions for improvements still needed in Python. In this article, I'll tie up a few loose ends.
Remotely Monitoring Files with PHP Russell Dyer Although we may enjoy working with computers, it's nice to be able to walk away from them. To keep from worrying about them, however, we need to be able to monitor our servers remotely. In this series on PHP, I will present scripts useful to systems administrators for monitoring and maintaining servers, and teach a little PHP in the process. For this first article, I will examine a PHP script that scans for files on an FTP server as an example of how to write a PHP script to monitor a server.
Python in Systems Administration: Part V -- Python Networking Cameron Laird Python makes network administration scriptable, which is a wonderful thing. As Unix systems administrators, our responsibilities reach beyond configuration of a single host. We also cultivate and repair the whole range of client-server networking that underlies early 21st-century computing. Too many times, though, we try to do this job with end-user applications that are clumsy for our needs. There's a better way.
Managing Enterprise Alerts Ed Schaefer, John Spurgeon We currently have more than 30 shell scripts monitoring the health of the worldwide enterprise servers and databases that we manage. Each of these scripts generates messages that are sent to various users. In the past, controlling these alerts was an administrative nightmare. To better control which users receive which alerts and when, we developed the Enterprise Alert Process. The process, written entirely in Korn shell, includes the utilities listed below.
Unknown Expect Cameron Laird Nearly all Unix systems administrators rely on Expect — and the overwhelming majority also misunderstand it. This third installment of this series explains seven little-known facts about Expect that may help you use it more efficiently.
Perl Advisor: Monitoring Net Traffic with OpenBSD's Packet Filter Randal L. Schwartz The server for stonehenge.com lives somewhere in Texas, in a place I've never seen. I rent a box from Sprocket Data Systems, and they provide my remote eyes and ears, and hook me up to their networks and power grid. I'm limited to a certain bandwidth each month for the rate I pay, and to offset the costs, I also sublease the box to geekcruises.com and redcat.com.
Logsurfer+ Kerry Thompson There are many useful open source tools available. So many, it can be hard to choose one to solve a particular problem. Logsurfer is one of the most useful tools I know for monitoring system log files; in fact, it is quite surprising just how much can be done with this small C program.
Evaluating Conditional Expressions with Functions Ed Schaefer When I was a less experienced shell programmer, I didn't think about my Korn shell function's return value. My functions tended to look like these two examples:
Python in Systems Administration: Part IV -- Python Makes GUIs Cameron Laird In the first installment of this series on Python for systems administration, back in December 2003, one of the benefits I mentioned was how easy Python makes development of graphical user interfaces (GUIs). This month, I'll give more attention to Python-based GUIs.
Python in Systems Administration: Part III -- Pexpect Automates Hard-to-Solve Problems Cameron Laird Unix systems administrators are familiar with Expect as a nearly indispensable tool for handling difficult problems involving passwords and other unusual forms of data entry. Few know, though, that Python can easily handle most of the same problems: Python has its own Expect.
Sharing Open Source Code Through the CPAN Randal L. Schwartz The Comprehensive Perl Archive Network (CPAN) is a wonderful place, full of contributed items for you to use, such as scripts and modules. Modules are the core of the CPAN: little building blocks for you to include into your applications.
Managing System Identity with changeident John Spurgeon, Ed Schaefer When building or reconfiguring a system, an administrator performs many mundane and repetitive jobs to identify the system. These tasks may include setting the time zone, setting the netmask, configuring sendmail, configuring the network interfaces, changing the node name, and so forth. In this article, we present a Korn shell utility called changeident that automates changing the system identity. Changeident includes a generic driver, a collection of program modules where each module performs a specific task (such as changing the node name), and a configuration file that determines which modules need to be executed. Additionally, optional response files can eliminate the need for human interaction.
Python in Systems Administration: Part II -- Step up from Shell Cameron Laird What kinds of problems are suited to Python? As a first approximation, think of Python the way you do Perl. Although far more Unix systems administrators currently work in Perl, the two languages are roughly comparable, for our purposes. Many of the differences between them are subjective, in the sense that experienced programmers simply find the features of one or the other fit their own habits of thinking better, although they're equally capable or provide the same formal functionality. This second installment in my series on "Python in Systems Administration" explains the parallels, then spotlights instances where Python might serve you better.
Backup Scripts from UnixReview.com, 3rd Edition Ed Schaefer I still host the monthly Shell Corner at UnixReview.com. This third edition of "Backup Scripts" features scripts from three pillars of the comp.unix.shell newsgroup. If you've posted to that newsgroup, Heiner Steven, Michael Wang, or Chris F. A. Johnson may have answered your question. The first script described in this article creates a local archive of files on a remote host. The second script creates a Solaris alternative backup boot disk, and the third script automatically extracts files of various archive types into the current directory.
Python in Systems Administration: Part I -- Better Scripting Cameron Laird One well-honed item in every sys admin's toolbox is a preferred scripting language -- maybe sh, or ksh, or Perl, or something more unusual, like Rexx or Ruby. I find Python so capable and easy to learn that in my consulting role at Phaseit, I tell newcomers it's the best single language they can learn. Python spans a wider range of applications than any other language I know -- even more than C or Java -- and beginners pick it up quickly.
Expect Success Cameron Laird Expect occupies a place in systems administrators' toolboxes much like that of marking pencils for carpenters, or axes for firemen: it hasn't changed in years, it's small and inexpensive, it's utterly unglamorous, there are substitutes that make it possible to live without it, but it makes a big difference in the situations that call for it.
Exploring Expect is the book that documents Expect. Incredibly, it remains in its first edition, materially unchanged since author and Expect inventor Don Libes first published it almost a decade ago. While Expect is a full-fledged, general-purpose programming language- — a superset of Tcl, in fact — its value is most apparent when there's a requirement "for dealing with crappy interfaces," in Libes' words. An abundance of applications have intractable or inconvenient interfaces, so there's plenty of need for Expect.
Speeding up Your Perl Programs Randal L. Schwartz How fast does your Perl run? I hope that, most of the time, the answer is "fast enough". But sometimes it may not be. How do we speed up a Perl program? How do we know what's making it unacceptably slow?
Do It Yourself with the Shell Ed Schaefer, Michael Wang Handy Unix tools such as Perl, awk, sed, and grep are frequently used to solve programming problems, while the shell may be overlooked as a problem-solving tool. Most of us garner Unix knowledge by learning Unix commands and, to the uninitiated, shell programming is just chaining a series of commands together. As a command interpreter, the shell does not distinguish its built-in commands from external commands; you do not call external commands using a function as Perl's system() function. Using the shell over an external tool is analogous to performing a task yourself versus hiring somebody else to do it. Provided you have the knowledge and experience, it's generally better to do it yourself.
Unix Administration with Self-Parsing Shell Scripts John Kozubik Unix systems administration often consists of repeating common, similar operations on different sets of targets. The notion of using, and stringing together, building-block primitives such as cat, sort, strings, wc, sed, and awk is a core tenet of Unix philosophy. Sometimes jobs are too complicated to solve with a single command-line of pipelined or redirected primitives, or perhaps the job will be repeated often enough that it makes sense to create a more permanent script to produce the desired outcome. The problem that arises is how to allow the script to handle a variety of related inputs, so that it will be useful in the future when different data needs to be processed using the same procedures.
Using a Distributed Shell to Manage Deployments of Linux and Unix Servers Jeff McElroy Linux and Unix servers have proliferated across many corporate networks. Some deployments have been well organized, but many have happened slowly and haphazardly. Unsurprisingly, many of these deployments lack organization and standardization. In smaller deployments, an administrator can manage each server individually, but as the number of servers increases this approach becomes awkward and additional tools must be utilized.
Embedding man Pages in Shell Scripts with kshdoc Michael Wang, Ed Schaefer Generally, large programs (such as Solaris, Oracle, Perl, and ksh) possess big documentation -- books, technical papers, man pages, etc. However, the shell scripts that we write every day usually aren't that big, and it's overhead to maintain separate documentation. Furthermore, shell programmers and administrators are notorious for not providing documentation. Why not simplify the task? One method is to maintain online documentation within the code so that when code does change, documentation updates exist in only one place. This article presents kshdoc (Listing 1), a Korn shell function that allows printing documentation embedded within a Korn shell script.
Computing Securely Randal L. Schwartz Security is everybody's business. You may ask yourself, "Why should I take security seriously? I don't have anything on my system that's worth exploiting." Well, that's exactly what the bad guys want you to believe.
Using TrustedBSD Evan Sarmiento TrustedBSD provides a set of trusted operating system extensions to FreeBSD. Currently, these extensions can be downloaded from http://www.TrustedBSD.org, but most of them (ACL and MAC — Mandatory Access Control) have been integrated into the FreeBSD-current tree. The MAC framework allows security policies to be set dynamically at runtime. The MAC Framework essentially gives the developer the access to define a security policy that works by positioning the developer's code within kernel functions. The developer's security policy can either augment the traditional FreeBSD discretionary access control policy, or replace it entirely. Essentially, the MAC framework allows the systems administrator to give fine-grained privileges to each user through modifying the existing security policy to match the needs of the given system. TrustedBSD comes prepackaged with a few MAC security modules, which augment the security policies of the given system or add new features — Biba Integrity Policy and File System Firewall Policy, among others.
The Simplicity of Sockets Randal L. Schwartz The Internet connects people to other people and to services. These connections are made with applications talking to each other on separate machines, over various media such as Ethernet, dialup, and 802.11b wireless. These applications, in turn, are using a simple but powerful tool called a "socket" to provide the datastream between them. In this column, I'll look at sockets and how to describe and use them.
Date Arithmetic with the Shell Kyle Douglass, Ed Schaefer Sometimes you need to measure the interval between two events or otherwise manipulate dates. In this article, we survey the different tools for acquiring the number of seconds from the epoch and present several techniques for performing date arithmetic and date comparison.
Using the xargs Command Ed Schaefer Many UNIX professionals think the xargs command, construct and execute argument lists, is only useful for processing long lists of files generated by the find command. While xargs dutifully serves this purpose, xargs has other uses. In this article, I describe xargs and the historical "Too many arguments" problem, and present eight xargs "one-liners":
StarOffice 6.0 Enterprise Edition Office Suite — A Sun ONE Software Offering The StarOffice 6.0 Enterprise Edition Office Suite -- A Sun Open Net Environment software offering -- provides a feature-rich, full-function office productivity suite at an excellent value while offering a full range of world-class service and support. It delivers exceptional cross-platform compatability with enhanced support for the Solaris Operating Environment, Linux, and Microsoft Windows, and is designed to suit all your business needs.
Teradactyl Provides Scalable Backup for Distributed Data Environments When the True incremental Backup System (TiBS) Release 2.0 began shipping in January of 2001, the School of Computer Science at Caregie Mellon University (CMU-SCS) wanted to know how it might help them improve their data backup and recovery. Patent-pending TeraMerge technology offered to reduce network loads created by their current backup solution.
Teradactyl Provides Scalable Backup for Distributed Data Environments When the True incremental Backup System™ (TiBS) Release 2.0 began shipping in January of 2001, the School of Computer Science at Carnegie Mellon University (CMU-SCS) wanted to know how it might help them improve their data backup and recovery. Patent-pending TeraMerge® technology offered to reduce network loads created by their current backup solution. “It was important to minimize the impact on network load”, said Daryl Clevenger, Supervisor of Maintenance Programming at CMU-SCS, “The feature of taking daily incremental backups and accumulating changes over time was an attractive way to minimize the impact on our network.” TiBS generates new full backups using data already present on the backup server. At the time, six backup servers provided support for about three terabytes of data distributed over hundreds of workstations and servers.
Deleting Temporary Files Created by Web Sites Using PHP Bruno Pedro Many Web sites use temporary files for one reason or another. Sometimes they generate images, send them to the browser, and then remove them. What if the user clicks on the "STOP" button? The script will abort and all those temporary files will become permanent. You could delete them manually, or periodically with crontab, or you could automate this task using PHP. The solution presented in this article takes advantage of PHP's ability to execute a specific task whenever a script terminates.
Creating Black Box Functions in the Korn and Bash Shells Ed Schaefer The article "Creating Global Functions with the Korn Shell" by Rainer Raab (Sys Admin, March 2001, http://www.sysadminmag.com/documents/sam0103f/) describes using and autoloading global Korn shell functions. Although global functions are useful and definitely serve a purpose, good software design dictates using loosely coupled, "black box", user-defined functions.
Variables and Scoping Randal L. Schwartz Programs push data around. In Perl, this data lives in variables, and the variables can be associated with various scopes. Let's take a look at Perl's peculiar scoping rules.
Coordinating Multi-Host Backups Using Perl Sockets A. Clay Stephenson Systems administrators are often tasked with cleaning up someone else's mess. I encountered such a situation when I started working with my current employer. The company's newly installed Enterprise Resource Planning (ERP) system needed a backup, and the system integrator had configured an Oracle "hot" backup as the perfect solution. After looking at the situation, I found a serious problem with this "perfect" solution -- the backups were essentially useless. The problem was that this ERP system utilized a split architecture -- meaning that the application servers hosted metadata that described the actual database data hosted by additional servers. Unless the metadata exactly matched the described data, the backups, no matter how reliable, were useless.
Backup Scripts from UnixReview.com: Part II Ed Schaefer I still host the Shell Corner column, and each month a lucky reader wins $100.00 when UnixReview.com publishes their submission (see http://www.samag.com/documents/s=7033/sam0204d/ for Part I). This month, I present three unpublished backup submissions:
backup_algo: Juan Vera (juan@coredump.com.ar) presents a Bourne shell script that creates a compressed tar backup file without overwriting the previous backup. The backup file name is based on date and a sequential number.
qd2nfs.ss: Mark Foster (mdf@foster.cc) submits a Bourne shell script that backs up essential directories to an NFS-mounted /share directory. The script is meant to be executed before doing upgrades. As the script executes, the admin interactively decides whether to back up the directory.
tgzdir: Alan Eldridge (alane@geeksrus.net) submits a Korn/Bash script that backs up individual directory objects to compressed tar files. Alan's script includes options to control the number of history files to keep, rename hidden object names, change the backup target directory location, etc.
NSRXREF -- A Python Script for NSR Files Paul Trout I've been using Nessus as a network and host-auditing tool for the past six months. As the person running the audits, I'm more than happy with the tool. When I change hats and become the person who has to fix all the holes, I have a small problem -- the reports that Nessus produces fall into two categories. There is a summary-type report that shows the hosts with the most holes, or a detailed list, by host, of the vulnerabilities found for that host. To build a security remediation plan, I've found a cross-reference chart, with the hosts across the top, and the vulnerabilities down the left side to be the best starting point. Because Nessus does not provide such a report, and because I was unable to find one on the Web, I decided to write my own.
TCP/IP Networking in Gawk 3.1.0 Mike Warner In 1997, Jurgen Kahrs and Arnold Robbins added TCP/IP networking capability to "gawk", the Free Software Foundation's implementation of the awk programming language. The networking subsystem that Kahrs and Robbins added to gawk began as a set of patches that eventually migrated into the main source tree in time for Gawk 3.1.0. Just after Arnold Robbins announced the availability of Gawk 3.1.0 on comp.lang.awk, I began downloading the source archive and building Gawk 3.1.0 on various flavors of Linux and BSD. It has always built flawlessly, and the networking capability has worked just as advertised.
Questions and Answers Amy Rich Let Sys Admin solve your problems!
Submit your technical systems administration questions to our contributing editor, Amy Rich, President of Oceanwave Consulting Inc. Each month, Amy will select several challenging questions to answer in her column. Or check out the Questions and Answers archives.
Processing Command-Line Options in the Shell Ed Schaefer This article presents three advanced methods of processing command-line options.
The first method is using the UNIX built-in command, getops, to do the parsing. The other two methods, coding parameters and keyword=value, require writing code to process the command-line options using a "while" loop and the shift command.
The Duct Tape of the Internet Randal L. Schwartz When you’re a Perl programmer, you never fret about those little ugly tasks that creep up. Perl can deal with file wrangling, text manipulation, and process management in a way unequaled by any other single language, whether open source or proprietary.
Troubleshooting Solaris™ Network Performance Alex Golomshtok Golomshtok describes a simple yet powerful Perl extension called Solaris::MIB2. This module allows for easy access to most statistical and operational data maintained by Solaris stream modules, while imposing only a minimal load on a monitored system.
Automatically Extending Your Data Randal L. Schwartz Perl is great at parsing data and bringing it into memory-based data structures for reformatting or analysis (“data reduction”). One of Perl’s features that permits relatively easy creation of complex data structures is “auto-vivification” — a mouthful to say, but it roughly means “data structures get expanded as necessary”.
Using the UNIX Pipe in C Ed Schaefer Virtually all UNIX system administrators exploit the power and convenience offered by pipes when they are working from the command line or writing shell script. By connecting general purpose filters with pipes, the system administrator can quickly generate tidy custom reports and analytic tools without the overhead and housekeeping problems associated with myriad temporary files.
Finding Old Things Randal L. Schwartz One of the great things about the Perl community is seen in the many ways that Perl information can be obtained to solve typical tasks or to get past those sticky little problems. Besides the professional documentation, there’s also the myriad of man pages that come with the Perl distribution itself, and the CPAN modules. And with a little searching on the Net, you can quickly find very active support for Perl in the way of Usenet newsgroups, mailing lists, and a few Web communities.
Storage Consolidation — Part 3 — Implementation Details Peter Baer Galvin Last month, Galvin's column discussed product selection. Storage arrays, SAN switches, tape drives and libraries, and replication all have options to consider and tradeoffs to weigh. This month, the rubber meets the road as Galvin's column addresses implementation. (reprinted with permission from Sys Admin)
Versatile Fault Management with Perl Tim Shouldice When I started working with "enterprise" fault management consoles, I was surprised by how limited they were in many areas. One of the biggest shortcomings is the difficulty of programming them to manage events based on the service hours of the device creating the fault. In the organizations in which I've worked, we had many 24x7 devices, such as public Web servers and routers. However, we also had many servers, such as internal database and file servers, with service hours of only 8am to 5pm, Monday to Friday. Our support staff continually dealt with alerts from these non-critical servers at night and on weekends.
Expect: The Firefighter’s Friend Cameron Laird Most UNIX administrators are familiar with the Expect utility. They generally know it as a way to automate password entry in FTP clients or password-management system commands.
Parsing and Summarizing a Logfile Randal L. Schwartz I recently put www.stonehenge.com behind a caching reverse-proxy, and rather than switch technologies, I’m using another instance of a stripped-down Apache server to do the job. But what kind of job is it doing? How many of my hits are being cached and delivered by the lightweight front servers, instead of going all the way through to the heavy mod_perl_and_everything_else backend servers?
A Powerful Search Tool for ASCII Files Koos Pol Sometimes the main UNIX principle of combining small tools to accomplish complex tasks just isn't enough. There are times that you just need more. A striking example is the task of searching through ASCII files. This can be any sort of file: C programs, error logs, HTML files, etc. If you need to find a specific string, it is usually sufficient to grep through the file and view the results. Combined with find, you can get a long way.
Doing Many Things, Like pings Randal L. Schwartz As a UNIX systems administrator, I’m often faced with those little mundane tasks that seem so trivial to me but so important to the community I’m supporting. Little things like “hey, is that host up and responding to pings?”. Such tasks generally have a very repetitive nature to them, and scripting them seems to be the only way to have time to concentrate on the tasks that really need my attention.
A Homegrown Backup Solution Utilizing RSA Keys, SSH, and tar Ray Strubinger Strubinger shares two shell scripts used in this custom backup solution
UnixReview's Shell Corner Roundup: Unix Backup Scripts Ed Schaefer In his monthly Shell Corner column, Ed presents a winning shell script from our reader submissions. Here, he shares three backup scripts: nfs_backup, mirrorcopy, and backup.ss. (This article originally appeared in the April 2002 issue of Sys Admin magazine. Used with permission.)
Why Java Isn't Appropriate for Everything
Redundant Internet Connections Using Linux Seann Herdejurgen Herdejurgen shows how to set up a Linux host with redundant Internet connections.
Web Publishing with Perl Objects Reinhard Voglmaier Voglmaier builds on a previously described process for getting Web content into production.
Systems Administration with Scsh
Sarmiento introduces a package called scsh (the Scheme shell), which provides a set of macros for the Scheme programming language adding the ability to call on all standard UNIX system calls and add regular expressions.
Perl Advisor / Parsing Interesting Things
Someone recently popped into one of the newsgroups I frequent and asked how to parse an INI file.
It's All About Context
Dangers of SUID Shell Scripts Thomas Akin This article attempts to walk the fine line between full disclosure and published exploits. The object of this article is to illustrate how SUID programs work in order to help others writing their own programs avoid some common mistakes.
Creating Global Functions with the Korn Shell Rainer Raab
Using PHP and MySQL as a Weblog
In this article, I will show how the embedded server-side scripting language PHP and the fast MySQL database can work as a Weblog.
Deep Copying, not Deep Secrets Randal L. Schwartz One of the modules I encountered in the CPAN had a problem with creating multiple objects. Each object was created fine, but on further use simultaneously in the program, some of the data from one object mysteriously showed up in the second one, even if the first one was freed! Upon inspection, I found that the object was being initialized from a shallow copy of a template, and I told the author that he needed to deep copy the template instead. He was puzzled by the suggestion, and if you aren't familiar with these two terms, You may be a little confused now as well.
Perl Advisor / What is That, Anyway?
Perl has many built-in operators to make getting lists of names easy, and also for figuring out what you really have once you know a name.
Getting Your Message Across with Apache
All too often admins post important system status information affecting the computing environment, yet Web users will still be oblivious to why the server is down. It turns out that the majority of users do not access Web sites through the main home page. Instead, they access sections of a Web site through their bookmarks, or other external links. Despite efforts to train Web users to frequently visit our home page for pertinent news items they forget to do so. In this article, I present an Apache module that I created to tackle this specific problem. It provides a way to push your important messages to your user community so that anyone accessing any Web page on your server will get the message.
Perl Advisor / Whats the difference?
Perl Advisor: A MIME Is a Terrible Thing to Waste
PICA: Perl Installation and Configuration Agent
Perl Advisor/Getting It to Look the Way You Want
A Perl of a Site Map
At my last job, I discovered that my manager didn't even have blank maps for reference. She simply tried to remember the location of equipment and people. Since she had not become attached to any other method, I felt this site was a prime candidate for using my scripts, so I installed them. My manager liked them, but had a few suggestions. After another five weeks of intensive development, I had the final product. I called it, simply, Site-map.
Perl Advisor/Getting It to Look the Way You Want
If you've been reading my columns for any length of time, you've probably seen me mention "taint mode", usually briefly while I'm describing a "hash-bang" line of something like: #!/usr/bin/perl -Tw
which turns on warnings (the -w) and "taint mode" (the -T). But what is taint mode?
Perl Advisor/Getting It to Look the Way You Want
Perl Advisor/Rainy Day Template Fun Randal L. Schwartz
A Framework for Automated File Transfer
Most systems administrators regularly have to transfer files from machine. Writing scripts to perform this activity is part of the nature of a good admin.
Developing a Perl Routine
Here's the task: start with the three-letter English abbreviations for the seven days of the week, in their natural order. Write a subroutine that takes two of these weekday abbreviations, and returns a single comma-separated string with all the days in between, wrapping around if necessary.
A Perl Package for Monitoring Traffic
Systems and network administrators constantly struggle to know what is happening on their networks. This job is difficult at best, and at worst, it can be downright exasperating.
Checking Your System Logs with awk
Because there is so much data to sift through on a regular UNIX system, efficiency must be sought to make sense of all of this data and keep a watchful eye on your system.
|
|
 |
|