Posts tagged “apple”.

Script it

I had another IcyDock, firewire, external, drive enclosure fail again. So instead of throwing good money after bad, I instead acquired a NAS (network attached storage) device. Specifically, I got a Synology DS211J from Amazon with reward points on my credit card. Yes, I paid $0 for it and it’s the best money I never spent.

The NAS, which I named NASty, holds two SATA drives and has a host of RAID configurations available. I have two 2TB drives mirrored, split into three Volumes, with access controls, users, passwords, and a smorgasbord of applications, not the least of is a VPN server so I can access my files remotely when I’m away from home. On one Volume I moved all of my Music, and set iTunes to look on the remote drive for my music database. Which is good for sharing my music through the house, but was causing me some pain and mental anguish on my laptop when I forgot to first ‘mount’ the drive before opening iTunes.

When opening iTunes prematurely, as the case is, my podcasts would download to the local drive and I would have to clean it up manually to get it back onto the NAS and have it recognized in the iTunes program. Annoying. So, I thought to myself, I should script it so the NAS music share mounts first, then iTunes opens. So… I programmed an iTunes Launcher for my new setup.

-- iTunes Launcher
-- for use with a music database stored on a remote NAS

-- define our Function to check if an application is running
on appIsRunning(appName)
	tell application "System Events" to (name of processes) contains appName
end appIsRunning

-- check for the existence of our music share
	alias "/Volumes/music"
on error
	-- if the share doesn't exist mount it
	tell application "Finder"
		mount volume "music" on server "NASty" in AppleTalk zone¬
			"*" as user name "music-user" with password "pass-word"
		-- not my username nor my password… 
	end tell
end try

-- Test to see if our mount is really there.
tell application "Finder" 
	if not (exists POSIX file "/Volumes/music/itunes/.NAStyIsMounted") then
		display alert "NASty Music Share not Mounted!" as critical giving up after 90
	end if
end tell

-- Is iTunes running 
if appIsRunning("iTunes") then
	-- if so, do nothing
	-- otherwise start iTunes
	launch application "iTunes"
end if

-- bring iTunes window to the foreground
tell application "iTunes"
	tell window 1
		if not visible then set visible to true
	end tell
end tell

So just a tiny little script that checks to see if the music share is mounted already. If not, I mount it. I then make sure it mounted, if I can’t see the hidden file on the share I go OLD SCHOOL and ABEND. Otherwise I continue and check to see if iTunes is running. If not, I start it. And to finish up, now that I know iTunes is running, I bring it to the front.

I saved the script as an application. I changed the icon from the default AppleScript icon to a custom icon. Then I dropped the Launcher program onto my dock. So now I not only have a graphical reminder on my dock, but I removed the iTunes icon so I can’t accidentally open just the program without mounting the share first.

Amazingly, it works like a charm.

MacBook Meltdown

I sit at an “L” shaped desk in my home office; to my left is my personal mac book pro, in front of me is my work PC. I was working feverishly this afternoon when I smelled something burning. Specifically, I smelled plastic burning. I jumped up from my desk panicked that my house was on fire.

I dashed out of my office headed for the closest of two fire extinguishers we keep in the house when I realized with a shock that I no longer smelled the burning plastic out in the hallway. Relieved that it wasn’t the pre-wired Christmas tree melting downstairs I bolted back into my office, feared an electrical fire, and frantically worried over what action I could take if it were the wiring in the walls.

I entered my office and sniffed the air in front of me like a bloodhound. It came from my desk. Then I saw wafts of faint grey smoke which rose over the back of my MacBook Pro. I moved all the wires away from my computer. I quickly disconnected the power cord, Firewire 800, and USB wires that were plugged into the device; fearing a short circuit I inspected each wire.  The wires were fine, not warm at all and still a smell like burning nylon persisted. I picked up the computer and sniffed it. Immediately I knew something inside my MacBook Pro had melted.

