Urania

A blog named for the muse of Astronomy containing musings by an astronomer

Archive for the ‘Command Line Tricks’


HINT: Maple from the Command Line 0

Posted on July 18, 2007 by Juan

Maple is a nice symbolic mathematics pages from the Canadians at Maplesoft. Our school as a site license which is an awesome deal as students can buy personal copies for much less than the price of a typical textbook. As such, our students can be expected to use the software for their classes. One of the really slick bits on the Mac is you can run Maple from the command line (useful when I need to compute an integral quickly).

I am running Maple 11, so I just placed the following alias in my ~/.tcshrc file (I run tcsh by default because I am old school and dislike bash):

alias maple "/Library/Frameworks/Maple.framework/Versions/11/bin/maple"

If you are running the PPC version of SciSoft, it messes around with some environmental variables, breaking this trick, you can instead use
alias maple "unsetenv DYLD_FALLBACK_LIBRARY_PATH; /Library/Frameworks/Maple.framework/Versions/11/bin/maple; setenv DYLD_FALLBACK_LIBRARY_PATH /scisoft/lib"

If you are using Maple 10, substitute a “10” where you see an “11” above.

HINT: Getting AASTeX Installed on a Mac for all users. 0

Posted on July 13, 2007 by Juan

NOTE: I will assume you have installed teTeX (a modern LaTeX package) in one of a variety of ways. Personally I recommend either Fink or MacPorts. However you can get a lot more information about this by visiting the “Getting Started” page at the Mac TeX website.

AASTeX is used to help typeset publications for all the major astronomical journals (at least in the US). You have two fundamental options for installing AASTeX on the Mac:

  1. Single User Install: The easiest way is to download AASTeX (the version for LaTeX 2e) from http://www.journals.uchicago.edu/AAS/AASTeX/ and then just copy the aastex.cls file to whatever directory contains your latex source code for your paper. It should work just fine if you do that.
  2. Global Install: If you want to make the AASTeX class file available to all your Mac users, you need to install it globally where the laTeX installation keeps its latex libraries. The easiest way to do this is to first determine where teTeX keeps its laTeX libraries (referred to as TEXMFMAIN). One simple way to do this is to type the following from the command line
    texconfig conf | grep TEXMFMAIN

    Once you have found that directory, edit the Makefile that comes with AASTeX so that INSTALLDIR equals that directory and fire off a
    sudo make install

    Once you have installed AASTeX, run
    sudo texconfig rehash

    And you should be set.

P.S. – Most teTeX installs come set to European paper sizes. If you want US Letter size, just run the configuration program and set US Letter size pages as the default using:

sudo texconfig

Its text menu driven and pretty straight forward.

HINT: Sportlight indexing for Perl, PHP, Ruby, and Fortran Coders 0

Posted on July 12, 2007 by Juan

This hint is my writeup based on a similar hint at MacOS X Hints for Making Spotlight index PHP files.

I write a lot of perl code using BBEdit, and wanted Spotlight to index my perl files. To do this, a simple modification of the the SourceCode.mdimporter is needed. First find the type (according to
Spotlight) of the files you want indexed, as PerlFile.pl using this command (via the Terminal):

mdimport -n -d1 PerlFile.pl

which outputs something like:
Import 'PerlFile.pl' type 'public.perl-script' no mdimporter

Now take that file type (public.perl-script) and add it to the Info.plist file located at /Library/Spotlight/SourceCode.mdimporter/Contents/Info.plist (If you can’t find this file, you likely installed Apple’s MacOS X Developer Tools yet). Add it in the array for LSItemContentTypes.

I added:

<string>public.perl-scrip</string>t<string>
public.php-script</string><string>
public.python-script</string><string>
public.ruby-script</string><string>
public.fortran-source</string>

Now you can index your source code files in one of three ways:

  1. Go to a Terminal prompt and type:
    mdimport -r /Library/Spotlight/SourceCode.mdimporter

    to process all your source code files and import them into Spotlight’s database.
  2. Go to the Terminal and trigger the re-importation of the directory containing your source code using
    mdimport /PathToFiles/ToImport
  3. Go crazy and re-import everything on your drive using
    sudo mdimport /

To see what is going on, add the -d1 switch to the mdimport command.

First Post 0

Posted on July 12, 2007 by Juan

This is my web blog which I will be using mostly to note things of interest to me. Its not necessarily meant for public consumption and will contain such exciting topics as

  • The installation of software of interest to astronomers on MacOS X machines (I’ve had experience getting AIPS, IRAF and Hectospec’s packages to run under MacOS).
  • Bugs in the MacOS operating system that need to be crushed in order to run some astronomical software on the Mac.
  • Notes on neat command line tricks I discover.
  • Musings on other topics such as teaching or academia.

Don’t expect to see anything too daring yet, I don’t have tenure.

  • Translate

  • Astro Pic o' the Day

  • Archives

  • Admin



↑ Top