Category Archives: Mac

Comprar levitra 5 mg Odd Git Licensing Message on OSX

Today,IOS 7 dropped to the general public. As usually comes with the release, there was an Xcode update. I updated.

 

For some time, I’ve been using the git bundled in Xcode as it makes it simpler to get updates as they come with Xcode. Today, that yielded an amusing message.

I use git via an alias in my .bashrc

alias git='xcrun git'

A simple version check reveals all:

 

git –version

xcode-git-message

Oops… git is apparently subject to Apple’s licenses.

Here, File File! Nears Release, Gets Attention

I’m taking time away from adding spit and polish to the exciting Here, File File project to say WOO HOO!

The whole team (Adam, Buck, and I) are psyched! A few days ago we found out Here, File File is a finalist in the AppsFire Apps Star Awards. And today, The Unofficial Apple Weblog (TUAW) published a great HFF write up.

If you haven’t seen our promo video yet, give it a whirl!

Killing “find” Errors

I’ve used the unix filesystem search utility find for many years. Though, like most things, until forced to learn its deeper secrets, I generally get by with only the most basic knowledge.

One of the cool things about find is that you can specify a search and then execute an action on the results, all in one command.

This example is probably my most common use of find:

find . -type d -name .svn -exec rm -fr {} \;

This means: find, in the current directory (.), a directory (-type d), named .svn (-name .svn), and for every result (-exec) remove that directory (rm -fr {}) .  The “{}” represents the matched path string, and the “\;” is required to end the “-exec” command.

Here’s a sample of what this looks like, including output:

$ find . -type d -name .svn -exec rm -fr {} \;
find: ./.svn: No such file or directory
find: ./getid3-2.0.0b4/.svn: No such file or directory
find: ./getid3-2.0.0b4/extras/.svn: No such file or directory
find: ./getid3-2.0.0b4/getid3/.svn: No such file or directory

This is great, and I’ve used this exact syntax for years. But today I ran into a problem. I wanted to run this exact command as part of a custom build script in Xcode. When this command ran I had 81 errors popup in my build results! What happened is that all thos “No such file or directory” messages are actually errors, and Xcode reported them as such.

The solution is to add one extra argument: -depth . This causes find to do a depth-first traversal of the sub-directories being searched. That is, find will check the contents of directories before acting (eg, running an -exec command) on the directory in question. The default is to act on the directory (in our case, removing it) before attempting to visit it’s contents. So after we removed the directory, find was still trying to look at it; -depth fixes that.

So, the final answer is, I now use:

find . -type d -name .svn -depth -exec rm -fr {} \;

Yes, this is a slightly verbose explanation for something so simple, but maybe it will help someone else.

Resetting Forgotten OS X 10.5 User Password

