Showing posts with label Mac. Show all posts
Showing posts with label Mac. Show all posts

Tuesday, July 05, 2011

Sync, then add new MP3s from a folder to iTunes

The "Sitch":
Like many "advanced" users, I reluctantly use iTunes because it's the most straightforward way to load my iPod. However, less than 0.01%* of my content was purchased from the iTunes store, and there is absolutely no way that I will ever allow iTunes to organize obliterate my folder and file structure. When I rip a disc, buy a $5 album from Amazon MP3, download free tracks, etc., the files get stored on a NAS, where the collection is archived.

For a while, I've been rsynching the master collection on the NAS to a local folder on the living room PC, because iTunes has exhibited poor behavior with both remote libraries (supported by my NAS) and libraries on network shares -- particularly if said share is accessed from multiple computers. (I won't go into the details, but the past issues in both of these options made a local copy highly desirable... Maybe Apple fixed all the issues I ever encountered. Maybe not. I simply don't feel like finding out.)

The Hitch:
Unlike practically every other media player in the universe, iTunes isn't programmed to fulfill the simple task of identifying that files have been added to a given folder and then importing said files into its precious little library. This meant opening iTunes and running Add to Library from its menu. There were two options: remember what you just rsynched and pick the appropriate sub-folder(s) or re-add the whole top-level folder and trust that duplicates won't be added (which generally worked.) Either way, it was manual and therefore bogus...

The Fix (for this Son of a *itch):
Enter Automator. As you can see in the top part of the (rather wide) screen snippets below, it takes a massive two steps to A.) find brand-spanking new music files in a specified folder structure and then B.) add said files to the iTunes Library. Why this has to be done with an extravagant macro-type concoction is beyond me, but the fact that is literally this trivial to accomplish was refreshing, as I haven't really messed with Automator nearly enough...

Music being synchronized to a local folder, then being added to iTunes automagically. Dogs and cats, living together! The apocalypse is nigh!!! 
After adding those two tasks to a "Workflow" in Automator, I saved it as an Application so that I could just run the bugger without opening Automator every time. The other benefit of saving as an app is that I could just add another line at the end of my rsync script and make it run by itself. That's what that little open command at the end of the script snippet above does. Note that the rsync line excludes the meta-files that are created by various OSes when the master copy on the NAS is accessed directly, and that it doesn't perform any deletions.

_____________
*: This isn't hyperbole! I have over 10k files, and exactly one track in the archived collection was purchased from the iTunes store.

Tuesday, September 22, 2009

Getting the gvim + It's All Text! experience on OS X

Firefox remains my browser of choice across most platforms because I highly value the functionality afforded by two particular extensions (I even have these installed along with a PortableApps version of the browser):
Under OS X, I hadn't been too happy with the latter extension, because I couldn't figure out how to use vim as my text editor. On asyd's blog, I encountered a method of achieving vim integration with IAT!. This was a very clever work-around, but it didn't provide the consistent user experience that I have come to expect after using gvim on my Linux and Windows boxen.

However, during a moment of sleep-deprived clarity, I encountered MacVim. This, coupled with the following steps addressed my grievances quite nicely!