I opened a window, turned on the overhead fan, and aired out the room. The smell dissipated quickly. I realized I felt a little light headed; that too quickly passed.  With the power cord unplugged, the laptop only running on battery power, everything seemed fine.  I immediately started a backup of my data.  I’ve heard horror stories about Apple support replacing whole devices and not restoring data — that wasn’t going to happen to me.  I then looked for the support number and called Apple Care.

My Apple Care phone experience was extremely pleasant. My computer is under warranty and they scheduled an appointment for me to meet a technician at the local Apple Store in town. While I was on hold, on a whim, I plugged the power cord back into my computer.  I immediately smelled the burning plastic again, and unplugged it promptly.

So, some time in the not too distant future an Apple technician will crack open my laptop and either see a stray bit of plastic that got too close to something hot, or identify a faulty part and replace it.  Either way, I think my next Apple purchase will be Apple Care for my MacBook Pro.

The Game of Life

I broke down a few weeks ago and bought games for my kids computer. I picked up the “Game of Life, Path to Success”, “Monopoly, Here and Now”, and “Scrabble” all for the Machintosh in a “Board Game Trio II” pack. They came to about $8 a title after shipping, which is my price point for trivial software. I thought it was a great deal. But it got even better when the software didn’t behave as expected. So now I didn’t just have great cheap games. I had great cheap games that “non-privledged users” couldn’t save their progress on. I called support, and they were very polite and helpful, but I was going to have to wait for the guy who actually programmed the games to get back into the office for the solution to my specific issue. It might be a day or so.

Anyone who knows me, knows I’m not one for waiting. And, I figured it was a challenge. Could I figure it out before the programmer emailed me with the answer? The clock was running. I had myself a hacking opportunity!

So, I first started up the game as a privileged user and created a character with a name of “Rumplestiltzkin”. I then searched for \*umplestiltzkin\* with the UNIX command find, hoping that the character’s name was used in the save file on disk. No luck. Without knowing the filename, and not having the character’s name in the filename, I was at a big loss.

Then I said to myself, “Self, there aught to be a program that tells you what files are being accessed on your system.” To which I replied, “Well, self, if such a program exists, I bet google knows about it!”

I searched Google for a few minutes and came up with a shareware/nag-ware program called fseventer which allowed me to see what files were being accessed real time. The only file that looked promising was /Applications/Game\ of\ Life\ -\ Path\ to\ I opened gol.txt up in Textedit, scrolled to the bottom, and there in clear text was Rumplestiltzkin! I had found the save file!

Now when I did a directory listing with the command “ls -al” it listed gol.txt as -rw-rw—- which means that the owner and group may read and write to the file, but everyone else has no access. This is easily fixed with a quick terminal command run in the directory where gol.txt exists: “chmod 666 gol.txt”. What that does is sets the file to “-rw-rw-rw” permissions, which allows everyone on the system to read and write to the file.

666 may seem a bit satanic, but trust me, it’s not. The permissions are binary, and the values for each group are READ which equals 4, WRITE which equals 2, and EXECUTE which equals 1. These three bits in binary, if they were all on would be 111, or 7 in decimal. For read and write permissions only it would be 110 in binary or 6 in decimal. For read only permissions it would be 100 in binary or 4 in decimal. And for read and execute permissions it would be 101 in binary and 5 in decimal. For more information about unix permissions… read a book, google unix permissions, or take a look at this cool unix permission calculator!

I figured it out before I read the email reply from the support department, however, I didn’t fix it before the email arrived. Can I claim a tie?

To Change One Simple Picture

I really like Apple’s new Snow Leopard OS. If you look back through my blog you’ll see my trials and tribulations I went through, lamenting the upgrade. I felt that Leopard was never quite up to par — that it fell short of Tiger in many ways. I really liked Tiger, that was a solid operating system.

