Mac OS X – Show / Hide Hidden Files in Finder

I always forget how to do this because I toggle this rather sporadically so I’m adding it to the public record.

To show hidden files in Finder pop open your terminal and type the text shown in the screen grab below.

To go back to hiding files we obviously just flip the AppleShowAllFiles flag to FALSE.

*Update*
As noted in the comments its nice to have the text available for easy copy and paste into your terminal.

Show:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

Hide:

defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder

*Update 2*

You can use this script toggle between states:

# check if hidden files are visible and store result in a variable
isVisible=”$(defaults read com.apple.finder AppleShowAllFiles)”

# toggle visibility based on variables value
if [ "$isVisible" = FALSE ]
then
defaults write com.apple.finder AppleShowAllFiles TRUE
else
defaults write com.apple.finder AppleShowAllFiles FALSE
fi

# force changes by restarting Finder
killall Finder

You can also download an Automator application which will toggle hidden file visibility here:

http://www.brooksandrus.com/downloads/show_files.zip

Flvtool2 – Flash Video (flv) Metadata / Cue Point Injector and Cutting Tool

I’m a couple of years late to this party, but there’s a neat Ruby based tool, Flvtool2, which allows you to stamp metadata in flv files, insert cue points–both navigation and event, and allows you to slice and dice an flv file based on defined in and out points (kudos to Norman Timmler for writing this app and making it available to the community).

Unfortunately, the documentation for this tool is almost non-existent – SPAM apparently took down the wiki. Another problem, I encountered at least, is that the builds available from RubyForge contain bugs. Fortunately, you can download the source from svn where the bugs appear to be fixed.

Since the documentation is so sparse I thought I’d post some example usage where the search bots might possibly find it.

If you wish to insert onCuePoint events into your flv, Flvtool2 accepts an xml / yaml file that declares the cue point data. The screen shot below illustrates how you can insert both “event” and “navigation” cue points. Navigation cue points should theoretically corresponds to a keyframe stamp so that an flv seek action can be assured of starting from the given timestamp.
xml tag declarations used by flvtool2

You can view a list of of the possible commands by typing the following in your commandline shell.

flvtool2 -h

To simply print out all of the metadata for a given flv simply use the following command.

flvtool2 -P some.flv

To insert cue points declared in the tags.xml file use the -A command with the -t switch. In the example below I’ll actually chain a few commands together (Add, Print, Update). The -P prints the metadata from the given file to stdout and the -U updates the flv with an onMetaTag event.

flvtool2 -APUt tags.xml src.flv output.flv

Here’s what running the proceeding code might look like.

The next example illustrates how to carve a new flv that’s four seconds long from the source flv based on in / out timestamps in milliseconds. To do this use the -C command along with the -i / -o switches.

flvtool2 -Cio 1000 5000 src.flv splice.flv

If you are interested in using flvtool2 as part of an automated ant build script you’ll need to invoke Ruby via the exec task, pass in flvtool as the ruby application to run and then pass in the desired commands, switches and arguments. The screenshot below is an example of this in action.

So there are just a ton of applications for a tool like this for both client and server-side applications which should be obvious to just about everyone likely to read this post. If you’re bored, it’s also extremely interesting to to take a peek at the metadata injected by various commercial encoders or video sharing sites (gootube et al). Enjoy!