Archive: Mac

Page 3 of 7 1 2 3 4 5 6 7

July 12, 2007

Fix Mac's Home and End keys

homeend_20070712.jpg

Brian Litzinger writes:

Coming from many years of using a PC I like my home and end keys to work like they do on a PC, not on the Mac. Not sure if you prefer the PC or Mac defaults for home and end, but here is how you change it. This will change how the home and end keys work in every program.

Save this to Users/username/Library/KeyBindings/DefaultKeyBinding.dict

{
    "\UF729"  = "moveToBeginningOfLine:";
    "$\UF729" = "moveToBeginningOfLineAndModifySelection:";
    "\UF72B"  = "moveToEndOfLine:";
    "$\UF72B" = "moveToEndOfLineAndModifySelection:";
    "\UF72C"  = "pageUp:";
    "\UF72D"  = "pageDown:";
}

After saving the file, your home and end keys will work like they do in most other operating systems, moving the cursor to the front and end of a line. Holding shift will cause the whole line to be selected. The last couple lines also adjust the page up and down keys, which will move the cursor up and down a page instead of just scroolling. Any applications you are running will need to be restarted before this takes effect.

Posted by Jason Striegel | Jul 12, 2007 07:49 PM
Mac | Permalink | Comments (2) | TrackBack | Digg It | Tag w/del.icio.us

July 9, 2007

iPhone hacks widget

Make 775
Here's a widget for your Mac that will give you all the latest tips, tricks and HOW-TOs for your iPhone - from HACKSZINE! - Link (zip).

Posted by Phillip Torrone | Jul 9, 2007 12:53 AM
Mac, iPhone | Permalink | Comments (0) | TrackBack | Digg It | Tag w/del.icio.us

July 6, 2007

Telekinesis - remote control your Mac with an iPhone

telekinesis_20070706.jpg

Telekinesis is a bundle of small web apps that you can run on your Mac to give the iPhone remote control. You can use it to stream media files to your iPhone, run scripts remotely, and capture images with the iSight.

You can also add your own features by dropping custom PHP applications beneath the Application Support library folder.

Telekinesis Project - Link
Create apps for Telekinesis - Link

Posted by Jason Striegel | Jul 6, 2007 08:19 PM
Mac, PHP, iPhone | Permalink | Comments (0) | TrackBack | Digg It | Tag w/del.icio.us

June 17, 2007

Upgrading the 13" MacBook hard drive: the hard part is the soft part

winclone.png

The great thing about the MacBook is that it's one of the first Apple notebooks in a long time that includes a user-replaceable hard drive. And it's incredibly easy: remove three screws, pull the drive out, put the new drive in the old drive's caddy, and plug it back in. That part takes about five minutes. The hard part is preserving your old data, especially if you have a Boot Camp partition.

Fortunately, there are some software tools out there that can make the upgrade painless. First of all, make good backups:

  • You'll need WinClone for your Boot Camp partition, and SuperDuper! for the Mac partition.
  • Use SuperDuper to clone your Mac partition to a bootable FireWire drive. SuperDuper allows you to perform live clones (cloning the running system), but it's best to be careful and not run any applications while it's doing its thing.
  • Use WinClone to create a restore image of your Boot Camp partition. Be sure to select "Prepare for restoring on a different partition", and if you're backing up a Vista partition, check "Add generic BCD".

With your Macintosh hard drive mirrored to a bootable FireWire drive, and a restore image of your Boot Camp partition stored somewhere safe, you're now ready to perform the hard drive upgrade. After that's done, you need to boot your Mac from the FireWire drive (the cloned image). It's almost time to reverse the steps you took, but first you need to partition the new drive:

  • This is the command I used to partition my 250GB drive. I've got three partitions: one big one for Mac OS X, a small one for sharing data between Mac OS X and Vista, and one big one:
  • sudo diskutil partitionDisk /dev/disk0 3 GPTFormat "JHFS+" "Macintosh HD" 140G "MS-DOS" "SHARED" 12.9G "MS-DOS" "Vista" 89G
  • Don't create more than three partitions. Mac OS X reserves a small (200MB) partition for some kind of housekeeping, and that + three puts you up to Window's limit for partitions. I originally tried creating four partitions on my disk, and I could not get Vista to install on it with that configuration.

