The APE 3.1.5

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

What is the APE?

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.

Quick Start

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.

Manually Running the APE

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.)

(Windows 95/98/Me)
C:\WINDOWS\COMMAND.COM /E:4096 /K d:\ape.bat d:
(Windows NT/2000)
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 steps: cd to the directory containing the APE, and run

ape.bat PATH

where PATH is the path to your CD drive or mount point.

For example, if your CD-ROM drive is d:, your command line would be: d:\ape d:

If you receive "out of environment space" errors, you may need to add to your config.sys:

SHELL=C:\command.com /e:4096 /p

Efficiency Tips

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 registry directory, 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 bash or tcsh which are infinitely better shells but handle filenames and paths differently.

Java

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 \jdk1.1.8\swing\swingall.jar.

The 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 a .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.

Additional Java library files (in the directory \javalibs:)

Java-related utilities:

Java Servlets and Java Server Pages (JSP)

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 \javalibs\tomcat.

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 directory of 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 installation.

J2EE

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.

Perl

For Perl, the ape.bat 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.

Installed packages:

C/C++

MinGW Compiler

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.)

Cygwin Compiler

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 executables. The mingw 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:

Compilation:
-mno-cygwin -I$(APE)\cygwin\usr\include\mingw
Linking:
-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 gmake with MAKE_MODE set to unix (the APE default) instead of msdos you will probably need to change the backslashes to forward slashes.

Other C++ Tools:

TCL/TK/Expect

TCL 8.0 is available from the cygwin distribution.

Python

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 the PYTHONPATH environment variable. Python has never been used extensively so the configuration may need some work.

Ruby

Ruby is an up-and-coming language that has the kids all excited.

BASIC

Yabasic, a lightweight BASIC interpreter with graphics support, exists in the \bin 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.

Fortran

Sure, why not? The APE is all about inclusion. The GNU g77 is here and it may even work, but it's never been tested.

Frink

The latest version of my evolving Frink language is installed. Just type frink or frinkgui or frinkswing to run. Frink changes often; for the latest documentation, visit my Frink webpage, or try a web-based interface to Frink.

This also contains my Frink sample programs in /frink/samples. A further description of these is available from my website's Frink Sample Programs page.

Emacs

"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) Emacs.

XEmacs is set up to run from the \xemacs directory. This installation is quite comprehensive. [User's Guide] Note: docsrv must be running to use this link. See above.

GNU Emacs is ready to run directly off of the CD in the \emacs folder, and included additional setup improvements in the \site-lisp directory.

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:

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:

Cygnus UNIX Utilities and Libraries

The alternately glorious and infuriating Cygwin utilities and libraries are extracted in the \cygwin 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. The ape.bat script will add \cygwin\bin to your path.

MKS UNIX Utilities

The 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.

Shells

A variety of lovely shells are provided, including bash, tcsh, sh, 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 have a HOME environment variable set, ape.bat 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.

XWindows

The Xming XWindows server for Windows is available. Use xlaunch to run.

Version Control

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 /subversion directory.

Video

Various utilities for playing and converting between video formats are installed:

Useful Binaries and Scripts

The directories \scripts and \bin and contain many useful utilities. ape.bat will add them to your path in that order.

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 \SysInternals directory.

Printing Utilities

The Ghostscript PostScript interpreter is installed in \gstools. The ghostscript interpreter and viewer can be run from the batch files gs.bat and gv.bat found in the \scripts directory.

The following shortcuts (in \scripts) have been added to simplify printing:

PrintFile - a file printer, which handles n-page up printing, print spools, binary formats and PostScript files. Use prfile to start.

Graphics Utilities

Graphing Utilities

Gnuplot 4.0 can be run by the batch file \scripts\gnuplot.bat.

Encryption

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 c:\gnupg, 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 the file /registry/gnupg.reg from the CD and modify it to match the directory you want to use, then run regedit [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

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]

Web/Internet/HTML Tools

The following internet tools are available:

VNC

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,) the \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 \vnc\java.

PalmVNC even 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:

Databases

Tools and drivers for various databases may be shipped on your copy of the APE, if space permits.

Oracle

The Oracle Instant Client for Oracle 10g is in the /oracle directory. This directory is added to your search path by the ape.bat script. For connecting from within Java, you may need to add %APE%/ojdbc14.jar (and possibly other jar files contained in that directory) to your CLASSPATH.

MySQL

The JDBC driver for MySQL is installed in the /mysql directory. You will need to add %APE%/mysql/mysql-connector-java-3.0.14-production-bin.jar to your CLASSPATH.

To connect to a MySQL database from Java, use something like:

Class.forName("com.mysql.jdbc.Driver");
java.sql.DriverManager.getConnection("jdbc:mysql://hostname/database?user=username&password=password");

Documentation:

Anti-Virus

The APE is not intended to be an anti-virus package, but the minimal Stinger anti-virus scanner is in the /stinger directory. You can run this by typing stinger.

Android Development

The Android development tools are available for developing applications for the Android platform.

Palm Development

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.

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.

Commands:


Comments or questions to Alan Eliasen: eliasen@mindspring.com