How to Test RAM Under Mac OS X

Whenever I get a new stick of RAM for my Mac or PC, I’m always eager to just plug it in and start using it to its fullest, but having worked on hundreds of computers and encountering dozens of bad memory modules has convinced me that thorough testing is a must. While off-the-shelf PCs can run a copy of the free Ultimate Boot CD tool to perform RAM tests, Macs are a little bit more complicated in this respect. If you’ve purchased AppleCare for your Mac, it comes with a bootable TechTool Deluxe disc, but you’re otherwise left to your own devices when it comes to hardware tests.

Fortunately, with a little preparation right now, you can boot your Mac into Single User Mode and do a complete RAM test in the future. While you can run the necessary software in a fully-booted system, I recommend doing testing in Single User Mode where there are far less programs loaded in memory, and less chance of an important system component getting corrupted if your machine freezes or kernel panics — common symptoms of bad memory. A modified Mac OS X boot CD would be ideal, but that’s another post for another day!

Download Memtest

The testing setup isn’t terribly complex; I’ve taken the liberty of putting together an installable package which will put the Memtest utility into your /usr/bin/ folder. Memtest is a Unix command-line program that does the memory testing, and is the Mac equivalent of MemTest86.

Memtest Usage

To run memtest on a new memory module, first shut down your computer and install the new chip. (Some helpful guides for doing this can be found at iFixit, if you’re unsure of the exact steps.) Ensure the chip is firmly in place, close up your machine (or don’t, if you’re a pessimist), and power it on while holding down the Command and S keys to force Mac OS X to boot into Single User Mode. Once you see a black screen with white text, you can release the key combination. After all the system logging is done scrolling past, type memtest all 2 to test all memory two times. Two passes should be enough to detect any blatant problems, but I wouldn’t hesitate to let it run for hours on end if I suspected an intermittent memory problem (memtest all). When complete, you should be greeted with “All tests passed” if your new RAM is in good condition. If your system locks up or freezes indefinitely during the test, you may have a bad memory module on your hands.

2/16/12 Update: Memtest is still working under Mac OS X 10.7 Lion.

10/25/12 Update: Memtest is still working under OS X 10.8 Mountain Lion.

How to Test RAM Under Mac OS X

PHP5 and MySQL 5 on Leopard

A few quick notes about building MySQL 5.x and getting it working under Leopard:

  • Follow Dan Benjamin’s excellent MySQL on Leopard tutorial.
  • Copy the PHP configuration example to the actual expected location: sudo cp /etc/php.ini.default /etc/php.ini
  • Edit it, and add /private/tmp/mysql.sock to both mysql.default_socket and mysqli.default_socket.
  • Save, and restart Apache: sudo apachectl graceful

Once completed, the default PHP5 setup that comes with Mac OS X 10.5.x will be able to communicate with the MySQL version built using the above linked tutorial. Time to get developing!

PHP5 and MySQL 5 on Leopard

How to Import and Export ICNS with Photoshop

If you’re interested in making replacement icons for Mac OS X applications, the Leopard Developer Tools received an updated version of the Icon Composer utility, which combines multiple PNG images into one ICNS file. Once exported, the combined file is suitable for use inside an application bundle, by choosing Show Package Contents from the Finder’s action menu (or a right-click) and browsing to Contents/Resources/ and replacing the appropriate ICNS file (make sure to rename your icon to match the existing one!).

To run the process the other way, first find the desired ICNS file inside the application, and open it with the built-in Preview application. Preview understands the transparency inherent to ICNS icons, and allows you to save the file as a PNG, ready to open and work on in Photoshop!

Update: After looking around on MacUpdate for something simple, I found img2icns, a freeware drag-and-drop icon converter that can turn a PNG image into a folder icon. With it, you can Get Info for the converted folder icon and copy and paste it onto another application or document. It’s the perfect little icon utility to go with this minimalist workflow, and it’s Leopard-ready!

How to Import and Export ICNS with Photoshop

AppleScripts for iTunes

