Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Set up an Apple II as an OS X terminal System
I set up an old Apple IIc as a terminal for my Mac mini; you can read the full details of the project in this post. The basic steps involved are as follows:
  • Connect the Apple II serial cable to a Serial-USB Adaptor
    • $ cd /dev
      $ ls tty.*
      tty.KeySerial1
  • Load terminal emulation software on Apple IIc
  • Use screen to connect and run getty
    • $ screen /dev/ttys.KeySerial1
    • Ctrl-A, Shift-: and then exec ::: /usr/libexec/getty std.1200
Ideally one should configure getty to run via ttys, yet something (USB controller?) hangs on the two different Mac Minis I've tried this on, mucking things up. However, a benifit of using screen is the ability to cut-and-paste between machines.

[robg adds: Definitely not your normal OS X hint, and there are obviously many easier solutions. Still, putting an old Apple ][ to work like this is pretty cool.]
  Post a comment  •  Comments (5)  
  • Currently 3.33 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[12,041 views] Email Article To a Friend View Printable Version
Choose an audio input device based on sound levels System
I frequently record Keynote presentations I give using my Mac (using ProfCast). Typically I use a wireless lapel mic and have my sound preferences pane set to record from Line In. However, on occasion I forget to turn on my mic, or the battery is dead, and so I get nothing but silence. In these instances, I'd like to be able to use my PowerBook's internal mic as a backup, so I set about finding a method using AppleScript to accomplish this.

I eventually got something working with the help of a freeware program called AudioLeak that monitors the RMS sound level of the selected input source. Together with a little GUI scripting, I can have my Mac try to connect to Line In, but switch to the internal mic if the line is dead. Here's the final script.

I have this script embedded in a droplet, so that I drag a Keynote file onto the droplet and it runs this script along with some other stuff I want to do just before starting a presentation (i.e. check monitor resolution, hide all other apps, etc), and then launch the file in Keynote. Alternatively, you could have this script run periodically using iCal or cron or an idle handler.

In addition to AudioLeak, you'll need to have GUI scripting enabled (in System Preferences » Universal Access).

[robg adds: I haven't tested this one.]
  Post a comment  •  Comments (3)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[8,874 views] Email Article To a Friend View Printable Version
Reduce monitor resolution to ease calibration System
There have been some interesting things going on in the browser battlefield regarding color managing, as seen in these two blog posts:

Safari brings color-managed browsing to Windows
Color Spaces

The web, as it currently stands, is basically an unmanaged environment. But that might change with Safari for Windows and future versions of Firefox. Calibrating your monitor will be more and more important if this turns out to be true. So I thought I might share something that I've learned from calibrating current large LCDs.

Eyeballs are no replacement for hardware calibration, but they are free and readily available, as is Apple's ColorSync Display Calibrator. The problem is that monitors have come a long way in recent years, but Apple's software is essentially a port from OS 8 and haven't changed much since. The Apple logo and grey background were fine for 800x600 and 1024x768 days, but look pretty small on 1920x1200.

If you change the resolution to 640x480 before calibrating, you get two advantages: One, the Display Calibrator takes the entire screen; two, the image gets blurry and you don't have to squint as much in order to blend the Apple logo with the background. I found that changing the resolution led to a much better result. Just remember to choose Hide Others from the Apple menu before changing the resolution, or else you'll end up with lots of tiny windows everywhere when you get back to your native resolution.
  Post a comment  •  Comments (7)  
  • Currently 3.40 / 5
  You rated: 3 / 5 (5 votes cast)
 
[11,042 views] Email Article To a Friend View Printable Version
Take screenshots in many formats via the keyboard System
I've used a simple collection of apps called ScreenShotApps (30-Mar-2005 zip file on that site) and Spark to create hot keys for different types of screenshots -- PICT, PDF, JPEG, PNG, BMP, and TIFF are all a keyboard shortcut away.

After expanding the ScreenShotApps bundle, store the bundled mini-programs on your hard drive, then use Spark to assign each to a keyboard shortcut. I've chosen to use Shift-Command and the number keys. So Shift-Command-1 gets a full screen PICT, -3 is a PDF, -5 is a JPEG, etc. I use -2, -4, and -6 for selected region screenshots in those same formats. As with the built-in screenshot tool, you can add the Space Bar for object capture, or Control to capture to clipboard.

I've explained this all in more detail in this PDF.

[robg adds: taketo's native language is not English, so I've rewritten the above hint based on my understanding of the process from his original submission. I have not done any work on the PDF, however, but it's still quite easy to follow along. The ScreenShotApps site is very slow to load, but it will eventually show up. I haven't tested this myself on 10.4; it worked for the author on 10.3.]
  Post a comment  •  Comments (2)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,106 views] Email Article To a Friend View Printable Version
