Welcome to the APE, Alan's Programming Environment.
"The ability to destroy a planet is insignificant next to the power of the APE."
What's new? * Roadmap of commands * Useful Links
Simply put, the APE is a bunch of free programming tools that can be run directly from a CD. It allows you to walk up to any computer, drop in a CD, and have a well-configured and powerful set of programming tools all ready to run, without installing anything on the machine. Reasons for the APE's creation include:
A companion CD, called the APEX, consists of installers for most of these programs and installers for programs that can't be run directly from a CD. You can always see what's new and download the latest version of the APE and APEX from my home server.
The best way to use the APE is from the command-line--you create a shortcut on your desktop which starts up a MS-DOS session with all of the APE utilities properly set up for execution.
To install a shortcut automatically, simply double-click the
apesetup.vbs file in the home directory of the APE CD.
The setup program will also set up the path to emacs. A dialog box will appear asking if you want to install emacs at a certain location. If you accept, this will set up a registry key and add an entry to the start menu. If you decline, you will see an "installation cancelled" message. This simply means that no emacs-specific installation was performed.
If the "Quick Start" install doesn't work correctly, to install an APE-enabled shortcut onto your desktop, make a shortcut whose command-line is like one of the following (change the paths to match your system.)
C:\WINDOWS\COMMAND.COM /E:4096 /K d:\ape.bat d:
C:\WINNT\SYSTEM32\CMD.EXE /T:1F /K d:\ape.bat d:
That should be all you need to do! Double-click the icon to start a
command prompt with all the power of the APE! You can always type
apedocs to bring up this page.
(For Palm versions of the CD, see the Palm Development section below for instructions on adding the Palm utilities to your path.
Note: Some utilities (e.g. Java) do not work properly if run from a
UNC path (e.g.
\\machinename\share .) Instead, map a
drive letter and use that to mount the APE.
Even if you don't start the APE from a shortcut as above, you can always
load the APE utilities from the command line by following the following
cd to the directory containing the APE, and run
is the path to your CD drive or mount point.
For example, if your CD-ROM drive is
d:, your command
line would be:
If you receive "out of environment space" errors, you may need to add to your config.sys:
SHELL=C:\command.com /e:4096 /p
CDs are slow, especially when seeking from one track to another. I very highly recommend a tool like CD-Quick (for Windows 95/98) which caches CD information. It even manages a persistent cache so data from the CD is stored on your hard drive between reboots. If you're using the APE seriously, you should get this. An install is available on the APEX CD.
Windows NT benefits from enabling filename completion in the
cmd shell. (Although their filename completion is
completely braindead, sometimes it's better than nothing.) You will need
to change a registry setting. In the
there is a file called
completion.reg. To run this, type
regedit completion.reg . Upon reboot, the TAB key will
complete filenames when you use the
cmd.exe shell. Or, you
can just use
tcsh which are infinitely
better shells but handle filenames and paths differently.
The JDK for versions 1.0.2, 1.1.8, 1.2.2, 1.3.1, 1.4.2, 1.5.0, and 1.6.0 are
included and ready to run off the CD (space permitting.) The 1.1.8
installation and install directory contain Swing 1.1.1 final (space
permitting.) The Swing libraries need to be added to your classpath for
1.1. Most likely
ape.bat batch file will put the executables for JDK 1.6.0
into your path by default.
Important: To save several hundred megabytes of space on the APE,
much documentation is saved in compressed format. To use the
documentation, you must launch the APE Documentation Server by typing
docsrv at an APE command prompt. Alternately,
docsrv will automatically be started if you type either
javaapi to go straight to the API javadocs, or
javadocs to bring up the latest documentation homepage.
docsrv is a little Perl script that I hacked together that
acts as a web server, listening on port 9000 of your machine for requests
for documentation. When a request is received, the file is extracted from
.zip archive and returned. This is a major step forward and
will allow much more to fit on the APE. All documentation may be
compressed in the future.
javadocs) or API javadocs (Shortcut: type
javaapi) (with special APE search!)
Additional Java library files (in the directory
\javalibs\genjava(version 1.2) and
\javalibs\newgenjava(the latest)) This gives the ability to create templated types as in C++. The batch file
\scripts\genjavac.batgives a way of starting the compiler, (use it as you would
javac) but as it is limited to 9 command-line arguments, you'll probably want to add similar ability to a makefile.
\javalibs\javaCUP. This is a
yacc-like parser for LALR(1) grammars in Java. Add
\javalibs\javaCUP\to your classpath. [Local Docs]
\javalibs\JFlex. This is compatible with javaCUP. [Local Docs] | [Local FAQ]
\javalibs\decimal. [Local Docs]
CLASSPATH.) [Local Docs]
\javalibs\javacc2.0. [Local Docs]
/javalibs/freetts/. [Local Docs]
jad- a Java decompiler. [Local Docs]
\scripts\bsh.batto start, or
M-x bshfrom within emacs. [Local Docs]
\JETdirectory. [Quick Start docs]
javalibs\retroguard, if you have something to hide.
/javalibs/UMLGraphdirectory. [Local docs]
The Jakarta-Tomcat engine is supplied for developing and testing Java Servlets and Java Server Pages. [Local Documentation]
Version 4.1.12 supports servlet specification version 2.3, and Java Server
Pages version 1.2. The distribution is in
I have created a batch file,
\scripts\tomcat.bat, to start and
stop the web server and run the example files. You will need to modify XML
files to create your own web applications. (Read the Servlet
Specification, chapter 9, for information on how to do this.)
Note: In the
tomcat-users.xml file, I have added a
password for the manager account. This allows you to use the manager
application functionality to start and stop your servlets from the CD.
I have also modified the default Tomcat
web.xml file to
minimally allow it to run from a read-only device, by hard-coding a scratch
c:\tomcat\work, and a log directory of
c:\tomcat\logs. Sorry this has to be this way,
but there's no way to use environment variables in the XML file. There may
be a way of fixing this on a per-app basis by setting the
CATALINA_BASE environment variable before starting Tomcat.
To start Tomcat, simply type
tomcat start from the
command-line. To view sample pages once the engine is
running, visit http://localhost:8080/
If you want to use a JDK other than version 1.4.2, set your
JAVA_HOME environment variable to the root of your JDK
The Java 2 Enterprise Edition libraries and server, version 1.4 are
included in the
\j2ee1.4 directory. To use the documentation
below, you must launch the APE Documentation Server by typing
docsrv at an APE command prompt.
For Perl, the
script will add
\perl\bin to your path. There is also an installation
for ActivePerl, which
sets up several file associations and enables Perl integration with
several Web servers.
A large number of additional Perl packages have been installed and
can be run directly from the CD. The local
documentation contains full Perl documentation and a list of all
installed packages. Type
perldocs from the command line to
bring up Perl documentation in your web browser.
The MinGW compiler is best when creating stand-alone executables for Windows that are not a direct port of a UNIX program. This is a port of the GCC 3.4.2 compiler, so it's considerably newer than the Cygwin port (which is 2.95), and conforms to the ANSI C++ standard. (Your programs, however, may not conform... especially to namespace usage.)
The GNU gcc compiler (cygwin port, version 2.95) is installed as part of the cygwin utilities. The Cygwin version is better for building UNIX-style executables, or programs that don't conform well to the ANSI C++ standard. [Local Docs]
Normally, compiling with this compiler will require the
cygwin1.dll to be in the path, and distributed with the
libraries allow you to link against Windows libraries instead, and create
more standalone executables. If you don't like what the cygwin utilities
do with file paths, etc., you may want to download the
MinGW (Minimalist GNU for Windows)
versions of these tools. To compile and link with mingw, add the following
options to all compilations:
-mno-cygwin -I$(APE)\cygwin\usr\include\mingw -L$(APE)\cygwin\lib\mingw
For C++ programs using the Standard Template Library and compiled with
mingw, you may also need to add
-I$(APE)\cygwin\usr\include\g++-3 to compilation and link
steps, including in the
$(APE) environment variable.
If you are using
unix (the APE default) instead of
will probably need to change the backslashes to forward slashes.
perl $(APE)/perceps/perceps.pl [args]to run. [Local Docs]
TCL 8.0 is available from the cygwin distribution.
The ActiveState distribution of
Python 2.5.2 is ready
to run off the cd. The
ape.bat script will set up the
appropriate paths for Python. You may need to append additional paths to
PYTHONPATH environment variable. Python has never been
used extensively so the configuration may need some work.
pythondocsto start HTML Python documentation in a web browser.
Ruby is an up-and-coming language that has the kids all excited.
Yabasic, a lightweight BASIC
interpreter with graphics support, exists in the
directory and can be run by typing
yabasic. [Local docs]
A version of Microsoft's QBASIC was downloaded from Microsoft's web site in
case you have those old BASIC programs from Sky & Telescope that you want
to run. To execute, type
qbasic. I don't have any
documentation this one, other than its internal help.
Sure, why not? The APE is all about inclusion. The GNU
is here and it may even work, but it's never been tested.
The latest version of my evolving Frink language is
installed. Just type
frinkswing to run.
Frink changes often; for the latest documentation, visit
my Frink webpage,
a web-based interface to
This also contains my Frink sample programs in
A further description of these is available from my website's Frink Sample Programs page.
"If text-editing software built by hackers for hackers (such as Emacs) is any guide, average consumers and programmers may have almost antithetical ideas of what elegant, useful programs and documentation look like." --Scientific American, March 1999
"If you are a professional writer--i.e., if someone else is getting paid to worry about how your words are formatted and printed--emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish." --Neal Stephenson
"I'm emacs--how ya like me now!" --John "Raw Dawg" Haggerty
The preferred way to start emacs is from the command line. Type
em to start XEmacs, or
gem to start GNU (NT)
XEmacs is set up to run from the
\xemacs directory. This installation is quite
docsrv must be running to use this link. See
Emacs is ready to run directly off of the CD in the
folder, and included additional setup improvements in the
Note: If you didn't run
apesetup.bat once on the
computer, emacs will not run properly. You must first run
\emacs\bin\addpm.exe to set up a few registry settings. (I
know it's annoying. You would think emacs people would know better...)
For speed and comfort, you will probably want to fix your keyboard so that the caps lock key works like the control key:
\registrydirectory, there is a file called
keyremap.reg. To run this, type
ape.bat will set your
HOME environment variable
to point to the
\home directory, if you have not set it
already. Even if you have a different home directory, you should use the
.emacs file in the
\home directory as a starter.
In most cases, however, you will probably want to copy the contents of
\home to somewhere that you can edit and point your
HOME environment variable there.
To print PostScript, use
C-c p which prints using GhostScript
to the default Windows printer.
Other installed emacs packages:
M-x bsh) [Local Docs]
The alternately glorious and infuriating
utilities and libraries are extracted in the
directory. The Cygwin project is a set of tools and libraries used to
build programs in a UNIX-like environment, and brings many POSIX calls to
the Windows environment.
ape.bat script will add
\cygwin\bin to your
ape.bat script will add the MKS Toolkit utilities (a set
of UNIX-like commands) to your path after the Cygnus utilities. This adds
\mks\rootdir\mksnt to your PATH.
A variety of lovely shells are provided, including
csh, and probably even
something else you'll like. Startup files for these and other utilities
(such as emacs) are in the
\home directory. If you do not
HOME environment variable set,
will set one for you. To modify your home directory, the best thing to do
is copy these files to a writable directory so you can modify them
(including any hard-coded paths) but you will get reasonable performance
from running directly from the CD.
The Xming XWindows
server for Windows is available. Use
xlaunch to run.
CVS, a great version control system,
is installed. Set your
CVSROOT environment variable to point
to your CVS repository.
Subversion is also installed.
The command is
svn and exists in the
Various utilities for playing and converting between video formats are installed:
\bin and contain
many useful utilities.
ape.bat will add them to your path in
Here's an incomplete roadmap of all of the commands.
There are various helpful utilities from SysInternals.com. Many of these
utilities require that you run them from their
home directory. Run
si.bat to start Explorer in the
autorunsc- Allows monitoring/configuration of processes that load at boot time.
dbgview- displays debug information
diskmon- monitors disk usage (NT/2000 only)
filemon- monitors file accesses
handleex- shows the handles (files, directories, registry keys, DLLs) that a process has open. Now supports Windows 9x/Me.
nthandle- shows processes using specific files (NT only)
listdlls- command-line utility to list open .dll files
openlist- shows open files on your system.
pagedfrg- A utility to defragment system files.
pmon- process monitor (NT only)
portmon- COM/LPT port monitor
pstools- A suite of programs to list and modify processes (NT/2000 only):
PsGetSid- display the SID of a computer or a user
PsInfo- display info about the Windows system.
PsKill- kill processes by name or process ID
PsList- list detailed information about processes
PsLoggedOn- see who's logged on locally and via resource sharing (full source is included)
PsLogList- dump event log records
PsService- view and control services
PsShutdown- shuts down and optionally reboots a computer
PsUptime- shows you how long a system has been running since its last reboot
regmon- displays registry accesses.
sdelete- Secure delete--really deletes and overwrites a file.
ShareEnum- Lists windows sharepoints.
tcpview- Graphical TCP connection monitor.
tdimon- TCP and UDP monitor.
tokenmon- NT/2000 security token activity viewer.
PostScript interpreter is installed in
ghostscript interpreter and viewer can be run from the batch files
gv.bat found in the
The following shortcuts (in
\scripts) have been added to
ens- Shortcut to enscript.exe with no parameters.
enscript- An interface to GNU enscript which converts to PostScript and then prints the document using GhostScript. See local docs. Various programming languages can be pretty-printed with the
enscriptps- Like enscript above, but it uses PrintFile (see below) to print the file directly to a postscript-capable printer without using GhostScript.
gs- Starts GhostScript interpreter
gsc- Starts GhostScript interpreter in command-line mode
gv- Starts GhostView
gsp- Prints the specified files to the default printer.
gspc- Prints the specified files to the default printer in command-line mode.
PrintFile - a file
printer, which handles n-page up printing, print spools, binary formats and
PostScript files. Use
prfile to start.
Gnuplot 4.0 can
be run by the batch file
GNU Privacy Guard (GPG) encryption/decryption utilities are included.
Note: Before first using gpg: By default,
gpg will read
and write its secret information to the directory
which it automatically creates. You may want to modify this. The
GNUPGHOME environment variable does not work on Windows builds
as of this writing; you will have to set a registry entry. To do so, copy
/registry/gnupg.reg from the CD and modify it to
match the directory you want to use, then run
[filename] on that file. (By default, this file will change
gnupg to write to
A:\, allowing you to carry your keys on a
floppy disk, which may be what you want. In that case, you can probably
just double-click that file on the CD and it will be changed automatically.)
Rather than give a summary of its use which may give you a false sense that you're actually being secure, I recommend that you first read the documentation:
Steganography is the art of hiding secret messages in "plain sight," that is, embedding secret messages in an image or text file that your enemies can see. If you have enemies, that is.
Snow steganography tool hides messages in plain text files. [Local Docs]
The following internet tools are available:
blat- A program to send e-mail from the command line or from a CGI program.[Local docs]
csscheck- Cascading Style Sheet validator.
/scripts/wireshark.batwill copy a Winpcap file to the proper place if necessary and start wireshark.
tidy- a program for validating and correcting HTML documents. Use
tidy -hfor help. [Local Docs]
TidyGUI, a GUI-based HTML validator.
wget- a tool for fetching files or whole web sites via HTTP or FTP. Includes SSL support via
lynx- The good old text-mode and command-line browser, also good for automating downloads. [Local docs]
cURL- another program for command-line downloads from the Web, including FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. Includes SSL support (via
(nc), a great little tool for making/listening to TCP/IP communications, with original docs and NT release notes
VNC is a powerful system for
remotely displaying and controlling your computer's desktop. You can run
the utilities by clicking the icons in the
\vnc directory, or
using the scripts listed below.
The shortcuts in the
\vnc\shortcuts folder must be adjusted to
match your system. If you wish to install VNC directly onto your system,
(which will install the shortcuts into your start menu,)
\vnc\installs\winvnc directory contains a full install
script (but you could run it just as easily from the CD.)
The VNC client can even run as a Java
applet from within your browser! The Java classes are in
allows you to control your desktop from your Palm! Install the file
\VNC\palm\palmVNC.prc to your Palm. To use the scaling
features, run the
palmvnc script as indicated below. [Local docs]
The following command-line scripts (in
\scripts) will allow
you to start and stop VNC services and viewers:
vnc- Starts the VNC server. See the server docs for command-line switches which allow VNC to be installed/deinstalled as a service, etc.
vncview- Starts the VNC viewer. See the viewer docs for information on command-line switches.
vnckill- Stops the running vnc server process.
palmvnc- Starts the Palm VNC service (slower, but with scaling when running a Palm client.)
Tools and drivers for various databases may be shipped on your copy of the APE, if space permits.
The Oracle Instant Client for Oracle 10g is in the
directory. This directory is added to your search path by the
ape.bat script. For connecting from within Java, you may need
%APE%/ojdbc14.jar (and possibly other jar files
contained in that directory) to your CLASSPATH.
The JDBC driver for MySQL is
installed in the
/mysql directory. You will need to add
To connect to a MySQL database from Java, use something like:
The APE is not intended to be an anti-virus package, but the minimal Stinger anti-virus scanner is in
/stinger directory. You can run this by typing
The Android development tools are available for developing applications for the Android platform.
Many tools, including gcc compilers for Palm development, have been added.
Due to the nature of these compilers, you must run in native compiler mode
or Palm compiler mode. To run in Palm mode, execute the
palm.bat file in the root directory of the CD after running
ape.bat as below. Be sure to change all instances of
d: to match your CD drive.
C:\WINDOWS\COMMAND.COM /E:4096 /K d:\ape.bat d: d:\palm.bat
C:\WINNT\SYSTEM32\CMD.EXE /T:1F /K d:\ape.bat d: d:\palm.bat
Your command prompt will read
(APE-Palm) to indicate that you
are in Palm mode. It wasn't easy to get this set up, and it may not be
completely right. Read the steps I took.
pilrc- Resource compiler
pilrcui- Resource previewer
qab- Web clipping app builder (use
/hfor help) [Local Web Clipping Guide]
emulator- Palm emulator
\PalmDev\SuperWaba). Includes VMs for both PalmOS and Windows. [Sketchy Local Docs] More documentation at Wabasoft. You need to install
waba.pdbto your Palm.
Comments or questions to Alan Eliasen: firstname.lastname@example.org