Saturday, May 29, 2010

Memorial Day Weekend Project 2010

My daughter Zoe is getting old enough to notice things and decide she wants them. For instance, driving through neighborhoods she's been noticing all the swingsets and backyard jungle gyms. She's decided it's time she had one. I checked out the local hardware stores to see what they wanted for a kit thinking I'd save money over having one delivered if I do the assembly. Home Depot had nothing. Lowe's on the other hand had a nice set and you could buy many of the parts separately. But, for a slide platform and slide it's about $680. That's $80 just for the slide!

I noticed people tend to just put slides out for the trash when they are done with them. They are in perfect shape, nothing wrong with them. I decided to grab the next one I saw. It's blue and about 5 feet tall. It's great. Now I needed a platform. The platform being $600 itself, I figure I've got to be able to make one cheaper if I design my own.


I designed this Slide Platform in sketchup and shared it in the Google 3D Warehouse. This let me make all my measurements and work out exactly how much of each kind of board I would need.

Saturday morning I went to Lowe's and bought the lumber. It's $302 worth of materials including some bolts and screws. The screws alone were $50! Load the lumber on the cart, pay, load the lumber on the car, unload the lumber into the yard and by noon, I've had it. Time to break for lunch then get building.
By 4pm I had this much done.

Checking the weather I see that Sunday is supposed to see record high temperatures so maybe I can get some done as the sun goes down. It looks like it's not getting finished till Monday.

Sunday evening I get some of the upper decking done and call it a day.

I've done a bit of deck building working summers with my father. A project like this is doable by one person in a long weekend. What gave me the most bang for my buck is the impact driver I bought. Using a regular screw gun you burn a lot of energy trying not to strip the heads off the screws. You have to soap up the threads and push real hard so the bit doesn't slip out. It's really hard work and very time consuming. The impact driver puts a 3 inch galvanized screw into a board with a knot in it like it was going through sheetrock. It saved so much time and energy I'm certain it was the key to successfully completing this job in a weekend.

Monday morning I'm up bright and early. and by noon I've put in the last screw, time to play!

Friday, February 13, 2009

How to set up a .local subdomain on mac OS X

Background


I'm using Passenger(mod_rails) on a macbook running OS X 10.5.6. I'm experimenting with making a rails app that will segment the content into subdomains. There are a few articles that cover doing that, so I'll look into that further when I'm ready. Or perhaps I'll just try out subdomain-fu. I know how to get my DNS set up with CNames so that the right domains resolve to my hosting account, but how do I test with subdomains locally?

Investigation


When I add the app to Passenger how does my machine suddenly know to resolve newapp.local to 127.0.0.1? I thought I'd find entries in /etc/hosts but there are no changes from the pref pane in there. I did some google searching but it seems it's a hard thing to pinpoint with search terms. So I found that the Passenger Preference Pane source is on github. Having a poke around their source I saw a command I recognize dscl. Here's what PassengerPrefPane does: dscl localhost -create /Local/Default/Hosts/sub.domain.local IPAddress 127.0.0.1
I keep forgetting about dscl on the mac. It essentially replaces the NetInfo manager in prior versions of OS X. I noticed I don't have that app anymore.

Solution



  1. Use dscl to setup the subdomain to point to 127.0.0.1 as above.

  2. Configure apache for the subdomain. The passenger pref pane manages files in /etc/apache2/passenger_pane_vhosts/ where you'll find one file per app you've configured. Edit the app you want to use subdomains on and add the line ServerAlias sub.domain.local.

  3. Restart apache


Your subdomain should now resolve to your rails app locally. You could have used an entry in /etc/hosts also. I keep forgetting about dscl so I really want to get into the practice of using it more.

Friday, December 5, 2008

David Byrne and his new monkey man

From time to time I get a few minutes where I've caught up on rss feeds and I have a look through my bookmarks for something interesting to read. I am never disappointed when I come back to David Byrne's Journal. His most recent post, Planet of the Neanderthals, is a musing on what might be if we start reviving woolly mammoth DNA. It's a fascinating scenario he paints.

Although, I was a bit surprised that he didn't entertain the idea that we could be lead to this inevitable due to climate change. He does an excellent job of foreshadowing this line of reasoning at the beginning of the piece but then doesn't follow through. I think that I've come to expect ideas like this to be spoon fed to me these days. And this is why I love checking in on Byrne. He never fails to give me something to think about.

Thursday, August 7, 2008

Why I Dreaded Comcast's Purchase of Plaxo