Create identical tiled windows in most apps via AppleScript System
After experimenting with certain scripts to tile windows and reduce screen cluttering distraction, I wrote the following AppleScript and assigned it to Control-W with Quicksilver:

property maxWindowWidth : 1000
tell application "Finder"
  set screenSize to bounds of window of desktop
  set availScreenWidth to item 3 of screenSize
  set availScreenHeight to item 4 of screenSize
end tell

tell application "System Events"
  set dockProps to property list file "~/Library/Preferences/com.apple.dock.plist"
  set dockSide to the value of the property list item "orientation" of dockProps
  set dockTileSize to the value of the property list item "tilesize" of dockProps 
end tell

if dockSide is "bottom" then
  set availScreenHeight to availScreenHeight - (dockTileSize + 10)
end if

set sideMargin to (availScreenWidth - maxWindowWidth) / 2

tell application "System Events"
  set myFrontMost to name of first item of (processes whose frontmost is true)  
end tell

if myFrontMost is "Finder" then
  set myTopCorr to 22
else
  set myTopCorr to 0
end if

try
  tell application myFrontMost
    set allWindows to (every window where visible is true)
    set n to count of allWindows
    set windowOffset to 0
    repeat with x from 1 to n
      set windowOffset to 20 * (x - 1)
      tell window x
        set bounds to {sideMargin + windowOffset, 30 + myTopCorr + windowOffset, (availScreenWidth - sideMargin) + windowOffset, availScreenHeight - (n + 1 - x) * 20}
      end tell
      set x to x + 1
      if x is equal to (n + 1) then exit repeat
    end repeat
  end tell
end try

You can adjust the width of the resulting tiled windows by changing the value of maxWindowWidth at the top of the script.