AppleScript is the hidden “glue” language that binds software on the Mac together and allows for unparalleled interaction between apps. When built into a program, it allows anyone with the right tools to automate nearly any function of the appication. In fact, it’s what Apple’s Automator is built upon, making AppleScript more accessible to end users who don’t want to know or care about things like variables and loops. Where Automator is as easy as drag-and-drop, programming AppleScript can be complicated (perhaps more so for seasoned programmers).

Doug Adams, however, is an AppleScript wizard, and his huge library of scripts covers all kinds of Mac applications. Of particular interest are his iTunes scripts. He offers dozens upon dozens of cool and useful ready-to-run code samples that do all kinds of tricks with iTunes, including managing playlists, embedding and exporting album artwork, finding and replacing text in track names, and tons more. For getting more out of your Mac and iTunes, check out Doug’s AppleScripts library.

AppleScripts for iTunes

Leopard Compatibility Notes

Leopard is finally in the hands of thousands of Mac owners who are now getting their “new Mac” set up the way they prefer. While some found frustration with the Upgrade install, I backed up my important stuff and performed a full Erase and Install, resulting in a fresh system with no lingering apps or tweaks from the previous system. So far, my experience with Leopard has been a great one, with only a few software updates required to make things run like new. Here’s a run-down of some of the notes I made while getting software working:

  • Backup
    Apple’s .Mac-bundled “Backup” application received a small update bringing it up to Leopard standards, meaning many users can now successfully retrieve backups created before installing the system. Since I erased my previous OS install, being able to bring forth my backups stored on my networked G4 fileserver was one of the first things I needed to accomplish — something I’ll hopefully only need to do once with the advent of Time Machine. (Thanks for the tip, Jaron!)
  • Adobe CS3 Compatibility
    I had read a number of reports concerning CS3 compatibility with Leopard, and was wary of even installing them again, but I was glad to find that Adobe CS3 seems to work just fine in Leopard. I’ve run Photoshop, Illustrator, and Bridge for a few hours now without issue!
  • VMware Fusion
    I’m a big fan of using VMware on Windows to try out software before actually installing it on the host PC, and couldn’t be happier with the implementation on the Mac side of things, as well. VMware Fusion for Mac just hit 1.1 RC, and is nearing the final 1.1 release. The update brings, among other things, Leopard compatibility which works great.
  • Transmit & Unison
    My two must-have utilities from Panic, Transmit and Unison, are now Leopard ready and run with nary a hitch. Way to go, guys!
  • Font icons
    Images, PDFs, and Keynote presentations aren’t the only icons branded with the actual content they contain. Font files’ icons are updated to show the actual typeface on right on the icon. How cool is that?

I’m sure there’s a mountain of other cool things in Leopard just waiting to be discovered, and software developers will be publishing Leopard compatibility updates for the next few weeks at least. Keep an eye on MacOSXHints.com, one of the best places to check for the latest Leopard tweaks and tips!

Leopard Compatibility Notes

10 Photoshop Selection Tips

Select a Layer Outline

Command-Click a layer thumbnail in the Layers palette to load a selection of its outline, including any anti-aliased (non-jaggy) edges. If your layer has an inherent opacity set (for example, if you opened a partially transparent PNG image), the opacity difference is included in the selection. Normal opacities set in the Layers palette, however, do not affect the selection.

Use Multiple Selections

Once a selection is made, there are a number of operations you can perform to modify your selection. Holding Shift and making an additional selection will add to your current selection, and Option will remove from it. Holding both Shift and Option will do something unique: wherever your two selections intersect will become the new selection.

Combine Layer Outlines

Using the first Command-click thumbnail hint with Shift, Option, or Shift+Option modifier keys, you can add, remove, or intersect selections using outlines of other layers. Your cursor will show +, -, or x to indicate which type of operation will be performed, respectively.

Move Selection While Dragging

While in the middle of dragging a selection, you can hold down the spacebar to move around the origin of the selection. This is extremely useful if you find that your selection is a bit off — Instead of re-making a new selection from scratch, you can make adjustments “on the fly.” When the spacebar is released, the selection seamlessly drops back into the default “grow” mode, using the new origin as the starting point.

Start at the Center

Hold down Option after starting a selection to expand from the middle, causing the outline to grow symmetrically in each cardinal direction. Add the Shift key into the mix Shift to maintain a square shaped ratio.