When I heard the news that Comcast had just bought Plaxo I got this sinking feeling. I like Plaxo. It seemed a good solution to gather up all my address books and clean them up. I even thought their premium services were worth the price. I really liked the de-dupe feature. I loved that it imported all my contacts from Linked-in. That's it though. The premium services numbered exactly 2 but they looked good. So I signed up for the premium service.

Then I heard that Comcast bought Plaxo. My first thought was, hey, I'm a Comcast customer and now the premium service will be free, yay! My second thought was, oh wow, they'll probably screw it up somehow.

I got an e-mail from Linked-in the other day. Someone I used to work with just connected to me. I thought, cool, I've got Linked-in connected to Plaxo, connected to my Mac at home, connected to my MobileMe account, so, that person should show up on my iPhone in a few minutes. No Love! Why not? Plaxo, it appeared was the weakest link in the chain. The contact never made it there. So I checked my sync settings and Linked-in was not listed. Not in the settings I already made and not as an option for setting up a new sync connection.

I went straight to the online support and was connected to "Gary" for a chat. After explaining my problem to him and waiting 10 minutes or so for him to, presumably, go away for a while and work out what I meant, he informed me that having Plaxo sync with Linked-in was technically challenging so it was dropped. DROPPED?! WTF?! Did I miss the news? Did I miss the e-mail that should have informed the premium customers that paid for this particular feature? No. Gary assured me that an e-mail had in fact went out. I asked him to please forward it to me. As there was nothing else Gary could do for me at this point the chat concluded.

I received the following e-mail:

Hi Carl,

Thank you for contacting Plaxo VIP Chat Support!

As I understand it, you want to know the status of ‘LinkedIn account sync with Plaxo online account’ issue.

We are sorry to inform you that we had technical difficulties syncing with ‘LinkedIn’. Therefore, we have removed it from ‘Plaxo Premium Suite’ features.

If you have any other issues with your Plaxo online account, please let us know. Thank you for your support and understanding.

Sincerely,

Gary
Clearly Gary had just typed this up and it wasn't a copy of the original notification. I suspect there never was one.

Did I actually miss the news? Maybe someone can help me understand why I feel I paid for something that is now half of what I agreed to.

Thursday, November 29, 2007

Using ruby to get at your mac unix mail

The Problem


I run a mac at home. I use it for music, photos, web development, syncing my iphone, etc. I've got a number of backup jobs and maintenance tasks set up running from cron. When cron runs jobs the output goes into mail messages in /var/mail/<user>. This is where unix mail is kept by default on a mac. You can get at it from the terminal by using the mail command line interface. That's ok but it's not where I look for all my other e-mail. I use gmail for my primary inbox. It would be ideal to have my unix mail post to my gmail account.

The Options


  1. I could set up a full mail server and open POP ot IMAP and have gmail suck over the messages. But, that seems like it could lead to a lot of late nights messing with things like MX DNS records and compiling bits of server code. Also, I'd have to start over when I finally get around to installing OS X 10.5. Ideally, I'd like to do something in my user account that doesn't mess with my machines default config.

  2. I could get procmail at procmail.org and compile it and get it to run just under my user account. Have you looked over the configuration file format of procmail? It's cryptic. I learned it once back in college when I set it up on my university account but there must be something simpler.

  3. I'll just forward the mail! But I can't. Unless you modify your systems settings it can't route mail anywhere but to local accounts. The key to my solution came from looking at the procmail config. To set up procmail on a single user account you use the .forward file to get your mail passed to it. Great! What else can I use .forward for? Well, you can set up your .forward file to pass your mail to a ruby program, any program really, but I'm on the ruby bandwagon at the moment.

The Solution


It's simple, it's straight forward, it doesn't involve building and configuring servers, it uses ruby, what more could you want?

The .forward file


\carl
"|/usr/local/bin/ruby /Users/carl/development/ruby/email/unixmail.rb"

The first line says deliver the mail to the carl user account and don't expand forwarding any further. This makes sure I still get the mail in my unix mailbox. It's not necessary but until I handle the remaining issues listed below I'm being paranoid.

The second line says to pipe the mail message to my ruby script.

The ruby script


unixmail.rb

require 'net/imap'
require 'time'

user = 'xxxxxx@gmail.com'
password = 'xxxxxx'

message = "$quot;
while gets
message << $_
end
imap = Net::IMAP.new('imap.gmail.com', 993, true)
imap.login(user, password)
imap.append('inbox', message, [], Time.now)

That's it. Collect the whole message, login to gmail, put the message.

The Leftovers


As a follow up, I need to get back to this script and make sure it deals well if it can't get to the gmail imap server. Obviously I need to handle the exception raised but haven't decided what I want to do at that point. Or I should look into what mail does if something in the .forward file fails, does it retry?