It will take a little while for the drive to partition and format to complete, and then you're ready for the next step; restoring the data:

  • Now you need to run SuperDuper and restore Mac OS X to the internal hard drive's first partition. You'll be cloning the system you're running (the Mac OS X clone you made to the FireWire drive), so avoid running unnecessary software that might interfere with SuperDuper.
  • Use Winclone's Restore tab to restore the image you made of your Boot Camp partition to the third partition.

Once these two steps are done, you are ready to shut down, disconnect the FireWire drive, and see if you can boot from your new internal drive! If something goes wrong, remember that you've got the old drive kicking around. All you need to do is find a Serial ATA-to-USB enclosure for it, and you'll be able to retrieve data from it.

Posted by Brian Jepson | Jun 17, 2007 01:30 PM
Mac | Permalink | Comments (6) | TrackBack | Digg It | Tag w/del.icio.us

June 16, 2007

HOWTO - Read/Write to NTFS drives in OS X

macfuse_20070616.jpg

If you want to share an external drive between a Mac and a Windows machine, you typically format the drive with a FAT32 partition. One problem you'll run into, however, is that you can run into a file size limit if you're dealing with really large files. NTFS gets around this limitation, but unfortunately the OS X NTFS driver only supports reading from NTFS partitions.

Thankfully, there's a NTFS Fuse driver which you can use with the MacFUSE userspace filesystem driver. It supports full read/write capability, so you can use an external disk to swap large files between your Windows and Mac machines.

It's a bit of a pain to install, but here's the quick rundown:

Download and install MacFUSE - Link
Just get the DMG file and run the contained installer.

Download and install Fink. You need this for obtaining and building the NTFS Fuse driver - Link
- run the installer within the DMG file
- drag the FinkCommander application to your Applications folder
Get NTFS Fuse driver. You need to configure Fink to use unstable packages and then install the ntfs-3g Fuse driver. Open a terminal and run the following commands.
- /sw/bin/fink configure
Use defaults, except answer YES to use the unstable tree
- /sw/bin/fink selfupdate
- /sw/bin/fink index
- /sw/bin/fink scanpackages
- /sw/bin/fink install ntfs-3g
Reboot
Mount your drive
- First, make sure it's unmounted in disk utility (Applications/Utilities/Disk Utility - select drive - click unmount)
- Make a mount point: mkdir /Volumes/ntfsdrive
- Mount the drive: /sw/bin/ntfs-3g /dev/disk2s1 /Volumes/ntfsdrive
Replace /dev/disk2s1 with your external drive's device. You can find this in Disk Utility.

The last step is all that you'll need to repeat in the future to connect to your NTFS drive. After executing the mount command, the drive will appear on your desktop and you should be able to write files to it!

Posted by Jason Striegel | Jun 16, 2007 09:19 PM
Mac, Windows | Permalink | Comments (29) | TrackBack | Digg It | Tag w/del.icio.us

June 9, 2007

Quick-fix for obfuscated Javascript and bad indentation

beautify_20070609.jpg
To save bandwidth and make code harder for third parties to understand, a lot of web developers will use a Javascript compression or obfuscation tool. There are a number of methods used, but almost all of them save space by removing all unnecessary whitespace.

There's a useful GNU command line utility called "indent" that can help you deconstruct this mess. It won't fix variables that have been renamed unintelligibly, but, as it's name implies, it will correct the formatting and indentation of your .js file.

Indent is designed to work with C syntax, but it's pretty forgiving and does a fairly nice job on C-like syntaxes such as Javascript, Java and (I assume) C#.Net. It can mangle a regexp here or there, but it's a quick, essential tool if you want to quickly beautify a compressed javascript file and save it to a state that can be read.

De-obfuscate Javascript with indent

indent -bl infile.js outfile.js

You can see some sample output from this command in the image above. That's a snippet of code from the Google taskbar for Firefox. Note that if you don't use the second file parameter, indent will just overwrite the original file.