I have an older G4 Mac Mini I use for testing the Mac app I’m working on (Here, File File F.K.A. Welcome to Your Mac. It’s just nice to have a machine that I can test both 10.4 and 10.5 as well as PowerPC compatibility.

Yesterday I needed to do some updates on the 10.5 system and couldn’t remember my password.

Google was my friend and showed me an Apple Knowledge Base article to solve the problem.

The steps to restart are as follows:

  1. Restart into single user mode (hold Command+S during boot). (Note: that if you use a non-Apple keyboard that’s WindowsKey+S)
  2. At the “#” prompt run:
    • mount -uw /
  3. Now run:
    • launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
  4. Note your short username and user directory by running:
    • ls /Users
  5. Run the following with your username instead of “username”:
    • dscl . -delete /Users/username AuthenticationAuthority
  6. Now reset your password by running:
    • passwd username
  7. Now reboot by running:
    • reboot

This is a bit more complicated than it seems to have been in 10.4 Tiger.  I’m fairly certain you could skip steps 2 – 5, since it didn’t use the same directory service backend.

Note: I don’t use secure file vault, but others on the web have noted that resetting your password in this way will lock you out of your data. In fact, it looks like there is not a way to recover/reset that password, which is part of what makes it secure. 🙂

Thanks Google and Apple!

Source: http://support.apple.com/kb/TS1543

Mac Mini DVI-HDMI on LCD HDTV

I recently purchased a Mac Mini to be my home media computer. I plan to blog more about that later. For now, the only tricky thing about using a Mini has been using my TV for a monitor.

There’s a lot of noise on the web (or Google at least) when trying to search for a solution to using a Mini’s DVI output on LCD TV’s. Typically they recommend using DisplayConfigX  or SwitchResX to tweak your display modelines, timing, resolution, and just generally dive deeper than I like  into display configuration. My solution was MUCH simpler.

My television is a Samsung 46″ LCD (LN46A539P1F). It has 3 HDMI inputs, but one is specifically intended to be used for PCI DVI input converted to HDMI.  It also provides a VGA DSUB input which works perfectly with a Mac Mini’s miniDVI->VGA apapter, but the point here is to get direct digital signal without converting to analog.

The Mac Mini has a miniDVI output and is packaged with a miniDVI->DVI adapter, so to get a signal into the TV, you’ll need a DVI->HDMI or miniDVI->HDMI adapter. I bought both from Monoprice as they are very inexpensive and either works fine.

Once you have the apdapter on and the HDMI cable connected to the TV, the Mac will recognize that it is displaying on an HDTV and will recommend 720p (1280×720 resoution) or 1080p (1920×1080 resolution). However, you will now most likely see that your output is either too small on the screen (has a few inches of black border around the picture)  or is too big (extends beyond the screen). If it’s too big, you have Overscan enabled in your Displays preference pane. If not, you should enable Overscan.

Now, on your TV, go to the Menu:

  • Choose “Picture” (should be first option)
  • Choose “Picture Options” (near the bottom of list)
  • Choose “Size” (will have options like 4:3, 16:9, and Just Scan)
  • Choose “Just Scan”
  • Close Menu

Bam! Your display should now be just right!

Updating RubyGems on Mac OS X 10.5 Leopard

I’m just posting a simple tip today.

I was wanting to play around with the very cool SASS meta-language using Compass. The language and tool are implemented in Ruby, which is pre-installed on OS X, but as I discovered, I needed a newer version of RubyGems.

I had already known I needed to update Gems, so I was doing the following:

$ sudo gem update

Eventually I got errors like this:

Updating installed gems...
Bulk updating Gem source index for: http://gems.rubyforge.org
Bulk updating Gem source index for: http://gems.github.com/
Attempting remote update of RedCloth
ERROR:  Error installing RedCloth:
    RedCloth requires RubyGems version >= 1.2
Attempting remote update of capistrano
ERROR:  Error installing capistrano:
    capistrano requires RubyGems version >= 1.2
Attempting remote update of net-sftp
ERROR:  Error installing net-sftp:
    net-sftp requires RubyGems version >= 1.2
Attempting remote update of net-ssh
ERROR:  Error installing net-ssh:
    net-ssh requires RubyGems version >= 1.2
Gems updated: RedCloth, capistrano, net-sftp, net-ssh

Turns out, to update RubyGems, one must update the gem system!

So, the next correct command to run is:

$ sudo gem update --system

This updated my RubyGems to version 1.3.1 and allowed me to move forward in playing with Ruby.

Foxmarks: Bookmark Synchronization Heaven

Long have I searched for the magic bullet solution to my bookmark synchronization woes.  I’ve wanted a simple plugin that would synchronize my bookmarks between multiple installations of Firefox and Safari, thus making it simple to access said bookmarks from any computer, or between the two commonly used browsers on my Mac.  I’ve looked at many options, but always the solution only allows me to sync one browser or the other, leaving me looking for some secondary sync tool to get between Firefox and Safari on my Mac itself, not via network or a proper sync.

I’d almost given up on finding a solution, then, a few months ago I started using Delicious. It was cool because there were plugins for Safari, Firefox, and IE, and of course, it’s by default a web based bookmarking system. Its cool, I like it, but I just didn’t use it much. The plugins integrate it into the browser by giving you ANOTHER bookmarks menu, not by integrating with the browsers’ bookmark system.

Before ever using Safari or Delicious, my Firefox bookmark sync tool of choice was Foxmarks. It provided a web interface for remote access to my bookmarks, plus a nice sync interface for all my Firefox installations. I was randomly poking around today and discovered that Foxmarks now works with Safari and IE! I was excited and wasted no time installing Foxmarks for Safari. So far, it works great!

For the most part, it works just as you’d expect, bookmarks sync between all my Safari(Mac only, for now, I think) and Firefox(Mac, Linux, and Windows) installations without hassle. I’ve yet to try out the Internet Explorer functionality, but I’m guessing it works pretty well. I just don’t use IE enough to care.

One caveat to be aware of: both Firefox and Safari use some browser specific URL syntax to access internal functionality for recent bookmarks, etc. That stuff will only work on the browser where it was created, Safari on Safari, Firefox on Firefox, etc. For me, that’s a non issue, I rarely use those features. I have tested and confirmed that javascript bookmarklets (like for Tinyurl and Cornify) do seem to work after syncing. Those are about the only reason I use on the bookmark menubar.

Building a Hackintosh Successful Attempt #1

Since getting a Mac Book Pro for work, I’ve become quite the fan of OS X. As a unix/software guy, I really enjoy having the power of a BSD/Unix system readily available, without having to install some hack like cygwin. (I’m not knocking cygwin, it’s a really nice Windows add-on, but I prefer not to run Windows, in general.) I also like the OS X user interface, and lately, that it runs the very cool boxee media center software. So, I wanted to build a boxee box. My options were AppleTV, Mac Mini, or Hackintosh. The Mac Mini was more money than I wanted to spend for an untested solution. The AppleTV would probably be a good solution, especially now that it’s getting more testing from the boxee community, but I wasn’t sure about it. Finally, I thought that a Hackintosh would be a cool project, give me not just boxee but a full OS X system, and I could buy the parts for $235 from newegg. That’s a cheap computer, and especially a cheap Mac.

I went with an Intel D945GCLF2 motherboard. It’s a mini-ITX board with built in dual Atom 330 processors, the kind of CPU’s used in the new and inexpensive NetBook computers. It’s a very low power solution, but with the dual processors most of the research I did suggested it should do 720p HD content. It has a S/PDIF header for digital audio out, but requires an extra cable and I have yet to test it. VGA out is less preferable than DVI, but again, this is cheap, and my Samsung 46″ LCD has VGA-input, so it certainly works. Also, it’s limited to a single 2GB DIMM, so max out that RAM early. 🙂

I bought the following from newegg:

  • D945GCLF2 motherboard – $80
  • Any old PATA (SATA should work, too) DVD Burner – $25
  • 2GB Kingston 240-pin DDR2 667 SDRAM – $21
  • APEX MI-100 Black/Silver Mini-ITX Case w/ 250w PSU – $56
  • 80GB Western Digital SATA Hard Drive – $37
  • Shipping/Handling + rush processing – $15

Total cost: $234
Full disclosure: I later bought a cheap USB bluetooth dongle ($25) and Apple’s Bluetooth keyboard and mouse (full retail, ouch) as that was the best wireless control solution, but any USB keyboard and mouse combo should work fine for normal usage.

INSTALL GUIDE FOR RETAIL OS X on D945GCLF2

Continue reading Building a Hackintosh Successful Attempt #1

Use vi key bindings in bash

A long time ago I used ksh with vi key bindings, and life was good.

Then I moved on to bash, but for some reason, I never investigated using vi key bindings. I simply lived with the defaults (which, for the record, are emacs-like key bindings).

So, just the other day I said to myself, “Self, I want to use vi key bindings in bash. I want to again experience the joy of traversing and editing my command line in COMMAND MODE. I want the speed and the power of my precious vi (well, I use vim) at my finger tips. And I NO LONGER want to waste time holding arrow keys or to think about using emacs-like commands.”

So, I fired up google.com; low and behold I stumbled onto this little post about using vi key bindings in bash and zsh. So sweet!

In a nutshell, the bash command to enable vi mode is:

set -o vi

This can be set in your .bashrc file, and if it doesn’t pickup when you start a new terminal session, add something like this to your .profile or .bash_profile:

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

With vi mode enabled, you’ll start your bash session in insert mode, so things should behave as normal. But, to turn on the power, just hit the ESC key to enter COMMAND MODE. 🙂 Now all your vi commands are availble. Move to end of line with “$”, beginning of line with “^”, delete a word with “dw”, etc.

Enjoy!