Email    LaTeX    Other Bits   Scripts    Vim    Wilkes         Index

Shell Scripts

E-Mail Related

    frm displays a mailbox digest, similar to the standard unix from, but in a more readable format.   (screenshot)

    RunMutt is an applescript that allows drag-and-drop opening of mailboxes in a new Terminal window.

    send pipes files containing an e-mail message into sendmail. It facilitates sending messages written off-line or by scripts such as sendgrades (below). This script also pairs nicely with at, to send a message, written late at night, out first thing the next morning.

    sendgrades reads a csv file (created in Excel) and prepares a grade-summary e-mail for each student. The script is handy to periodically provide students with a snapshot of how they are doing, although the implementation is somewhat byzantine.  sendlabgrades does similarly for lab grades; it was created after several experiences with MSWD’s mail-merge convinced me that it was easier to write a script. (example files)
    Also see the gradesheet syntax highlighting file and the send script above.

System Tools

    Filesystem

    fsynch is a simple-minded file-syncing program. In “export mode,” it checks a list of files and packs those that have changed since it was last run into a zip archive. In “import mode,” it unpacks the archive and places the component files them where they belong, which may differ from the location on the source computer.
          This script is my way of keeping select files synchronized between home and work computers — calendar, address-book, bookmarks, etc — through a weekly cron job. Note that the script naïvely assumes the file on the source computer is newer than the one on the destination computer.

    mvln moves a symbolic link pointer from one target to another (eg,  mvln foo v1 v2  will change  foo→ bar_v1.ltx  to  foo→ bar_v2.ltx ).

    rapporteur executes a command (specified by the user) and sends the output of this command to the user by e-mail. This wrapper was written to allow launchd agents to send output the way scripts run by cron did.

    symlinker creates a relative symbolic link from a file to a directory. The desire for this arose when I began using TimeMachine: absolute symbolic links on the backup drive pointed to the current version of the file, rather than to the version on the backup drive, but dissecting a long path to create a relative symlink was tedious. Hence, a script to do the work.

    unearth looks through a Time-Machine backup drive for unique versions of a file (ie, strips out duplicates from different backup dates) and allows the user to choose among them.

    various widgets A handful of recipes from personal periodic cleanup scripts, which:

      · purge downloaded files after a week
      · Reset the system volume and screen brightness
      · Verify that the backup disk is mounted (and remount it if necessary)
      · Unmount volumes that frequently get left mounted
      · Rebuild a locate-database for user-files
      · Rebuild a locate-like database of hard-linked files

    etc.

    proxy enables/disables the OsX web-proxy settings from the command line. As some sites don’t play well with privoxy, this allows filtering to be toggled on or off conveniently.

    NoDoze was written to solve the problems of screen-dimming and computer sleep during presentations. The Mac Store now sells caffeine which does likewise. NoDoze disables dimming and sleep, then restores the settings. The file linked above works with High Sierra (OS 10.13); an older version works with Os 10.11 (El Capitan), and an even older version works with OS 10.8 and before. (Haven’t tried other OS versions.)

    SetFireWall toggles between two sets of ipfw firewall rules, with the IP numbers of the host and the DNS, and the outside interface determined on the fly. Useful with dynamic IPs, or on a laptop that is often on different networks.

Time, Date, Calendaring

    calendar is a replacement for the standard unix calendar program. It can handle event scheduling such as “every third Tuesday” and “every second Saturday of the month.” Unlike the standard program, it also sorts the entries and separates them by day.   (screenshot)
    A related program, CalendarWindow will open a small Terminal window displaying the day’s calendar entries, in the corner of the screen. It runs as a daily cron (er, launchd) job.   (screenshot)

    timer is a kitchen timer, of sorts, that rings either at a given time or after a given interval.

    chimes plays sound-files on the hour and the quarter hours, when called by cron/launchd — a clock feature that went away with Mac Classic. (Perhaps I just miss Sanborn tea?)

    RogationEmber calculates the dates of Rogation Days and Ember Days for the current year, and prints them in a format itable for calendar.

Text, Word Processing, Printing

    lview is a script to process and view LaTeX files using Preview.app, leaving all the ancillary clutter (.log and .aux files, etc.) in /tmp. This can be conveniently called up from vim’s command line: “! lview %” (or a vim-shortcut to that effect).
    LaTeXview is an applescript wrapper for lview, which allows drag-and-drop processing of LaTeX files. Its innards are a hard-link to the lview script.

    mswd2pdf is a bash script that opens a document in Microsoft Word and saves it as a PDF.  It works with OS 10.13 and Word-2016.
    mswd2pdf-10.8 is an applescript that does the same thing for Word-2011 on OS 10.8. Not my creation, but handy enough for automated scripts that it deserves a bit more web-presence. This version works with Word-2011, whereas the original was for Word-2008.

    pdf2pdf combines multiple pdf (or ps) files into a single pdf, using ghostscript. If desired, the resulting pdf file can be encrypted.

    prps (print postscript) sends a pdf or postscript file to a printer after a delay, during which I can run down the hall to insert letterhead or scrap paper. It also processes dvi files and sends the resulting postscript file to the printer, and will warn the user if the printer is in use.

    RunVi is an applescript that allows drag-and-drop opening of text-files in a new Terminal window.

etc.

    ana generates anagrams for a given word. Granted, this is reinventing the wheel, but it made for a neat project.

    ClassesTaught queries the Registrar’s list of classes to produce a list of course sections taught by a given faculty member, for a range of semesters. Useful for DPC Report authors and TAP members.

    histo produces a histogram. Two tries at using Excel to make histograms convinced me that it was easier to do so by hand. After ten years of doing it by hand, I got around to writing a script that takes a column of data from the clipboard (or an input file) and creates a histogram from it, in both pdf and ps formats. This script was converted into an app for a colleague who preferred buttons to commands.

    laxw downloads the daily Los Angeles Times crossword and offers to print it.

    weather downloads and pretty-prints the weather forecast from wunderground.com .  Requires lynxw3m, or equivalent.  (An older telnet script was faster, but the site it relied on is no longer maintained.)