Fixed Ratios and Sizes

Using the selection tool options, you can set a fixed ratio or specific size, both of which are great for slicing out content with a pre-determined size, like that of a computer wallpaper. Using the ratio, you can select a portion of an image that would fit on your desktop. Once you have the portion selected, you can scale it down to the native resolution of your display, being sure that it will scale proportionally to the correct size.

Quick Mask Mode

By flipping into Quick Mask Mode, you can use paintbrush tools to “paint” the beginnings of a selection. When you leave Quick Mask Mode, the painted area becomes a selection which you can use right away or modify further.

Transform!

Use the Select->Transform Selection command to distort the current selection. Note that this applies to just the selection outline, not the content within it. (To change the content, do Edit->Transform->pick a type).

Selection Paste Target

By making a selection and then pasting content into it, you can target exactly where the pasted content will land. Without a selection, pasted content simply gets dumped in the middle of the document.

Save Selections with the PSD File

Once you have your beautiful selection made and ready to use, you might consider saving for future use if it was particularly complicated to make, or if it’s a handy, reusable shape. Photoshop provides two simple commands for saving and loading selections. Choose Select->Save Selection to commit your selection to a given name. Retrieving it is as simple as picking the Select->Load Selection command, and choosing the name you saved the selection under earlier. Best of all, these named selections are included in the file, meaning you can save and re-open the document, and reload selections at a later date.

10 Photoshop Selection Tips

How To: Put Together an Affordable Laptop Repair Kit

Having your prized laptop unexpectedly bite the dust is a real drag, but with an affordable set of tools ready, you can ensure your machine lives a long, healthy life with minimum downtime. Here are my personal picks that won’t break the bank:

Presented with a failing laptop, the first step on the road to recovery is figuring out where the problem lies. Even if you can’t yet narrow down the issue to a single component, identifying the essential parts and ordering them by “most likely” to “least likely to fail” will offer a prioritized checklist to run down while working. If you’re unsure of what may be causing a problem, a good rule of thumb is to start with the obvious and work your way back to the motherboard — often the source of problems is the least expensive part in the chain, as computer parts are generally purchased from the lowest bidder. If your laptop can’t find it’s operating system, the hard drive might be dead. No video on the LCD? Something screwy with the display assembly. CD won’t eject? Probably the optical drive. In most cases, replacing the motherboard on the computer is the most complicated and most expensive, so it’s worth your time and money to start at the cheap end and work your way back.

Researching problems on web forums is a prudent starting place, as are manufacturer service manuals. If you can clearly explain the problem you’re having and show that you’ve attempted to do some of your own research, most forum members (like those on MacNN) will gladly assist. As far as manufacturer-offered support goes, most manuals are free, however Apple in particular is picky about who gets this information. iFixit, MacFixIt, and xlr8YourMac are a few trustworthy and respected sites which help make up for Apple’s stinginess with documentation. If you look hard enough, though, Apple’s official repair guides can be found on the net, despite their best efforts (and, really, the iFixit guides are more detailed).

Screwdrivers

With knowledge in hand — or in PDF form — and the courage to crack open the case of your laptop, you can start with the basics: a screwdriver set. Many will make promises of years of durability and offer second-to-none craftsmanship, however I find that a cheap little set will do just fine for most projects. Stanley offers a $5 6-piece screwdriver set, with Phillips and flat screwdrivers of a couple sizes (also at Amazon. And if you’re not put off by Wal-Mart, you can pick one up there, as well.). Just one little set has served me well for years of computer repair, especially on laptops.

If you care to get a little fancier, you can find a more expansive $15 set on eBay. I also have one of these sets, and am unable to find a manufacturer on any of the parts, however identical looking screwdrivers can be found at RadioShack, made by Kronus. It includes a wide assortment of changeable bits, including hard to find ones like Torx T4 (for iPod logic boards and cell phones) and a number of Phillips sizes. Search eBay for ‘torx’ and look for the black and red handle and white bit case. This kit is, as advertised on eBay auctions, of surprisingly good quality, despite the curious absence of a manufacturer imprint on the tool or casing.

