Text

Setting up a git repository on a LAN under OS X

I decided to embrace distributed version control. I’ve been using Mercurial a little because of the Cocotron project on Google Code. But since git support is built in to Xcode 4, I decided to use git for my own projects so that I’ll be ready on the day when I switch to Xcode 4. I had already set up a Subversion server on my development machine at work, so I figured setting up a git server wouldn’t be too difficult. For the most part it wasn’t, but there were a couple stumbling blocks that I’m going to document here to help others trying to do the same thing (and my future self when I need to set up a git repository on another machine).

My need is for a repository server on a local LAN where I’m not worried about malicious users. So I don’t need to concern myself with access over the Internet or ssh. Here’s what I did:

  1. Install git. This is documented in plenty of places.
  2. Put source code in a shared location. In my case I put it in a folder in /Users/Shared/git.
  3. Create the git repository (This step turns out to be wrong, but gets fixed later.):
    git init
    git add .
    git commit
  4. Set up the git server. Create a file called git.plist in /Library/LaunchDaemons with the following content:
    <?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>git</string>
    	<key>OnDemand</key>
    	<false/>
    	<key>ProgramArguments</key>
    	<array>
    		<string>/opt/local/bin/git</string>
    		<string>daemon</string>
    		<string>--export-all</string>
    		<string>--base-path=/Users/Shared/git</string>
    	</array>
            <key>ServiceDescription</key>
            <string>git Version Control System</string>
    </dict>
    </plist>
  5. Clone the repository:
    git clone git://machinename.local/projectname projectFolderName
  6. After making changes, commit them locally:
    git commit -a
  7. Now push them to the repository (and experience the first error):
    git push
    gives the error:
    fatal: The remote end hung up unexpectedly
  8. This is because the default settings for the git daemon allow only read access. To enable write access, add this string to programArguments array in git.plist:
    --enable=receive-pack
    So now git.plist looks like this:
    <?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>git</string>
    	<key>OnDemand</key>
    	<false/>
    	<key>ProgramArguments</key>
    	<array>
    		<string>/opt/local/bin/git</string>
    		<string>daemon</string>
    		<string>--export-all</string>
    		<string>--base-path=/Users/Shared/git</string>
    		<string>--enable=receive-pack</string>
    	</array>
            <key>ServiceDescription</key>
            <string>git Version Control System</string>
    </dict>
    </plist>
    To get this change to take effect, either reboot or execute the following commands in Terminal:
    cd /Library/LaunchDaemons
    sudo launchctl stop git
    sudo launchctl unload git.plist
    sudo launchctl load git.plist
  9. Try again to push (and experience the second error):
    ! [remote rejected] master -> master (branch is currently checked out)
  10. Stack Overflow to the rescue!
    git config --bool core.bare true
    Then hold breath while deleting all files except .git directory in repository folder
  11. A working git repository

Some helpful links:

Audio

jonathancoulton:

Thing a Week 44: Big Bad World One

…Our old friend the m7b5 chord is there (surprise!) in the kicker line of the chorus (“me zero”), but it’s not in the same role it usually is when I deploy it - I don’t have the patience right now to figure out what it’s doing there exactly, it’s probably best understood a substitution for something else. Doesn’t matter, it’s delicious!

I think it’s a tritone substitution for the I chord. Without the substitution, the chord progression at the end of the chorus is IIsus4 V I iv I. But the tritone substitution gives that nice (yes, delicious) chromatic move of V iv# iv.

Link

Ryer Island album cover

It’s called The Universal Steve because all four guys in the band are named Steve. We aren’t really all that active at the moment, but I’m proud of the two albums we produced.

Photo
It&#8217;s been one year since adding the Corpse Reviver to our regular rotation. We first heard about it from ranger Dean Shenk on a guided history walk at Yosemite. He said he had seen a nineteenth century menu from a long-gone Yosemite Valley bar. Two drinks that caught his eye were the Corpse Reviver and Samson With the Hair On. The Corpse Reviver wasn&#8217;t too hard to dig up, but I haven&#8217;t been able to find Samson With the Hair On.

It’s been one year since adding the Corpse Reviver to our regular rotation. We first heard about it from ranger Dean Shenk on a guided history walk at Yosemite. He said he had seen a nineteenth century menu from a long-gone Yosemite Valley bar. Two drinks that caught his eye were the Corpse Reviver and Samson With the Hair On. The Corpse Reviver wasn’t too hard to dig up, but I haven’t been able to find Samson With the Hair On.

Tags: cocktail
Text

Attempting to upgrade to iOS 4.3 bricked my iPhone 3GS

So now I have a bricked iPhone. iTunes gave me error code 1611. Something similar happened with 4.2.1 but I was able to get around it by using Xcode to restore back to 4.2. At some point I had a 4.2 beta version installed and that seemed to screw things up. Now when I try to restore 4.2.1 or 4.2 Xcode says the device isn’t eligible for that version. When I try to restore 4.3, Xcode starts the restore, I get the Apple logo and a progress bar on the screen, Xcode says “Waiting for Device” and then after a while, the iPhone screen flashes white and the whole thing starts all over.

I drove the hour to the Apple store in Roseville and went to the Genius bar, but all he did was try to install 4.3 with iTunes, get the same error number, and say there was nothing more he could do and that I could replace the phone for $199.

I’ve read some stuff about getting the phone into DFU mode. Here’s a tip. Start Xcode and open Console when trying to get into DFU mode. When it sees a device in DFU mode, Xcode writes the message “DFU device attached” to the Console. I’m going to play around with that some more and see if I have any luck. If not, I guess it’s time to look into jailbreaking.