Arvont Hill: February 2007

Monday, February 5, 2007

Laser Guided Parking - Intro

I was in Home Depot a couple of months ago and I saw an accessory for garages used to replace the tennis ball that people sometimes hang from their ceilings to keep themselves from going to far into the garage. However, this device was pretty cool. A laser beam was projected onto the dashboard in the place of a tennis ball.

I had to have my very own, but the one they were selling was only compatible with a specific garage door opener I don't have. Then I thought I could build one of these pretty easily. I just had to figure out how to do it. My challenges were:

1. Finding a cheap laser
2. Turning the laser on and off. (It's a waste to keep it on all the time).
3. Finding a place to mount it without doing too much construction.



Over the next couple of weeks I brainstormed and came up with an idea for the circuit. Like most garage door openers mine has a light on it that comes on when the door is opened or closed. After a while the light goes off. After thinking for a while I figured I could use a photoresistor in a circuit to turn the laser on and off. In this post I show a block diagram of the little system and a photo of the circuit.



I actually built this thing, and I am working the bugs out right now and when I get it working the way I want I'll send more info.

Friday, February 2, 2007

Let another user on your Mac use your iTunes Library

The following script allows one user to copy his iTunes library to another user. The user receiving the library will then have read access to all of the files in the library of the original user.


1. Make sure iTunes is not running on either account

2. Give read access to the Music folder of the original user with

chmod -R 755 /Users/sourceuser/Music
Where sourceuser is the username of the person sharing his library

3. Here's the script. Copy and paste it into an editor and save it as copyituneslib. You have to make the script executable, so start up Terminal.app and run

chmod 755 copyituneslib


Start copying here.

#!/bin/bash

if test -z "$2";
then echo "Usage: sudo copyituneslib sourceuser destinationuser";
exit;
fi

#copies my "iTunes Library" file to another user
#i have to set permissions on my iTunes folder to allow
#everyone to read it though.
#you also have to run this script as an administrator with the sudo command.

#you will have to do this once
#chmod -R 755 /Users/sourceuser/Music
#Where sourceuser is the username of the person sharing his library

#This means anyone with access to your computer will have read
#access to every file in the Music folder

cp /Users/$1/Music/iTunes/iTunes\ Library /Users/$2/Music/iTunes/iTunes\ Library

#since this whole script has to be run as root(a.k.a. administrator)
#we have to change the owner back to a normal user
chown $2 /Users/$2/Music/iTunes/iTunes\ Library

echo
echo
echo "Check to see that the library was copied."
echo "If it didn't work, make sure iTunes on the destination account"
echo "is not running"
echo



4. Run the script. If you saved it somewhere in your path you can just type

sudo copyituneslib sourceuser destinationuser

or else you have to type

sudo ./copyituneslib sourceuser destinationuser

provided copyituneslib is in your working directory.