(I'm trying to be a "good blogger", and mentioning almost all of the steps here -- even those I consider to be somewhat obvious):
1. Download the MacVim port from http://code.google.com/p/macvim/
2. Extract the *.tbz archive (Yes, double-clicking works just fine.)
3. Copy/Move  MacVim.app where you desire (e.g. /Applications)
4. Similarly, put the mvim script where you desire (e.g /usr/bin) [helps to use a terminal here so you can verify that ownership and permissions are sane]
5. Recommended: symlink gvim to point to mvim (particularly useful if you are a multi-platform type and don't feel like remembering to type something different when you happen to be on your Mac). [It is also useful to tell the mvim script where your MacVim.app is, but I'll leave this one as an exercise for the reader, because it is generally not strictly necessary...]
6. Configure the preference for It’s All Text! and tell it to use mvim (e.g. /usr/bin/mvim) as its editor.
7. Enjoy...

Thursday, September 17, 2009

Making the switch -- the hackintosh post

I like Linux, and I generally like what Ubuntu brings to the table. I even spent a month trying really hard to like Ubuntu on my Dell Mini 9 netbook. Unfortunately there were a couple of deal-breakers for me (well -- there was one major deal breaker with each of two different "flavors" of Ubuntu):
  • Factory-Installed Dell-ified Ubuntu 8.04 - The WiFi driver is buggy, and will intermittently lock up the entire system to the point that it will not accept any input (local or even remote via ssh)
  • Ubuntu 9.04 Netbook Remix - WiFi seems stable / fixed, but I never managed to get my Broadband2Go card to even be detected on the USB bus.
Therefore, I had network issues on my netbook -- regardless of which flavor of Ubuntu I tried to use. As the lyrics from Pink Floyd's The Trial say: "This will not do." As a result, I am currently taking part in the following activity:
Mini9 OSX

UPDATE: Works pretty well. Not quite as snappy as my 3-year-old MBP, but extremely functional and usable so far. I also installed that BB2G card easily, and can now achieve netbook nirvana -- or something.


HOWTO do it yourself

Friday, August 21, 2009

Virgin Mobile Broadband2Go for OS X

OK, this was too easy (I'm using the card to write this blog post).

  1. Install the Connection Manager and Drivers on a Windows system. (I used my boot camp partition.)
  2. Activate the USB device, and Program it using the Connection Manager.
  3. Restart in OS X
  4. Run the installer package (Installer.pkg), and -- unfortunately -- reboot.
  5. Follow along with the Leopard instructions in the UserGuide.pdf, with a couple of (fairly obvious) modifications:
  • The connection was created automatically (easier than their instructions)
  • It was called "Virgin Mobile Modem" instead of "Novatel Wireless CDMA Modem"
  • Some of the options they didn't mention on the WWAN tab have been removed (again, making it easier)
  • They forgot to mention adding your account credentials before clicking "Connect" (NOTE: This may actually not be necessary, based on my experiences under Linux -- I'll have to try using no data here later...)
  • Your Account Name is your MDN / Broadband2Go account number
  • Your Password is your Account PIN
That's it -- fully functional on OS X in a matter of about 2 minutes. Next stop, trying to get the bugger to work with Linux (namely Ubuntu 8.04 on my netbook). I'll report back if/when I'm successful...

Tuesday, December 09, 2008

Sunday, October 14, 2007

NTFS-3G Mount/Re-Mount Script for OS X

Requirements:
Features:
  • Optional Command-Line Parameters:
    • Partition to mount or re-mount (must be specified as the first parameter)
    • Use the force option at mount (can be specified as either first or 2nd parameter)
    • If no parameters are entered, script enters "interactive mode," and prompts user with a menu of confirmed NTFS partitions
  • Handle volumes that are currently using the (read-only) kernel NTFS driver
    • Prompt to unmount, custom exit level if user-aborted
    • Capture name that is assigned in Finder
    • Remount as read/write using the same Finder name
  • Handle volumes that are not currently mounted
    • Mount and assign a default Finder name: NTFS-disk#s#
  • Input Sanitizing
    • Volumes can be entered as "/dev/disk#s#" or (preferably) as "disk#s#"
    • Script throws custom exit level if volume does not exist
    • Script throws custom exit level if mount command fails due to non-NTFS volume
    • Script throws custom exit level if it encounters NTFS-3G errors during mount
  • (Possible Future Enhancements)
    • Add a -? or --help option to the script for über-completeness
    • Silent output -- rely only on the exit codes (Why? -- I can always redirect to /dev/null if I want to call it from within another script)
    • Something I haven't thought of yet...
  • bzip2 compressed version of the script (now includes updates through 1.4).
UPDATES
[Oct. 15] Version 1.1:
  • Implemented volume-unique mount points, so more than one disk can be mounted
  • Implemented menu (via array variable) for volume selection -- type a number instead of having to type disk#s#
[Oct. 16] Version 1.2:
  • Implemented actual type detection using File System field from "diskutil info disk#s#"
  • Previous method used reasonable speculation based on type field from "diskutil list"
  • Learned that array index values can be non-contiguous, and are not changed when array elements are unset. (This led to a later post.)
[Oct. 19] Version 1.3:
  • Added current mount point information to menu (yep, another array)
  • Added header bar to menu
  • Added Quit option to menu
[Oct. 27] Version 1.4:
  • Implemented the file system type detection for volumes that are input from the command line.
  • Previously, this was only implemented for volumes on the menu in "interactive mode."
  • Added an exit level for "Not an NTFS Volume."

Saturday, September 01, 2007

Bluetooth GPS and VMWare Fusion

Yes, VMWare Fusion does indeed support mapping the MacBook Pro's built-in Bluetooth radio to a Windows VM. As this screencast movie demonstrates, once the radio has been remapped, you can use your Bluetooth devices from within the virtual machine.

Only two minor caveats for my fellow adventurers:
  • Fusion will warn you that you need to load the BootCamp drivers on the VM when you enable the Bluetooth radio for the VM. This can be safely ignored if you are using a physical BootCamp partition as a VM, but is important to keep in mind if you are using a file-based Windows VM onto which you haven't previously installed the Apple built-in Bluetooth radio's driver for Windows.
  • The COM port mappings for Bluetooth devices will be different depending on whether you've accessed the BootCamp partition physically (by rebooting and holding "Option / Alt") or as a virtual machine (from VMWare Fusion). Just be aware of this, and be sure to configure your devices before using them.

The MBP w/ BootCamp Seamless HDD Upgrade

When I got my MacBook Pro (2.33GHz C2D), the biggest 7200rpm drive that Apple offered was too dang small for my tastes, so I opted for the (cheaper) 5400rpm 160GB drive. I had everything configured nicely, but had only carved off 18GB (NTFS) for my XP Pro BootCamp partition. Well, when one game (TOCA 3, which I absolutely refuse to uninstall) sucks up ~6GB of that space, that obviously isn't going to be adequate. Also, since I like to produce vacation videos to commemorate my travels, I need a significant amount of working space on the OS X (HFS+) partition, and didn't want to sacrifice the ability to work a good-sized project without having one of my external drives tethered.

The Problem
I wanted to execute the HDD upgrade -- gaining more space for both OS options, and switching to a 7200rpm mechanism to help whilst performing the aforementioned untethered video work, Photoshop activities, et.al.; however, I would consider a requirement of performing a reinstallation of either OS to constitute failure.

The Hardware for the Solution
First I went to OWC, and procured their Mercury On-the-Go 2.5" SATA external enclosure. I opted for the USB 2.0 / eSATA combo version; after giving strong consideration between the FW800 and eSATA options, I chose the more future-proof eSATA version. After looking at the prices of the versions that included a drive, I realized that I could go to NewEgg and get the Hitachi 7200rpm 200GB SATA-2 2.5" drive (including shipping) while still saving a significant chunk of money vs. the pre-assembled drive from OWC.

The Software for the Solution
I needed a way to replicate or image both OS X and Windows XP. A couple of seconds of Google Search action resulted in finding SuperDuper!, which appeared to fit the bill nicely for my OS X duplication and future bootability requirements.

Since I've been a "PC Guy" for a long time, I had a licensed copy of Symantec's Norton Ghost laying around, and thought that it may meet my needs on the XP side. But, alas, that would have been too easy -- the version I had (Ghost 2003, a.k.a. version 9.0) didn't support the GPT partition scheme, and couldn't make a partition image of the XP BootCamp partition. I had another brilliant idea, and tried to execute the Ghost imaging process from within VMWare Fusion, but Ghost couldn't see the C: drive via the VMWare driver (Curiously, it could see my external drive -- close, but no cigar...) I couldn't see any clear indication that the current Ghost 12 package would resolve this for me, and they wanted $50 (upgrade price) just for the chance to try -- no thanks, I just spent enough hard-earned cash on the hardware... There are also some widely-discussed problems trying to use a *.DMG disk image from OS X's Disk Utility to successfully image BootCamp, so I started the Windows phase of the game with 2 strikes...

Luckily, there are some clever folks out there who know how to leverage tools that have been in development for quite some time and make them accomplish new tasks. Enter WinClone, which is heavily based on the hard work by the good folks at the Linux-NTFS project. This little gem lets you save off an image of your NTFS partition and restore it to another partition. The use of the ntfstools is executed nicely, and WinClone manages to pull off the restoration in a way that continues to make BootCamp happy and bootable.

High-Level Description of the Process
  1. Gather all the required HW and SW for the process
  2. Install the replacement HDD in the enclosure, attach the enclosure to the MBP via USB
  3. "Initialize" the new drive: make a single partition that consumes the whole disk (we'll make the new BootCamp partion later), format it as HFS+, and name it "Macintosh HD" (because we're shooting for a seamless transition)
  4. Use SuperDuper! to make a full and bootable copy using the Backup -- All Files method
  5. Reboot, hold in the "Option / Alt" key, and boot from the newly-cloned drive to make sure it works.
  6. (Optional) Reboot back to the original internal HDD for now.
  7. Run WinClone, create an image file from your BootCamp partition (mine was the 3rd partition -- or slice -- on the first disk on my MBP, namely /dev/disk0s3), and save it as a file somewhere that you'll be able to access later (I would suggest one of your HFS+ partitions, and the clone is a good choice for this purpose, because you won't have to tether an external drive to restore it).
  8. Shut down the computer completely, and prepare for the disassembly. I used a #000 Philips and a T6 Torx driver to perform the dirty work. You can refer to the ExtremeTech or iFixIt guides to complete the diasassembly [remove the plethora of itty-bitty screws that are required to remove the palmrest / top cover (4 on one side, 4 on the other side, 4 on the bottom, 2 on the back, 2 near the memory cover, 2 under the front lip beneath the battery, etc...), disconnect the keyboard/trackpad cable, and remove the drive (2 more screws, some tape, and an interface cable).] Needless to say, use your brain to avoid ESD zapping of your computer's sensitive and/or delicate parts... Note: There were some minor differences between my MBP and the first-gen model used in the iFixIt guide, but they were farily trivial (e.g. no bluetooth board, and different HDD mounting assembly on the right-hand side).
  9. Take the replacement drive out of the external enclosure, migrate the HDD mounting bushings (and / or brackets on other systems) to the replacement drive, install the replacement drive into the system, and put the bloody thing back together...
  10. Boot to your migrated OS X system (if you haven't been following along , you may be horrified that you --temporarily -- have no BootCamp partition). Since you tested it in step 5, you should already know that this will just work. Thanks, again, to SuperDuper! for making this so part of the migration so dang easy.
  11. Run BootCamp Assistant and carve off a new BootCamp partition on your new internal HDD (I chose 45GB this time, because I want more than 2 games on my Windows XP installation).
  12. Start the Windows installation, and get past where you've formatted the C: drive as NTFS. Note: you don't have to finish the Windows installation.
  13. Reboot back into OS X, and run WinClone to restore from the file created in step 7 to your newly-created BootCamp partition (now you can clearly see why I suggested storing the file on the new drive).
  14. Reboot, hold "Option / Alt", boot to Windows, let it run chkdsk, then repeat to complete the Windows portion of the migration.
  15. Grab a cold one, and enjoy...
Getting VMWare Fusion to Recognize the Change
After the upgrade, VMWare Fusion couldn't start the VM that was based on the physical BootCamp partition, because the partition table was different. It recommended removing and re-adding the disk to the VM config file, but there's an easier way. I simply deleted the VM config file (/Users/[your_user]/Library/Application Support/VMWare Fusion/Virtual Machines/Boot Camp/[your /dev/disk#]/Boot Camp partition.vmwarevm), and then let VMWare Fusion rebuild the VM file... That did the trick, and I just hit cancel to avoid re-installing the VMWare tools (since they're already installed).

Mission Accomplished!
That's it: a few hours of time resulted in more space for both OS environments, and a little more speed as well. I also accomplished my prime objective of not having to reinstall either OS, re-apply any customizations, re-download any tools, etc... Oh, yeah, and I walk away with a pretty sweet 160GB bus-powered USB 2.0 HDD that happens to also support connection via eSATA.

Wednesday, August 22, 2007

Potential Mac Screen Properties Life-Saver

I managed to freak out the display settings for my screen that was set as the primary display (TV via the S-Video out adapter, because I was using Front Row, and didn't want to use mirror mode) on my notebook this morning by magically switching it to PAL and hitting OK while moving the notebook. [This particular maneuver requires a unique mix of uncanny bad luck coupled with a distinct lack of caffeination, and is neither likely to occur nor recommended.] Well, being an resident of the USA, said TV's S-Video input needed an NTSC signal, and so things were not exactly happy. Because of the way OS X puts the properties page for a given screen on that screen (which is normally nice) and because it also lacks a hot-key for moving a window, I was fairly hosed for a while.

Plugging back in my DVI monitor didn't help (separate settings were maintained on a per-device basis), and I simply couldn't find the darn settings anywhere in the Library or elsewhere... I got lucky, though, that monitor happened to have an S-Video input, and managed to sync with the 50Hz signal. That change in luck allowed me to reset the mode in which the TV adapter was running successfully. But, what would I do if I ever hosed something in an manner that was not so easily recoverable?

Enter cscreen, the hard-to-find (because the author abandoned it and his site) utility that allows modification of OS X display settings from the command line. I finally found it on the ScriptBuilders site, and am pleased to report that it works as designed -- allowing screen properties to be properly transmogrified from the command line. This even works from an SSH session, so now no amount of sleep and caffeine deprivation mixed with poor thumb placement can ever cause near-tragic screen gobbledy-gookage ever again...

Oh, yeah, this also makes it easy to switch which screen is the primary, and to rig up some scripts to switch among settings that I may want to use from time to time. Now, I still kinda want to find where these settings actually live, but that's a project for another time.

Wednesday, January 10, 2007

Finally got around to...

I finally went out and grabbed the OS X Wacom tablet driver. Even tried messing around with Ink, but so far it is doing worse than WM5's handwriting recognition on my PDA. Therefore, it is probably destined to be a novelty. However, when Photoshop CS3 comes out later this year, I will be glad to have the absolute-positioning capabilities of the pen back -- it makes it so very much easier to work with masks and to add subtle effects..

Thursday, November 02, 2006

Red-Letter Day or Red Pill?

Today I received my new MacBookPro. It's the first Apple computer that I've owned since the ][e that my folks got for me "back in the day." It also means that I've added to my OS collection yet again; my current tally includes not only OS X and Windows, but also Solaris, OpenBSD, and Linux... I've only been using the system for a couple of hours, but I'm digging it so far... Of course, it's hard to argue with the horsepower that this baby has! I think my poor little Athlon XP (Barton) desktop is going to start feeling a bit lonely...