Archive for the ‘Apple’ Category

NYC Subway Map on the iPhone

Wednesday, July 18th, 2007

Here’s a quick and dirty way of accessing the subway map on your iPhone.

Safari to the MTA’s Subway Map:

http://www.mta.info/nyct/maps/submap.htm

Save as a bookmark, and you’re done.

Remember that you’ll have to load it up prior to using the subway as you’ll lose connectivity. Just load up the page, then open a new browser window so you can keep the map cached.

I’ve found that browsing the map was even easier by stripping out the the MTA’s top banner and navigation bar on the left. So I saved the map (which are 2 gif files), and created a webpage that loaded just the gifs. I then placed it on my server which I can use whenever I want. I’d make the link public, but the map is probably copyrighted, so you should make one for yourself.

Say goodbye to paper subway maps forever!

I CAN HAS iPHONE?

Tuesday, July 3rd, 2007

Safari for Windows Comes Out of Hiding

Sunday, June 24th, 2007

A little over a year ago I noticed the Safari team hard at work on the Windows version. Its nice to see they actually got around to releasing it, even if it is only a beta.

Back then I expected a lot more anticipation, but it seemed like almost no one cared. I guess if you’re using Windows and aren’t satisfied by IE, you’re probably using Firefox already. I know Safari renders more accurately then Firefox, but it doesn’t appear to be as stable (on Windows).

It will be interesting to see if Apple’s entry into the Windows browser market gains any traction. I don’t know how Apple will make it more attractive then Firefox. That is, unless they bundle it with iTunes.

I, for one welcome our new Apple overlords.

Cross Platform Backup Solutions

Sunday, May 20th, 2007

Here is a brief list of cross platform backup solutions that we’ve come across.

Pay
BRU Server
NetVault

Free
Bacula
Amanda
Unison
BackupPC
rdiff-backup
rsnapshot

We are currently giving BRU a try and will post a followup article once we spend some time with it.

Changing IP addresses on OS X Server, and you

Wednesday, May 9th, 2007

When the going gets tough with a computer, we often contemplate whimping out to the nuclear option (AKA reformatting and starting over). But what a relief it was to discover the changeip command found in OS X server. This is quite useful when network changes are made to the network, such as when changing the ip addressing scheme. When running a server and making a network address change, an admistrator may need to do more than to change the IP address in the Network system preference. The original IP address may also be embedded within the configuration settings of some network services such as OS X’s Open Directory.

So in a nutshell, when changing a server’s network settings, make sure that ALL your IP addresses are changed to the new address. It’s the only way to do it on the Interweb.

Read more at http://discussions.apple.com/thread.jspa?messageID=1983848�.

Cross-Platform Network Backup Solution

Monday, May 22nd, 2006

I’m looking for a cross-platform network backup solution to replace Retrospect. If you post a suggestion that I end up using (even in part), you could be the recipient of free stuff. Read on for details.

Without going into to much detail, Retrospect can’t seem to consistently maintain a backup file set that exceeds ~600 GB using it’s Backup Server function. Faced with sporadic “chunk checksum” errors, the backup set has to be frequently repaired or replaced. This has only wasted my time, served to degrade the currency of each backup, and furthered my distrust of the whole system.

The following is a required list of criteria for a replacement solution:

– Backs up to a network location.
– Covers both Macs and PCs. Note that it doesn’t have to be the same software on each platform. I’m looking for a comprehensive solution, not necessarily just one software package.
– Backs up a specific list of directories.
– Updates the backup set instead of overwriting (e.g. sync vs. overwrite).
– Runs invisible to the user.

List of optional, but preferential criteria:

– Searchable.
– Supports an exclude list
– Smart checkpointing (e.g. keeps as many previous states as room allows).
– Configurable from a central location

Possible solutions I’ve found:
rsync on both the Mac and PC to a Mac hosting an rsync server.
SuperDuper on the Macs, x on the PC.

So what do I do? rsync could work but it might be time consuming to setup and troublesome to maintain. SuperDuper might work for the Mac, but that doesn’t help the PC’s.

Please submit your suggestions as comments to this post. If I use any of the posted suggestions I’ll buy the person who submitted the solution an iTMS or Amazon.com gift card. Please use a valid e-mail address when making your suggestions in order to be eligible. Links to viable solutions are permissible.

Windows Version of Safari?

Monday, May 15th, 2006

For the life of me I can’t understand why more people haven’t noticed this. Over the past few months I keep seeing these kind of comments in the Web Kit change log:

“Fix win32 build.
Disable ASSERT redefinition warnings for now.

* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
* kxmlcore/Assertions.h:”

“* kjs/number_object.cpp:
(NumberProtoFunc::callAsFunction): remove trunc() to fix win32.”

“Implement basic theme support on Win32. Still much to do, but
the backgrounds of buttons, textfields, checkboxes and radio
controls now draw correctly. Still work to do for the Classic look
and to get the foreground defaults of the controls correct. …”

Land support for JPEG image decoding on Win32…

I didn’t include the name and e-mail address of the people that made the commits, but it’s easy enough to find it in the log. I will note that each of these commit messages are from Apple employees, and not from some other part of the Web Kit community. The commit logs stop after April 5th.

I just sampled a few days, but that’s an awful lot of attention to the win32 platform, especially seeing that KHTML doesn’t run on Windows last I looked.