But in any good OS, you have to be able to tweak it; customize it in seemingly mindless little ways to make it yours. It starts with naming your machine. There’s a big difference between a machine named “Dilbert” or one named “Loki”. And you want to start from there and expand. Tweaking your background, cursors, file icons, screen animations, you name it… it should be tweakable and fit into your Norse Mythological scheme or your Dilbert Philosophy.

Please don’t misunderstand me where I’m about to go next. I love astronomy. I like Apple’s sense of style and design. But, I never liked the Aurora.jpg that was the default background for Leopard. I wasn’t happy when it became my default background when I upgraded to Snow Leopard from Tiger. And I wasn’t happy when changing my Desktop background as an administrator there wasn’t a checkbox to Change Login Background also.

It annoyed me. I really grew to despise that image. And for months I’ve searched and searched for the solution — how do I eradicate Aurora.jpg from displaying on my mac? Finally I recently became obsessed and refusing defeat I continued searching Google. Coincidentally, Googles new “Bing” tools made the difference and I finally found the solution.

Open up Terminal and enter in the following commands.

cd /System/Library/CoreServices/
mv DefaultDesktop.jpg DefaultDesktop.old.jpg
sudo mv DefaultDesktop.jpg DefaultDesktop.old.jpg
sudo cp /Library/Desktop\ Pictures/Nature/Horizon.jpg ./DefaultDesktop.jpg

I chose to copy the Horizon.jpg image to the DefaultDesktop.jpg image. But you can choose any image you like.

And that is how to change the default background image for the login page on Mac OS X version 10.6 otherwise known as Snow Leopard. And just as a side note and a way to help other “search engine challenged people” like myself, it helps to figure out the file name of the image you’re searching for and not just call it space image, leopard default image, and other generic things like that.

I’m a little disappointed in Apple. I think it was MUCH too complicated for the Mac experience. I think Apple should pay closer attention to making every little thing easy to customize… and easy to restore to its default values in future versions of their Operating Systems.

It will be the little things that matter in the near future too. The devil is in the details. Google is pressing the court and developing Android to complete with the iPhone. It won’t be long until they follow in Apple’s footsteps and take a Linux kernel and make an OS that rivals Mac OS (although Apple used BSD Unix instead of Linux, I can’t see Google making that same choice).

Customizing Front Row in Snow Leopard

I picked up a new apple remote when I got my MacBook Pro the other week and I just started watching my media files yesterday evening through Front Row. It was pretty Mac-tastic, except I thought the menu was kind of cluttered. You see, I use iTunes, but I do not ever intend to use the Apple iTunes Store — it’s my personal boycott for the crappy things that have transpired online around independent developer’s iPhone applications being removed from the store for no good reason.

Do you see where this is going? I didn’t want to stare at iStore options. When I selected TV Shows, it told me I didn’t have any TV Shows, and I should go buy some from the iStore. Ha! Not any time soon. So, I wondered if I could get rid of it? A quick google search yielded some disappointing results. Wiki’s that were defunct. Questions unanswered. I was getting discouraged. Until I checked google’s cache. On one defunct wiki link, google still had the content cached. Google FTW! (That’s geek-speak for “Google for the win!”)

Now, the information on the link was incorrect, but it gave me enough insight into how things worked to be able to figure it out for myself. The following mini-howto is the result of my research and hacking.

To remove the “TV Shows” option from the Front Row Application in Mac OS X Snow Leopard

  1. close Front Row
  2. open a terminal window
  3. cd /System/Library/CoreServices/Front
  4. sudo mv TV.frappliance TV.frappliance.old
  5. type in your password
  6. ls


You can remove any of the Front Row options, or buttons, by changing the name of the corresponding file listed above. For example, if you didn’t want podcasts, you would ‘sudo mv Podcasts.frappliance Podcasts.frappliance.old’.

Fire up Front Row and the option is gone. To put it back, you just need to remove the .old from the directory name with a command like, ‘sudo mv Podcasts.frappliance.old Podcasts.frappliance’ and the menu button will reappear.

It’s all about sharing.