Nylon Pry Tool

An absolute must for performing professional-looking laptop repair is the ability to remove plastic bezels without chewing up the edges with a rigid metal tool. As noted in my earlier post, Apple recommends a nylon pry tool for accomplishing this, and I can vouch for its extreme utility on any brand laptop. Computer manufacturers often affix plastic covers with slightly flexible clips, and this $2 tool will effectively and cleanly undo them, allowing for future re-assembly.

Straightened Paper Clip

The standard computer fixing tool for many a geek, a straightened paperclip can be had for free, but offers the ability to exert pressure in the most narrow of spaces. It’s also no coincidence that nearly all tray-loading computer optical drives can be safely forced open using the tiny paperclip hole built into their front covers. Keep a few on hand.

Ice Cube Tray

Once you start getting deep into a laptop repair, keeping the screws of various sizes in order can be a monumental task of its own. By keeping a simple $1 ice cube tray nearby to hold loose screws (preferably labeled in a fashion you can understand hours or days from now), you’ll be able to remember how it all fits together. Keeping screws and parts organized takes time away from getting the job done, but if you’re interrupted or happen to bump the table, you won’t be utterly lost when it comes time to put everything back in place.

Hemostats

If you aren’t working alone on your laptop, nothing makes you look more tech-savvy than a pair of hemostats. Appearances aside, hemostats are outstanding tools for extracting otherwise impossible to reach connectors, as well as plugging them back in. The occasional runaway screw can also be retrieved with ease, possibly avoiding unnecessary disassembly. Prices range from $3 at RadioShack to upwards of $10, depending where you search. Both curved and straight nose hemostats are of nearly unlimited use.

Multi-meter

Last, but not required, is a small, decent multi-meter. Problems can often be traced to a lack of power or electrical connection, and even the cheapest of meters will indicate both. When set to measure voltage, you can check that a component has the necessary power, and when set to measure resistance, you can assert the continuity of a circuit just by touching a probe to either end of the wire and watching for a huge drop in resistance. Unconnected wires will show infinite resistance, while a good wire should have extremely low resistance. A self-contained, pocket-sized meter can be had for $20 at RadioShack, and is well worth the cost.

So there you have it: a complete kit for about $30, all of which will easily zip up into your laptop bag, ready to break out and make repairs on the go. Print out your specific laptop’s service guide for quick reference, and you’ll be poised to tackle problems whenever they may crop up. If you were expecting a “priceless” item on the list, then here you go: confidence. Work slowly, think before you pull on a connector or wire, and take pictures if you have to.

How To: Put Together an Affordable Laptop Repair Kit

Seagate Hard Drive RMA

In the past, I’ve had the best luck with Seagate brand hard drives — avoiding Maxtor like the plague — but just recently I had a 320 GB Seagate SATA drive start failing on me. It started with what sounded like a few small read/write head hiccups, and turned into widespread sector failure, causing several diagnostic utilities to red flag the drive.

I bought the drive from NewEgg, but they referred me to Seagate for support and returns. With no other alternatives available and a failing drive on my hands, I got in touch with Seagate and filled out their online return merchandise form. Just a few days after shipping off the dying drive, I received an email letting me know that a brand new drive was on its way to me. I’m happy to be kept in the loop while the return is in progress, and I’ll update this post when I get the new drive!

While I had to cover the nominal shipping costs myself, I feel compelled to note how easy and fast their service is. I’m attempting to make a habit of documenting good customer service as well as the bad. After having dealt with some online returns that are a real hassle, Seagate is a refreshing change from some of the other rather lame options out there.

Update: Received an entirely different “Certified Repaired” hard drive in a very well packed box! It works great and passes all my tests!

Seagate Hard Drive RMA

iPod, iPhone, and AppleTV Video Guide

iLounge just posted an outstanding guideto the formats used by Apple’s video-capable portable devices, including the iPod, iPhone, and Apple TV. While QuickTime Player [Pro] does a decent job of doing simple exports, it’s great to understand the details behind the scenes, including video aspect ratios and bitrates. If you own one or more of these devices and plan on converting video for them, this guide is a must-read!

iPod, iPhone, and AppleTV Video Guide