Tweak your block formatting preference
If there's one thing that programmers all have a strong opinion about, it's the proper placement of brackets. Specifically, should left brackets be placed on the same line as the function or clause that begins a block, or should they be placed on their own line at the same indentation as the close bracket?

Well, I think they should go on their own line, but if you're not satisfied with my opinion, you can use indent to get your way:


-br, -bl
Specifying -bl lines up compound statements like this:
if (...)
{
code
}

Specifying -br (the default) makes them look like this:
if (...) {
code
}

This reminds me to mention another caveat, which is that indent uses the wrong block formatting by default. :)

GNU Indent (man page) - Link

Posted by Jason Striegel | Jun 9, 2007 10:52 AM
Linux, Mac | Permalink | Comments (0) | TrackBack | Digg It | Tag w/del.icio.us

June 7, 2007

VMware Fusion beta 4 for OS X

A new beta release of the VMware client for OS X was released today. With it, you can run other operation systems like Linux or Windows in the VMware virtual machine without having to leave OS X.

It provides pretty much the same functionality as Parallels, except you can download the beta for free. Also, this release contains a cool feature they call "Unity", which allows Windows apps to leave the container window and get friendly with your OS X desktop (video above).

VMware Fusion Beta - Link

Posted by Jason Striegel | Jun 7, 2007 11:22 PM
Linux, Mac, Virtualization, Windows | Permalink | Comments (0) | TrackBack | Digg It | Tag w/del.icio.us

June 3, 2007

Export video from your set-top box to your Mac

DCT-6412.jpg

Ever since I got my first set-top box at the end of last year, I've been itching to connect its FireWire port to my Mac. My friend Emilie called today to alert me to a CBS Sunday Morning report on Maker Faire, which I managed to record, and that gave me the push I needed to figure this all out.

There are a few sets of instructions out there on how to do this, but in a nutshell, you connect your Mac to the set-top box, load up a program that can record directly from FireWire set-top boxes (unfortunately, iMovie won't cut it), and do whatever editing you need to the video once you've brought it in.

I found that Ammesset Software's iRecord did the trick perfectly: I checked its preferences to make sure that my Motorola DCT-6412 was detected, told my set-top box to start playing back the video I had recorded, and selected New Immediate Event from iRecord's File menu. When it was done, I selected Stop Event from File menu.

This left me with a .m2t file that I didn't know what to do with at first. Squared 5's MPEG Streamclip is a free program that can open and convert all kinds of streams. Using MPEG Streamclip, I was able to trim the clip and export it to one of the many supported codecs.

Resources

  • iRecord - Link
  • MPEG Streamclip - Link
  • What to do if iRecord's events get stuck in pending mode - Link
  • macteens: Make your own Home Theatre Mac (HTMac) - Link
  • AnandTech: The Mac mini as a Media Computer - Link

Posted by Brian Jepson | Jun 3, 2007 07:31 AM
Home Theater, Mac | Permalink | Comments (4) | TrackBack | Digg It | Tag w/del.icio.us

May 24, 2007

HOWTO unstick your Mighty Mouse trackball

mightymousesponge.jpg

jkOnTheRun has a great trick for cleaning the Mighty Mouse trackball:

First slightly and carefully moisten the ball, I used spit on my fingertip. :) Then take a clean sheet of paper and turn the Mighty Mouse upside down. Run the ball rapidly in all directions on the paper. In about 5 seconds my problem was fixed as the dirt worked itself loose and came out on the paper. I love my Mighty Mouse again. :)

Check out the posting for more details and some suggestions in the comments. - Link

Posted by Brian Jepson | May 24, 2007 07:50 PM
Mac | Permalink | Comments (29) | TrackBack | Digg It | Tag w/del.icio.us

May 16, 2007

Enable tabbed browsing in Safari

safaritabs_20070516.jpg
Tabbed browsing was added to Safari a long time ago, but I noticed today that my new iMac didn't ship with it enabled. If you haven't enabled tabs yet, hop over to Safari's preference settings and select the "enable tabbed browsing" checkbox. Firefox rocks, of course, but Safari always seems a little faster to me, which makes it nice to use when I don't need Greasemonkey.

