Code Samples and Examples
I'm no guru when it comes to this sort of thing, and not an
especially talented coder, but these are things that have proved
useful to my work, so they're offered up on that basis. Its mainly
things that I've developed at my work, but somewhat tidied up and
commented at home in my own time to (I hope) make the code a bit less
shameful in public view. A drawback of the tidy up process is that I
don't have a development environment in which I can test the tidied
up versions of the code, so the odd "error in translation"
is quite feasible.
You'll also find some of this material on the NetIQ
Cool Solutions and Novell
Cool Solutions pages.
These snippets and utilities are licensed under the University
of Illinois/NCSA Open Source License This is GPL compatible, but
doesn't restrict the use the code is put to. Here
is the text of the license as it applies to this code.
- PSFTPmon A Script for
monitoring changes to a web server with static content. Intended to
alert on vandalism in order to permit rapid response. Querys the remote
web server with FTP and sends an email alert if the most recently edited
file or the total number of files changes.
LDAP/PHP utilities for reporting from LDAP directories
- with an emphasis on eDirectory
- dsbedit. Scripts that can
be used to make batch changes to an LDAP directory from data in a
csv file. Should work with any LDAP directory, but there are some
eDirectory specific customisations, notably with handling the
Novell format for Home Directories. Also includes utilities for
batch creation of groups for both eDirectory and Active Directory.
- dsmobj. Another set of
scripts for manipulating LDAP directories. Whereas dsbedit takes a
list of CNs for objects with different CNs, dsmobj makes the same
change to multiple objects with the same CN in a large directory.
It was designed for manipulating ZEN application objects in a
largish tree with multiple WAN nodes, each containing app objects
with the same name. If you think of other uses please let me know.
- cronulist. Three scripts
that just report on LDAP directories. They are intended to be run
daily, scheduled by cron. They create, respectively, lists of all
users with the most important attributes listed, disabled users,
and groups in the directory with group members. With some
attributes changed these are just as useful with Active Directory
- cmexport. A php script to
create as CSV file containing users and telephone numbers from the
Cisco Call Manager LDAP directory. This is specifically to permit
import of Call Manager data with a Novell Identity Manager
delimited text driver. The script can readily be adapted for other
LDAP directories. Note that the most recent versions of Call
Manager don't have the LDAP capability this utility exploits.
- kmiexp. A pair of php
scripts to list the expiry dates of SSL certificates within an
eDirectory implementation and highlight those that have or are
about to expire.
- readopatt. This is not a
fully operational script, but demonstration code to show how to
read Operational Attributes, such as object creation date using php
and Ldap. The technique can be added to any of the scripts above if
- expusers. A pair of php
scripts to list the eDirectory user accounts which are about to or
have recently expired. Intended for use by helpdesks to help
proactively manage account expiry.
- svrmailer. A pair of php
scripts to query LDAP for the email addresses of users within a
listed context and/or (for Netware OES) users with their home
directory located on a listed server. The script will either
produce a screen with all email addresses listed or alternatively
email the users a message from a form.
- zappassc. A php script to
report Zenworks v3 to v7 application associations to users within
an organizational unit. It was written to provide an easy way of
documenting what is in use in the tree for planning a migration to
Zenworks 10, but would be useful for any need to document what
applications are in use.
VBA Macro Code
- Jim's WordHTM macros for Microsoft
Word for Windows. A handful of VBA macros that convert word
documents to a deliberately very minimal html implementation. All
they do is to convert word heading styles into h tags, word tables
into unformatted html tables and merge footnotes and endnotes into
the document. If you find the standard Microsoft HTML output far
too complex and formatted for your requirements then maybe you
might find this useful.
- Jim's Excel VBA functions
for Microsoft Excel for Windows. Two VBA functions, to
convert dimensions entered in feet and inch string form (eg 12'3")
into numbers in inches and then metres. Very trivial, but it might
save someone writing their own.
General Novell/Netware related Utilities
- iprintlist. This is
very Novell specific. it provides an easy way for users to select
between different iPrint Servers, including a means of detecting
the nearest server by ip address range. Only useful at Novell shops
using iPrint on a fair sized network.
- abendlogger. Neither
Identity Manager nor PHP, this Windows application gathers salient
data from the abend.log files on all servers in the attached tree
and creates an csv file for analysis in a spreadsheet. VB6(!!)
source code included.
- lfnreport. A php script
which works with trustee.nlm on a Netware platform to report paths
which exceed Windows limits and may cause problems for Windows
applications and system tools. Output is in a single web page
and/or emails to the users who are listed as file owners.
- Comments, suggestions, improvements and (kind) criticism all
welcome. It would be good to hear from folk who find these tools
useful in their environment.