Google Ads

You know, I am just not a fan of the smug attitude Apple sometimes displays in regards to their potential customers - those of us who still use Windows. One of the most obnoxious things I’ve seen Apple do in recent years came with their second-to-last operating system update, Leopard (OS X 10.5). When you connect to an SMB share (like a Windows share), the machine shows up in the Finder with a beige CRT displaying a Windows 9x-style blue screen of death, or BSOD.

It’s not hard to remove, but I’ve been using Macs at home more and more recently, and I got sick of having to manually remove it every single time I reinstalled (or updated) OS X. So, I made a super easy shell script that lets you fix the icon with one click. You can either download it at the end of this entry or make one yourself.

Making bash shell scripts in OS X is easy - open up TextEdit to get started. Either go up to the Format menu and select Make Plain Text or use the Command+Shift+T keyboard shortcut to convert your new file into plain text.

plaintext

Then, all you need are the commands, one on each line, that are used to replace the BSOD icon with the generic OS X computer icon (which looks like an Apple Cinema Display):

cd /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/
sudo mv public.generic-pc.icns public.generic-pc_lame.icns
sudo cp com.apple.mac.icns public.generic-pc.icns
echo "script complete."
exit

This script copies the original BSOD icon to a backup file, and makes a copy of the generic Mac icon and gives it the appropriate file name. Save this file as something like BSODfix.command.

In order to make it executable, you need to set the correct file permissions. Open up Terminal and navigate to the directory where you saved your script (I keep my shell scripts in Users/Claire/Scripts), and run chmod 755 BSODfix.command to set global execute permissions on the file. Now you can double-click the file in Finder to run it. Terminal will open up and prompt you for the password for your current user account (assuming you are currently logged in as an administrator), execute the script, and exit.

Quit terminal, restart your computer (for some reason, killing and restarting the Finder doesn’t always make the change take effect), and map to an SMB share to see the change.

If you don’t want to write the script yourself, you can download it below:

BSODfix.command

2008.10.27 [Mon] | 08:53 AM

Since OS X 10.4 (Tiger), Apple has provided a remote desktop capability integrated into the operating system. However, unlike Windows (which uses a proprietary protocol called RDP), Apple chose to use the VNC protocol for their remote desktop server and client.

I wouldn’t recommend using Apple’s VNC server; it’s far more restrictive than alternatives. Vine server is much more robust and customizable, and it’s open-source.

However, if you find it necessary to use Apple’s built-in VNC for whatever reason, you may also find yourself needing to control the server from the command line (for instance, if the server application fails and you need to SSH into your remote Mac to restart the service).

I found out the hard way that the Perl script Apple uses to restart the server stores the VNC password in plaintext. This is wrong on a lot of levels, one being that it’s completely user-unfriendly. At any rate, after some Googling around, I found a Perl script that will encode the password with the necessary key. You can then input the encoded password in your VNC restart command.

The Perl script looks like this:

perl -nwe 'BEGIN { @k = unpack "C*", pack "H*", "1734516E8BA8C5E2FF1C39567390ADCA"}; \
chomp; s/^(.{8}).*/$1/; @p = unpack "C*", $_; foreach (@k) { printf "%02X", $_ ^ (shift @p || 0) }; print "\n"'

Paste this at your bash prompt and hit enter. You can then type your password, hit enter again, and have the encoded password ready to go. Once you have your encoded password, you can use the kickstart command to restart the VNC server. Apple has some documentation on using kickstart here.

Overall, Apple made a major blunder by not correctly encoding the password with the kickstart utility. Hopefully this will be remedied in a future release of OS X.

Google Ads