Quick Tip: Removing unwanted .DS_Store Files

Tuesday, April 4th, 2006

.DS_Store files are created by OS X to store information relevant to the Finder, such as window positioning, and Finder comments. For the majority of users they go completely unnoticed because by default they are invisible, as are all other files beginning with a period. The easiest way to see them is to pop open the terminal and type in "ls -la ~". What you’ll see are a list of all the files in your home directory, including the invisible ones.

So why care about the .DS_Store file? They are insignificantly small, hidden, and help the Finder out. That is, unless you’re operating in an environment with PCs, or accessing files from a Mac over and FTP client. Then they can become rather obvious and very confusing.

There are a bunch of little applications that can remove .DS_Store files, among other things, but who wants to download an application for something that can be done with a really simple command. Most of the commands I’ve seen involve find executing rm followed by a few other arguments. For the life of me I can’t understand why people aren’t just using the “-delete” argument in find.

Here is my simplified rendition:
find . -name .DS_Store -delete

Yes folks, it’s that simple. find is a Unix tool for locating files. The period is the path to start at. I could have used “/” if I wanted it to start at the root of the drive. Period means start from my current location in the Terminal (usually represented to left of where you start typing in the Terminal). The “-name” tells find what to look for, in this case the pesky .DS_Store file. Lastly -delete tells find to remove the file when it encounters it. Remember that you might have to use the sudo command depending where you want to remove them from.

A word of caution, this command permanently removes the .DS_Store files. It doesn’t move them to the trash. The Finder will replace the .DS_Store files when it needs to. As with any Unix command, please type carefully and fully understand what is going on, before you hit return. There are no “undos,” that’s why it’s a great idea to backup your computer. While this command, when used right should be harmless, backing up could save you from the mess you get into from someone else’s Unix trick, or enabler. I hope I haven’t scared anyone.

Enjoy.

Backing up with launchd and rsync in OS X

Monday, March 20th, 2006

Recently I was entrusted with the task of creating a simple backup solution for a client’s X-Serve. All I needed to do was mirror one directory to a secondary drive each night, as well as once on the weekend to an alternate location. While there are many fine utilities out there for performing backups, such as ChronoSync, and the continually diminishing Retrospect, I opted to take advantage of OS X’s included services.

rsync seemed like the natural choice. I thought about using cp at first but rsync is much more efficient, especially when only a few sub-directories need to be updated, versus having cp rewrite the entire backup directory each time.

Now that cron is deprecated in 10.4, I turned to launchd to run rsync on a schedule. This was the first time that I had tried to use launchd. I was pleased to learn that it’s much easier to configure and use then cron. launchd uses human readable .plist configuration files, which can be loaded on demand with launchctl. To make things even easier there is a utility for editing the launchd plist files called Lingon.

Putting rsync and launchd together proved to be a little more of a challenge then I first suspected. Initially I had tried running rsync directly from launchd but kept getting “launchd: com.firefallpro.daily_backup: 8 more failures without living at least 60 seconds will cause job removal” and “launchd: com.firefallpro.daily_backup: exited with exit code: 12”. A quick look in man rsync informed me that an exit code of 12 is a “Error in rsync protocol data stream.” Not that I know what that means.

After a bunch of research and checking out some examples on the web, most which seem to be incomplete, or untested, I was left with no choice but to read man pages and tinker. The only way to get the rsync to run properly was to trigger it from shell script versus directly from launchd.

The following is my final implementation for your approval, dissection, and hopefully, feedback.

launchd plist placed in “/Library/LaunchDaemons/com.firefallpro.daily_backup”:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/
DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.salesgraphics.daily_backup</string>
<key>OnDemand</key>
<true/>
<key>LowPriorityIO</key>
<true/>
<key>Nice</key>
<integer>12</integer>
<key>ProgramArguments</key>
<array>
<string>/Users/admin/Documents/daily_backup.sh</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>3</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</dict>
</plist>

Shell script placed in “/Users/admin/Documents/daily_backup.sh”:
#!/bin/bash
/usr/bin/rsync -qaEu /Library/WebServer/www/ /Volumes/Backup\ HD/daily;

Note: I ran "chown root /Users/admin/Documents/daily_backup.sh" on the shell script to make sure it would execute rsync as root, and "chmod u+x /Users/admin/Documents/daily_backup.sh" to make it executable.

rsync is being run with “-qaEu”:

  • q: Run quietly, seeing we’re running through launchd.
  • a: Enables a whole bunch of options needed for grabbing a directory and everything inside.
  • E: Extended attributes (get Mac OS resource forks).
  • u: Update forces rsync to skip files for which the destination file already exists and has a date later than the source file.

Once the files were in place I ran "launchctl load /Library/LaunchDaemons/", to load the new configuration files without rebooting. The console still logs some minor errors from launchd and rsync but the shell script executes successfully.

I hope this helps someone, and if I revise my strategy I’ll make sure to update this post.

New Tool

Monday, October 31st, 2005

I recently came across a new way to make posts. I found a OS X 10.4 Dashboard widget called DashBlog. Not that posting was difficult before, but it is a lot faster to pop Dashboard open instead of logging into Blogger, sending an e-mail, or waiting for some other application to load.

My only regret with using DashBlog is the inability to preview my posts. It’s not that I’m prone to making mistakes in my HTML tags, it’s that I always seem to foul something else up. I guess I’ll see over time how well it works.