posts tagged with the keyword ‘osx’

2011.02.16

As long as we’re taking about OS X, I have a fix for when you try to screen share another computer on your network and the dialog box hangs… Really, this is super-annoying. You can get rid of it by rebooting, but I hate rebooting. You can’t easily hide it because it floats above other windows, and you can’t force quit it. Well, not easily…

In your favorite terminal program (I personally like iTerm but Terminal.app will do) type the following:

ps aux | grep NetAuthAgent

And you should see something like this:

pete  38146  0.4  0.2  2823072 13644 ??  S  8:28AM 0:43.59 /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent
pete  40131  0.0  0.0  2425700   264 s001 R+ 10:26AM 0:00.00 grep NetAuthAgent

That first line, with the /System/Library/CoreServices/NetAuthAgent.app bit is the one you want. See the first set of numbers in that line? That’s the process id (or PID.) Once you know the PID, you can do the following:

kill 38146

Typing the kill command followed by the process id should get rid of the dialog box.

Alternately, you can type:

killall NetAuthAgent

killall is a little more risky, as it kills processes based on name, not the PID, so if you have multiple process with the same name, it will kill them all. Hose things up enough and you’ll need to reboot, which is what we wanted to avoid doing in the first place.

Aren’t bugs fun?

2011.02.14

I still use iDVD a lot, because it’s quick and easy to spit out a DVD either with simple menus, or an as auto-play disc with no menus at all… but every now and then, I get this warning about the file being locked.

This specific error came up when I copied the file to another Mac, but I’ve seen similar locking problem even on the same Mac and even with the same user…

Here’s the fix: command-click on the file in the Finder, and select Show Package Contents from the contextual menu. This will open a Finder window showing you the files.

Go into Contents, and then Resources, and look for the project.lock file, and delete it. That should fix it.

Bonus Tip: If you want a fast way of recursively opening all folders in list view, select the main folder, and hit command-option-right arrow. Want to close them all? command-option-left arrow.

2011.01.26

Perl

I needed this script last week… See, our ISP had a bit of downtime, roughly 7 hours of downtime actually, but throughout the day there were some periods where our connection would be up for a few minutes before it went down again.

#!/usr/bin/perl

use Net::Ping;

$p = Net::Ping->new("tcp", 2);
$p->{port_num} = getservbyname("http", "tcp");
$host = 'www.google.com';

while (1) {
if ($p->ping($host)) {
print "Internet is up!\n";
# the next two lines will only be useful on osx
$cmd = 'say -v Victoria "Internet is up"';
system ($cmd);
}
else {
print "...\n";
}
sleep(5);
}

To alert me to these few golden minutes of Internet connectivity I whipped up this script. It keeps trying to reach some server (in this example I’m using the highly-available www.google.com) waiting just 5 seconds between each check, and if it reaches the server (meaning our Internet connection is up) it prints “Internet is up!” and on Mac OS X it also says “Internet is up.” I made it say that so I could keep staring at what I was working on and be alerted audibly when the connection returned.

I was tempted to run this on our Mac jukebox so it would announce to the entire office when the connection was up, but by that time things seemed back to normal.

Obviously you could reverse this code to check if a server is up instead of down, and in fact one of my monitoring systems does just that. If you’re ever at the 2XL Networks office and hear “Attention! The server is not responding!” being yelled from one of the Macs… you know there’s a problem.

2011.01.20

Time Lapse Bot 3

I built the original “Time Lapse Bot” in September 2009 before BarCampMilwaukee4 happened. I managed to get an old office chair that someone was throwing away and thought I could put it to good use to move around the iMac and camera rig I had attached to it. You can see the original Time Lapse Bot post for more info.

The main issue with the original Time Lapse Bot was that if you unplugged it, you had to boot it up again, set the clock, and then restart the image capture. We thought about a UPS to give it a bit of “unplugged” time, but never added one.

Next up was Time Lapse Bot 2 which used an old clamshell iBook in place of the old iMac. This made everything much lighter but because the battery couldn’t hold a charge we still suffered the inability to unplug it and move it while it was running. (We typically solved this problem with really long extension cords.)

Time Lapse Bot 3

Time Lapse Bot 3 is the next step in Time Lapse Bot technology. We’ve taken an old PowerBook G4 (donated by Matt Gauger) which has a good battery in it, and paired it with a Canon ZR800 MiniDV camera, which also has a good battery. The result is a unit that can run on battery (at least for a few hours) and starts charging the batteries as soon as you plug in the AC power cord.

The entire unit is housed in a custom case which allows for easy transport. By “custom case” we’re referring to the plywood box that I constructed and painted black. That’s what we consider the pinnacle of “custom cases” around here.

The software that runs Time Lapse Bot is EvoCam by Evological. It’s $30 and well worth it. It’s feature packed, and rock solid. If you’re putting together a Mac-based time lapse rig that uses a video camera, or a web cam, or whatever, I highly recommend it.

Here’s a few of the time lapse videos we’ve made with the help of Time Lapse Bot.

We’ve finally reached a point where we are fairly pleased with Time Lapse Bot and it’s performance, so this is obviously not the time to sit still and relax. We’re currently working on a few upgrades to Time Lapse Bot, and hope 2011 brings even more Time Lapse Bot goodness to all the folks who enjoy time lapse videos…

(Thanks for reading this. If you’re reading it on Facebook or Google Reader or somewhere else it got syndicated to, consider visiting the original post, especially if you’d like to leave a comment.)

2010.09.02

I recently worked on a project that required making audio files out of text files, which is something I’ve done before, but haven’t done regularly since 2000 or so when I was making cassette tapes of web pages. There’s a simple way to do this using Mac OS X.

Keyboard System Preferences

Open you System Preferences and go to Keyboard and select the Keyboard Shortcuts pane. Click on Services and scroll down to Text until you see Add to iTunes as a Spoken Track and check that box.

TextEdit

Now open TextEdit and select some text and control-click (or right click depending on your computer input device) and you’ll see a contextual menu item for Add to iTunes as a Spoken Track. Select it.

iTunes

Now jump over to iTunes and you’ll see the track. It’ll be called Text to Speech.

M4A audio file

In iTunes you can highlight your track and select the File menu and then Show in Finder (or just hit command-R) and the Finder will open the folder containing your file. It’s an MPEG-4 Audio file (also known as an AAC file) with an m4a extension.

ITunes can obviously convert the file to an MP3 for you, but if you want another format (like OGG) you can use Audacity. You should be able to do whatever you need to do with it from there, (And that whatever you need to do with it bit was the deciding factor for this specific project.)

I was really hoping to use an existing test-to-speech API on the web to automatically generate the audio. Google has an unofficial Text-To-Speech API (go on, try it.) Seeing as it’s “unofficial” and didn’t work in the way I wanted to use it, and there is an awesome group where people ask about APIs and ToS and no one answers, I skipped it.

AT&T also has a great text to speech demo online, which clearly spells out how you can’t use it, which is quite helpful. (Basically you can’t use it for anything public or commercial, which sucks, but I’m glad they come right out and say it.)

There are other options (almost all commercial) including services like iSpeech, which I may look into. There may be some open source text to speech options, but as to how good they are, or how easy they are to get up and running, that is yet to be seen… or heard, as it were.

(Note: I’ve got a follow-up post coming about Mac OS X Text to Speech via the command line.. stay tuned!)

« Older Entries | Newer Entries »


buy the button:

Buy The Button