Why isn't this enabled by default, anyway? Are there folks out there shuffle-browsing the web, clumsily F9ing through a kabillion windows, not even aware that these useful little tabs exist?

Posted by Jason Striegel | May 16, 2007 09:39 PM
Mac | Permalink | Comments (0) | TrackBack | Digg It | Tag w/del.icio.us

April 29, 2007

RAID 0 in a Macbook Pro

raid0mac_20070430.jpg
Putting a RAID 0 (striped) disk array in your laptop is a double edged sword. One the one hand, it's twice as likely to have a disk failure. One the other hand, it can make disk-bound activity, such as uncompressed video reading and writing, much faster. Frankly, with processor, bus and memory speeds as fast as they are, disk IO is often times the weakest link... which makes that risky performance upgrade all the more tempting.

Eric Cheng recently posted his experiments on getting RAID 0 working with a Macbook Pro:

Subjectively, the system feels more snappy, and I'm happy to have made the upgrade. I use up at least 20-30GB per week in the field, and it will be great to be able to work on my notebook without having an external drive chained to it.

As for the disk failure issue, we all back up nightly anyway, don't we?

320GB striped array (RAID 0) in a Macbook Pro -[via] Link.

Posted by Jason Striegel | Apr 29, 2007 10:54 PM
Data, Mac | Permalink | Comments (1) | TrackBack | Digg It | Tag w/del.icio.us

April 24, 2007

HOW TO: Make Custom Icons for Mac OS X

icns2rsrc_20070424.jpg
With a little Photoshop, the Icon Composer from the OS X install disk, and a program called Icns2Rsrc, it's pretty easy to make custom icons for OS X.

There are a number of reasons why you might want to do this (custom app icon, etc.), but for me it seems really useful for easily distinguising between my several external drives.

How To: Create Custom Icons for your Mac -[via] Link.

Posted by Jason Striegel | Apr 24, 2007 09:49 PM
Mac | Permalink | Comments (0) | TrackBack | Digg It | Tag w/del.icio.us

April 18, 2007

Dear Apple: Post the X11 pkg

Make 538
If you need to install X11 on a new Mac you can't download or use the old one that Apple has on their site, you need to find it from the System install DVDs - mine was on disc 1 / System / Installation / Packages / X11User.pkg. It would be better if it was online, but the updated one - I needed to install EAGLE on a Mac and it needs it.

Posted by Phillip Torrone | Apr 18, 2007 12:45 AM
Mac | Permalink | Comments (1) | TrackBack | Digg It | Tag w/del.icio.us

April 16, 2007

Xbox360 and Mac

connect360_20070416.jpg
There was a nice post on TUAW today about making your Xbox360 and Mac play nice together. The guide includes information on using your Mac as a router to share your internet connection with the game console, using Xbox360 accessories with your Mac, and streaming media from the Mac to the Xbox360 using the $20 Connect360 program (pictured above).

TUAW Guide: Xbox 360 and Mac -Link.

Posted by Jason Striegel | Apr 16, 2007 10:22 PM
Mac, Xbox | Permalink | Comments (0) | TrackBack | Digg It | Tag w/del.icio.us

April 13, 2007

Gimp Running Natively in OS X

gimposx_20070414.jpg
A lot of progress has been made toward porting the GTK+ library to OS X, and recently intructions went up on how to build Gimp for native OS X operation. That's right, without X11 getting in your way. It's still not ready for prime time, but I'm really excited about where it's going. If you're a programmer and have some brain cycles to spare, this might be a fun project to contribute to.

How To Compile Gimp for Mac OS X -[via] Link.

Posted by Jason Striegel | Apr 13, 2007 10:21 PM
Mac, Photography | Permalink | Comments (0) | TrackBack | Digg It | Tag w/del.icio.us

Page 3 of 7 1 2 3 4 5 6 7

Bloggers

Welcome to the Hacks Blog!

Brian Jepson.Brian Jepson


Jason Striegel.Jason Striegel


Philip Torrone.Phillip Torrone



See all of the books in the Hacks Series!
Advertise here.

Recent Posts

www.flickr.com
photos in Hacks More photos in Hacks