Skip to content
Archive of entries posted on May 2006

Stupid Finder tricks

As a unix geek, I like to see and sometimes browse /usr for various reasons.  While I can do it from the command line, it would be nice to be able to do it in the Finder.  Thanks to information I found in the article Top Ten Mac OS X Tips for Unix Geeks I was able to make /usr not hidden anymore.  (The article is from 2002, but this bit of imformation is still relevant.)  The following command removes the HFS+ hidden attribute and that lets the Finder show it.  As the full path below implies, you need to have the developer tools installed.

# /Developer/Tools/SetFile -a v /usr

color grep

Every once in awhile I come across a feature of a piece of software, generally, a small utility that I hadn’t known about and that shows immediate value.  Today Jon showed me the --color flag for GNU grep.  It uses color to highlight the term you were searching for in the line returned.  For example:

# grep –color=auto -i metadata todo.txt
Metadata Functions to Move:
   MetadataView…Make sure only our indexed items are passed up.

Its a very simple thing, but one of those that I’m surpised I haven’t been using.  I know have a shell aliases for that.  See the grep documentation for more information.

[Update 6/2: linux.com has a great article on GNU grep's new features which talks about the color.  One that I'm particularly expected about is the ability to use Perl-style regular expressions.]

Where is your Howie Mandel now?

So, last night I was inspried by NBC’s Deal or No Deal (which is still the dumbest name ever) to ask Mark the important question of: Porn or No Porn?

He replied:

well, there’s 300 billion sites out there, but if i open up one site, i might see a man doing another man and uh let me see what my friends think 

It’s okay, he’s elite!

We borrowed my parent’s minivan over the past weekend.  We were using it when the odometer happened upon a fun mile, I couldn’t resist taking a picture.

31337.jpg

I love cheesy poofs

Thanks to Kris and Joe, you can now see the digitial projection of my South Park self.

MeInSouth Park.png

You too can use the South Park character generator

Concatenate PDFs

I often like to print out many web pages to read on the train.  To not waste paper I like to print them 2 up and double sided.  If the printer supports it, I also like to staple the pages.  On Linux, I use Firefox to print to postscript, then used a2ps to have the PS files combined, 2-uped, and short-side duplexed.  I’d then manually staple it, as there was no good way to tell the print center at work to staple it.  I’d use a command line similar to this:

a2ps -Eps -Afill -stumble 1.ps 2.ps 3.ps 4.ps

I tried this approach under OS X, but the problem is that the postscript that is generated on OS X is so detailed that it takes forever to process to print out, on the order of 2 minutes of processing per article.  Since PDF is the spooling format for printing in OS X (coming soon to linux) I thought I’d look to see if there was an easy way to concatinate PDF files so I could then have the regular printing interface (via Preview) handle the 2-up, double-sided, stapling goodness.

After much searching around I found this article and later this web page.  Combining a bit from both, I came up with following that works really well in my few days of testing.

texexec --pdf --paper=letter --pdfarrange --result all.pdf 1.pdf 2.pdf 3.pdf 4.pdf

It runs really quickly (especially in comparison to the a2ps method) and then I just open all.pdf and print from there.  It requires that you have teTeX installed.  On both Linux and OS X I had this installed as part of the prerequesets for docbook and doxygen.