Keep the kids safely away from your media

I’ve been wondering for a while how to lock my young son away from 13+/15/18 material on my AppleTV that he shouldn’t be seeing. The AppleTV does have a ratings system that you can exploit with something like MetaX to insert a PG-13 classification or similar. But with aTV Flash I have just realised there is a simpler solution - you can solve the problem with complexity.

By creating a complex nested structure of directories 4 layers deep, you can essentially put a PIN code on some media and keep it safe. So for example, say you had:

~/Media/LockedAway/6/2/4/9/yourfile.avi

Only people who knew to look in that particular sub-directory would find the media. Anyone guessing has a 1 in 10000 chance of getting it right…

How do you create this cunning nested subdirectory? Simple, use my Perl script:

#!/usr/bin/perl

for ($count1 = 0; $count1 < 10; $count1++) {
  for ($count2 = 0; $count2 < 10; $count2++) {
    for ($count3 = 0; $count3 < 10; $count3++) {
      for ($count4 = 0; $count4 < 10; $count4++) {
            `mkdir -p $count1/$count2/$count3/$count4`;
      }
    }
  }
}

Simply put that text into a file named “create-dirs.pl” and copy that file with SFTP to a subdirectory “LockedAway” under the “Movies” directory on your AppleTV.

To run it, login via SSH to your AppleTV using Terminal.app (password: frontrow):

ssh -1 frontrow@appletv.local

now change directory to your Movies/LockedAway folder:

cd Movies/LockedAway

set executable permissions for the file:

chmod +x create-dirs.pl

and run the script:

./create-dirs.pl

The script will run for a minute or two creating all the directories and when it is done you should see a "-bash-2.05b$ " prompt again. Back in your SFTP client, you should find that under LockedAway you now have LockedAway/0, LockedAway/1, LockedAway/2 … LockedAway/9 and under each of those you have subdirectories number 0 to 9: LockedAway/0/0, LockedAway/0/1, etc. and so on from LockedAway/0/0/0/0 up to LockedAway/9/9/9/9.

All you need to do now is choose a combination (say LockedAway/1/9/6/6) and always copy your non-family-safe stuff into that directory. Then on your AppleTV, navigate to the same folder and you’ll see your files. If you ever forget where you put your files, or put a file in the wrong directory, just “ssh” into your AppleTV, “cd” into Movies/LockedAway and type:

find . -iname "*.avi"

This will show you the paths to every media file in your “locked area”.

Be careful to navigate back out of your private area when done or the next user will see the files (and your combination!). Caveat emptor!

I know this isn’t the most user-friendly, Mac-like, GUI-ish or sophisticated way of achieving video safety in families, but until something else comes along I’ll be using this and, hopefully, the idea is useful to someone else too :slight_smile: