Miscellaneous computing tips

A small collection of hints, mostly relatively simple things that for one reason or another took me way too long to figure out. I didn't find a simple how-to for any of these on Google, so I'm putting them up here.

I'm not an expert on emacs Lisp, VMS, or anything else that is on this site. If you know an easier or better way to accomplish these tasks, please let me know. (My contact information can be found at my homepage.)

Emacs 22 meta key in OS X

Emacs 22 has been released for OS X. I needed a way to remap the Emacs meta key to the Mac option key instead of the command key, so tab completions wouldn't be intercepted by the OS and result in a window switch.

With previous releases of Emacs for OS X, the solution was to put this in your .emacs file:

(setq mac-command-key-is-meta nil)

This would change the default OS X meta key (command key) to the option key. This didn't work for me in Emacs 22 under OS X 10.3.9. The alternate option that does work is:

(setq mac-option-modifier 'meta)

There are similar variables you can set for other Mac keys, like the function key and the command key.

FTP from a Remote VMS Server to Unix

Even the simple act of getting files from a server running VMS can be confusing if you only know Unix file systems. There are manuals for VMS available all over the net, and if you need to know how to use the operating system you should look there. If you simply need to ftp some files from a remote VMS server, this example may help.

|~ [1]> ssh user@server.com

Enter your password to login. If your data directory uses the logical name your_data, find the full (translatable to Unix) file path by:

$ set def your_data
$ sho def

The output is something like:

DEVICE_NAME:[DIR]

Now, use the command

$ sho logic

to show the complete logical names of the your device (sort of analogous to the Unix pwd command.) The output includes things like:

"DEVICE_NAME" = "A$DISK:[DATA_A.DATA.]"
= "A$DISK:[DATA_B.DATA.]"
= "A$DISK:[DATA_C.DATA.]"
= "A$DISK:[DATA_D.DATA.]"

Now you can look for the file by explicitly searching directories shown by the sho logic command.

$ set def A$DISK:[DATA_A.DATA.DIR]
$ dir

Look in each directory to find the file you are interested in. Once you have found it, exit VMS and use sftp in the normal way:

$ logout
|~ [2] > sftp user@server.com
sftp> cd /A$DISK/DATA_A/DATA/DIR
sftp> get file.dat

Concatenate PDF files

Matthew Skala has a great page detailing various ways to accomplish this task. The most effective for me was Ghostscript:

gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf in3.pdf ...

dvips options

I almost always use pdflatex to typeset files, so I forget the useful options for dvips. The options I normally use are:

dvips -Ppdf -R0 -o foo.ps foo.dvi

The -Ppdf option optimizes for pdf creation, the -R0 option lets you use full Unix path names for finding your graphics files, and the -o option prints to a PostScript file rather than the printer.


Back to homepage

SSL logo