[robg adds: If you've never moved your dock to one side of the screen or the other, the above script will fail (because the 'orientation' key won't exist in the Dock's preferences file). The fix is to move the dock to one side, then move it back, and this will work as described. I'm sure there are AppleScript solutions that could check for the key's existence before trying to extract it, but such solutions are beyond my limited AppleScript skills.]
  Post a comment  •  Comments (12)  
  • Currently 1.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[12,978 views] Email Article To a Friend View Printable Version
Fix a crash related to Keychain and updated programs System
I have been having issues with my keychains where the "XXX app has been updated. Do you want to allow the new version to access the same keychains?" dialog would keep coming up -- even after clicking Change All. No matter what I would do, the window would come back and end up hanging forever, forcing me to reboot.

After hours of frustration I found this article on unsanity.org that contained the fix. Open Terminal and type:
sudo mv /var/db/CodeEquivalenceDatabase \
/var/db/CodeEquivalenceDatabase.old
That resets the database used to determine what apps can access the keychains. The problem is now gone!

[robg adds: Read the linked article at unsanity for a lot more detail about how this specific file was identified as the culprit.]
  Post a comment  •  Comments (2)  
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[7,896 views] Email Article To a Friend View Printable Version
Create a 'hidden at login' Admin account System
Although security on a Mac is debated heavily by both sides, I prefer to stay safe and use a standard account for my day-to-day uses, and an extra Administrator account for my, well, administrative uses. The thing that bugs me is that every time I log in, I see a this big login option, Administrator, and that easily tells someone that is physically stealing my notebook that he needs to crack the admin account, and not mine, to hack my system. I prefer to hide the admin account, but I don't really like to use the Terminal.

So, to the hint: from what I've seen, if you create an account named Administrator with a short name of Admin, the computer will automatically hide the account for you. However, this only works when the new Administrator account is the only administrator account in the system.

[robg adds: I tested this hint, and (somewhat to my surprise), it does work. Case matters, though -- make sure you capitalize the short name! In order to have the account auto-hidden, it does need (or so it seems at first) to be the only admin account. My first test failed, and that's because it was the second admin account on the machine. I then converted my standard admin account into a regular account, then created the new Administrator account. On my next login, the Administrator account wasn't listed in the login screen.

However, after logging in as the new admin, I then switched my standard account back to administrator and logged out. This time, the Administrator account stayed hidden. So it seems it has to be the only admin account when it's created, but after that, it will remain hidden if you add additional administrators.]
  Post a comment  •  Comments (26)  
  • Currently 3.60 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[57,986 views] Email Article To a Friend View Printable Version
Possibly speed copies via Terminal System
I was in a hurry trying to back up my iPhoto Library to an external Firewire 400 drive, and was disappointed to see that the Finder was going to take almost an hour to back up all 11GB of pictures I had. I went into Activity Monitor to see just how slowly the Finder was going, and found it was copying at 8MB/sec, with the Finder taking 60% of my PowerBook G4's CPU. So I canceled the copy, opened up Terminal.app, and executed the following command:
cp -r ~/Pictures/iPhoto Library/ /Volumes/myexternaldrive/
Activity Monitor showed cp using only 20% CPU, and maxing out my drives at 23MB/sec! What would have taken an eternity in the Finder took only 15 minutes, thanks to Terminal.

NOTE: If you need to copy files with resource forks, install the Developer Tools and use CpMac (in /Developer » Tools) instead of cp.

[robg adds: On a faster machine, I'm not sure there will be much difference in the speed -- I did a quick test on the Mac Pro (using a 3.22GB folder with a few thousand files spread through 160 folders), and both methods took about the same amount of time. In addition to the resource fork issue, note that cp won't copy OS X alias files; it just throws an error message during the copy.

ditto (included with OS X), however, seems to copy them just fine, and handles resource forks automatically. So I tested again with ditto instead of cp. Whereas the time gap with cp wasn't really measurable, ditto was about 15 seconds quicker than the Finder on my 3.2GB test copy. So if I were copying a huge folder, I'd probably try ditto, as it could save a few minutes of copying time.]
  Post a comment  •  Comments (15)  
  • Currently 2.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[19,995 views] Email Article To a Friend View Printable Version
A fix for 'can't find the default KCHR resource' error System
Yesterday my keyboard suddenly stopped working in anything except for authentication dialogs and the Dock (Command-Tab, Exposť, etc.). I think System Preferences had crashed while I was opening it, but I can't be sure. Luckily I had a second account I use for emergencies such as this, and so I switched across to it. The keyboard worked fine in this account.

I then went through the troubleshooting steps of renaming the Preferences folder in my broken account (using sudo in Terminal) and logging back in, but that didn't fix the problem. Renaming the Library folder, and even trying the same on my home directory, didn't fix the problem. Searching on Google produced only one hit in German. When "translated" with Google, the match suggested that reinstalling the latest combo updater might do the trick. Luckily it did.

I'm posting the information here so that if anyone else who doesn't speak German has the problem, the solution might be easier to find. The other error message you can see in the console.log is TSMProcessRawKeyCode failed (-192). I'd love to know what the problem was, and how it could only affect a single user account and yet not be a setting inside that user's home directory.

[robg adds: I can't test or confirm this one; comments as to the possible cause and alternative fixes are welcomed!]
  Post a comment  •  Comments (3)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[5,590 views] Email Article To a Friend View Printable Version
How to perform an action on change of network System
I have a PowerBook that I move between various networks. Some of these networks have different proxy settings -- see this hint for how that can be handled.

I also had the problem that I wanted NTP to be working, and some of these networks were filtering the ntp packets. It is possible to set /etc/ntp.conf, just like a standard unix ntp daemon. Unfortunately, ntpd will decide that a bunch of the time servers are unreachable, and will stop trying. When you wake your Mac on another network, ntp will lose contact with its last servers, decide it can't do anything, and shut itself down. So I wanted to kick ntpd when I connected to a new network.

The first step was to add iburst commands to the ntp setup, and to decide that SystemStarter restart "Network Time", when run as root, would restart ntpd. I then needed a way to get ntp to be kicked when my network config changed. I found the solution to that in this blog posting: Apple's System Configuration framework keeps track of network connections and when they change. This can be accessed through the scutil command.

Initially I found scutil difficult to use. The man page is horrible, but if you run scuti and then type help at its prompt, then you get a better list of commands.
read more (242 words)   Post a comment  •  Comments (7)  
  • Currently 3.25 / 5
  You rated: 4 / 5 (4 votes cast)
 
[24,825 views] Email Article To a Friend View Printable Version