Changing the screenshot directory on a Mac

April 30, 2009

Note: This post was migrated from my old blog software. It hasn't been cleaned up yet (and might not ever be). Don't be surprised if the formatting, links, images, etc... are messed up.

On Macs, there are two great hot-key combinations that can be used for doing screen captures.

  • command + shift + 3 = full screen capture
  • command + shift + 4 = a partial screen capture based on a box you draw.

By default, when you make a grab with these commands the output files are saved directly to your desktop. If you have a messy desktop, they can be hard to find. Using a little command line magic, you can change this output location to any directory you choose. The command itself is:

defaults write com.apple.screencapture location /output/path/directory

You would just need to change "/output/path/directory" to the location where you want the screen grabs to go.

I got found this command on this page from the Mac Developer Tips site. Just putting it here so that I can find it easier in case I ever need it again.


Unix Command Line Tools for Windows

April 30, 2009

Note: This post was migrated from my old blog software. It hasn't been cleaned up yet (and might not ever be). Don't be surprised if the formatting, links, images, etc... are messed up.

I work on Mac, Linux and Windows machines during the course of an average day. A lot of this work is done on the command line. Since underneath a Mac is the heart of a Linux type machine, the basic commands that work on one also work on the other. Windows machines are a different story. Lots of commands that work on Mac/Linux are different on Windows machines or simply don't exist at all.

For example, when you want to see what's in a directory from the command line the Mac/Linux command is "ls", but on Windows, it's "dir". Since most of my time is spent with Mac/Linux I end up trying to use "ls" frequently when I'm working on a Windows machine. This doesn't hurt anything, but it doesn't work and it is a little break in the concentration.

command-line-ls.png

The good news is that since most of the command line tools on a Linux machine are open source, they can be ported to different operating systems. This is exactly what was done with the Open Source project UnxUtils. It's a collection of most of the key command line tools Linux folks are used to working with. If you spend most of your time on Mac/Linux but have to bounce around the Windows command line on occasion, I highly recommend them.


Awesome video of a moment in time

April 30, 2009

Note: This post was migrated from my old blog software. It hasn't been cleaned up yet (and might not ever be). Don't be surprised if the formatting, links, images, etc... are messed up.

Found via Laughing Squid. I would hire these guys. Created by Stink Digital.


Controlling Subversion svn with Perl

April 10, 2009

Note: This post was migrated from my old blog software. It hasn't been cleaned up yet (and might not ever be). Don't be surprised if the formatting, links, images, etc... are messed up.

Controlling Subversions "svn" command with Perl can be a little tricky. The biggest issue is the fact that svn errors are sent to STDERR instead of STDOUT. If you are running the svn command via backticks, perl only captures STDOUT which means you won't see errors. One way around this is to setup the command you fire off in Perl so that it sends STDERR messages to STDOUT so that 100% of the svn output goes back to your Perl script. This can be done by using something like:

my $response = `$cmd 2>&1`;

With that, both the STDOUT and SDTERR output is captured in "$response". If you check out this page on perl.com, you'll see how to determine which content is sent to STDOUT and which is sent to STDERR. This could be used to split out the responses are respond accordingly in your script. I like to approach it a little differently.

Since I already know what the svn command I send will do if it works, I don't really care about the success messages. I only need to know if something goes awry so I can deal with it appropriately. To do this, I use svn's "-q" argument for quite output. With this set, all the commands I use don't return any content to STDOUT if they succeed, while the report errors to STDERR. So, if nothing comes back, everything is good, but if I get a response, something went wrong.

A simple script that tries to export would look like this:

#!/usr/bin/perl -w use strict;

my $svnCmd = 'svn -q export http://www.example.com/svn/path';
my $svnResp = `$svnCmd 2>&1`;

if($svnResp)
{
  print "Something went wrong. SVN Error:\n";
  print $svnResp;
}
else
{
  print "Success!\n";
}

Since there isn't a svn server at the above example.com URL, running this as is would fail and respond with something like:

Something went wrong. SVN Error:
svn: PROPFIND request failed on '/svn/path'
svn: PROPFIND of '/svn/path': 405 Method Not Allowed (http://www.example.com)

If you change the URL to an actual repository you have access to, you'll receive the "Success!" message if you are able to output. Once you have the ability to determine the success or failure of the svn command, it is a lot easier to manage Subversion via scripts. The other benefit of this is that if you run the script in a crontab, the STDERR doesn't get kicked over to send out emails.


Java Classpath for Mac OS X Leopard

April 08, 2009

Note: This post was migrated from my old blog software. It hasn't been cleaned up yet (and might not ever be). Don't be surprised if the formatting, links, images, etc... are messed up.

Doing a little Java development on the Mac. Just making a note to myself about XOM (an XML Object Model). According to the web site, "XOM™ is a new XML object model. It is an open source (LGPL), tree-based API for processing XML with Java that strives for correctness, simplicity, and performance, in that order.", and "XOM is designed to be easy to learn and easy to use. It works very straight-forwardly, and has a very shallow learning curve. Assuming you're already familiar with XML, you should be able to get up and running with XOM very quickly."

Sounds worthy of looking into.

From a higher perspective, in order to utilize XOM the xom-1.2.1.jar file (which can be downloaded from the XOM page), must be added to the Java class path. On Macs, one possible location for this is '/Library/Java/Extensions/'.


Donte your computers

March 31, 2009

Note: This post was migrated from my old blog software. It hasn't been cleaned up yet (and might not ever be). Don't be surprised if the formatting, links, images, etc... are messed up.

Quick link that I saw today for tips for donating your old computers. More importantly, a search tool where you can find places to donate computers based on zip code. I've had problems finding places to donate gear to before, this should help a lot. If you've got old gear, this is something you should think about.


My first internet video post

March 23, 2009

Note: This post was migrated from my old blog software. It hasn't been cleaned up yet (and might not ever be). Don't be surprised if the formatting, links, images, etc... are messed up.

I'm a stills guy. Not a video guy. It took me over a year with my latest point and shoot to actually think about the fact that it has video and to give it a try. Even longer to get the first real clip shot and posted. Today is the day. Here is my first video internet post.

This Way To The Egress from Stimulating Pixels on Vimeo.

This is the tail end of the crowd leaving Bryant-Denny after the 2008 Iron Bowl where the Tide beat the stew outta Auburn. Final score, a 36-0 shutout. Watching the fans move at roughly the same speed across caught my eye and I decided it would make a worthy video. This was after most of the fans had already filed out. Next time I'm there, I'll see if I can get on the ramp earlier and see what it looks like with more people packed together.


Farewell, Galactica

March 23, 2009

Note: This post was migrated from my old blog software. It hasn't been cleaned up yet (and might not ever be). Don't be surprised if the formatting, links, images, etc... are messed up.

While I'm sad that Battlestar Galactica is over, I'm happy with the way it ended.

Going into the last few episodes, I would wait longer and longer to actually watch each one after the broadcast. I think there were two reasons for this: 1) I didn't want one of my favorite shows to be over and, 2) I was afraid I wouldn't like the way it ended. All in all, my fears about how they would handle the final chapter was unfounded. Some parts didn't get quite as much focus as I would have expected, but overall, it worked for me.

I'm not one to do a lot of extra research on a show, but I wanted a little more on this one and came across this interview with the producers that answered a few more questions about the show. I'm glad I read that. Makes me even happier with the show.

Here's to resolution, redemption and clean slates.


Go To Index Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106


© Alan W. Smith
RSS Feed