The Barrettocracy
Barrett's Writings and Stuffs

iPhone Backorder Status

Posted on July 18, 2008 at 09:08 AM

Lots of people ordered iPhones at AT&T locations under the Direct Fulfillment method, and we are getting anxious. They are shipping out, but in more of a trickle than a flood. I found a forum of other people who are just as neurotic about it as I am, which makes me feel a little better. This time last week was the Day Of The iPhone Launch, and I was like a kid on Christmas morning. I could Not Sit Still.

So now we wait.

Someone on the forum whipped up a screen scraping script that would tell you how the orders for the store you placed your order is fairing. We brought his server down. He came up with another version of the page, which is here.

I also decided to whip up a quick and dirty ruby script that does the same thing. I called it att.rb on my compy.

UPDATE: fixed some formatting with the code vs blog markup and added the queue. UPDATE 2: redid code to be a little more ruby and a lot less perl. UPDATE 3: Added better reporting on cancel status.

Post continues, click to read more...



Marshal Ruby Objects With YAML

Posted on July 10, 2008 at 10:00 AM

I found a lot of documentation that told me how to put an object into a YAML file. In my particular case I am reading through a file that needs to create or update a lot of things. I show the user what's about to happen and give them 1 last chance to back out.

I store each set of changes/additions in an object, and it works great. You have something that is nice and legible, too.

The problem is that retrieving the info from the YAML file was proving difficult for me.

I did what this documentation told me to do, and I got an error. After much googling and cursing, I found this post that said they also had trouble and gave up because XML is easier.

F that.

So I got it to work, and here's what I did...

Post continues, click to read more...



Conferences

Posted on July 09, 2008 at 11:13 AM

I work for a market research company that is also a part of AOL (which is also a part of Time Warner). Our stock price is not awesome right now, either.

So I went to an industry "technology" conference in NYC a week or two ago. It was really just an excuse for the industry organization to bilk some cash out of our companies. The content was really light, and I was disappointed to see that the ratio of legit "tech" people to "brass" people was terribly skewed in the executives' favor.

That conference either needs to be redone to actually cover technology, or it needs to go away and be rolled back into the main organization conference. That's just my opinion.

To balance the scales I am now going to the Lone Star Ruby Conference in Austin. It's wicked cheap, and filled to the brim with content. The creator of ruby is also speaking. How freaking cool is that?!?

I'm totally pumped.



Sweet Cooking Site

Posted on June 19, 2008 at 12:33 PM

I like to cook. Mostly I like to bake, but time in the kitchen where you can create something that is good is always rewarding. I just spent my lunch hour going through a handful of blogs that I like to read. One is the 37Signals "Signal vs. Noise" blog. They had a link to a cool cooking site: http://www.cookingforengineers.com/

Their recipes aren't lists and paragraphs. It's a chart of sorts. You'll have to go check it out and see what I'm talking about.



iTunes Now Playing

Posted on May 31, 2008 at 10:36 PM

I've wanted to include a little blog candy for a while, and this weekend I made it happen. I like how you can see what's playing on my iTunes in iChat or AIM (Adium actually). I wanted to do the same thing on my blog.

I found a nice plugin for iTunes that enables this. Here's how it works:

Post continues, click to read more...



Mongrel And Site Stats

Posted on May 28, 2008 at 09:22 PM

I recently got a VPS with Dreamhost, and am now serving this blog with 1 mongrel rather than a handful of FastCGI processes. So far the default out of the box DH config is doing me right. This blog doesn't see a firehose of traffic. Yet.

There is an issue, though. I got confirmation from the L2 support on this, as well. The default stats link breaks with the proxy setup for Mongrel. The answer is to do some more Apache config, but you don't have access to that config.

You also cannot "turn off" Apache from what I can tell (and have read on other blogs). I have a couple of feelings about this:

Post continues, click to read more...



My Beef With Yahoo! Webhosting

Posted on May 23, 2008 at 02:45 PM

Backstory

Back in the day I landed my very first website gig. I found a company that had positive feedback and placed well on a rating site or two. I didn't really know what I was doing, but I had a gig. The company I chose for my host was CI Host. They were not good, and in the end they were dodging my calls and I had to issue some stop payments with my credit card company.

I got another gig for another site, and I needed a host. At the time I decided to just go with a really big company to compensate for the issue I had with the previous host. That company was Yahoo. It seemed like a great idea at the time for a few reasons (big company, search engine, nice control panel, supported perl and PHP).

Post continues, click to read more...



VPS Baby (Cacheing Is Cool)

Posted on May 17, 2008 at 11:22 PM

I am on my Dreamhost VPS now. I can see how heavy Apache or a Rails app is as I monitor my memory usage with top. I have a handful of rails apps running on my VPS, and I am more mindful of these sorts of things all of the sudden. I think I may have been one of those jackasses sucking down the shared host resources.... Sorry other people on lara.

Simplelog is a lightweight rails blogging app, and it's the one that I use. Typo on the other hand leakssssss. I have 3 instances of ruby running right now, though, and they are taking up about all the memory I have allotted for this VPS.

So I am learning about cacheing in a rails app, which is nice. Anything that you cache lives in the public folder of the app. Anything that is in the public folder is served by the web server rather than the rails app. So you can keep ruby/rails from spinning up and sucking down your resources for a page that can be cached. Sweet.

Note that anytime you deploy a new version of the app you reset your cache because you're pushing up a fresh copy of your public folder. That is if you didn't check in the cache from your development app. You would have had to turn cache on in development in order to do that, though.

VPS is cool, and I am not my administrator on Slicehost. Yay.



Random Bits

Posted on May 11, 2008 at 07:57 AM

I don't have anything mind-blowing to share, but I have been busy with a lot of random things.

At work we're still working on this phat rails project. It's a support application for an even bigger project. Most recently we cobbled together an image server that serves images via Tomcat (which is what the primary application is server through) using an HTTP request. Why did we do this? Because Apache mod_rewrite is not our idea of fun. The rails app takes the images and thumbifies them in real time using RMagick (rails ImageMagick). I'll then use a lightbox plugin to show the full image. Yay.

I also have a handful of websites for clients for my "side gig." Most of them are PHP, which I decided that I am done with. That's probably part of the reason that I am also done with Perl. PHP just leaves a bad taste in your mouth, you know. It's like that rancid grease they use to cook your fries. The fries may taste good at first, but in the end they are really really really bad for you. That's PHP.

So I'm working on moving these sites to Dreamhost where I can happily serve them in Rails. It's slow-going, but you pick up some good tips with these sorts of things. These sites don't have a lot of complicated stuff going on in them, so it's been a good opportunity to get back to the basics with the MVC stuff.

I also just discovered last night that Network Solutions (the host) makes it really difficult to transfer a domain away from them. You cannot unlock the domain in the control panel if you are "just" the admin or tech contact for the domain. F that. Games like that may move Network Solutions into the realm of CI Host as the Most Bastard Host Company Ever. Probably not, though. CI Host were actually thieves. I got out of that deal thanks to Citibank stopping payment on some old charges. Seriously - they are crooks.

I'm also trying to find some freelance graphic artists in my area that won't cost a lot of dollars for some site design.

I did an MS 150 ride last weekend -- I rode my bicycle 150 miles in 2 days.

We're about to redo our backyard.

Good times all around....



Apache2 and Leopard

Posted on April 27, 2008 at 10:50 PM

I recently upgraded from Tiger to Leopard (the newest Mac OS). The upgrade went VERY smoothly. I chose the basic "upgrade" path rather than the "archive and install" bloat or "scorched earth" start over again. I did this because I do web development on my Mac, and I didn't want to reinstall all that stuff. Yes - I know, most (all?) of it is in /usr/local, but still.

Leopard ships with Apache2 rather than the Apache 1.x version that was in Tiger. This is great, except that Apache hates me.

Post continues, click to read more...



Capistrano, Subversion, and Sybase

Posted on April 24, 2008 at 05:02 PM

I posted a few weeks ago about the troubles I had with capistrano and CVS. I got the project converted from CVS to Subversion, but the versioning was all jacked up. No worries - I'll start with version 1 in svn.

Then we got busy working on the app.

Post continues, click to read more...



Slicehost Is Cool

Posted on April 15, 2008 at 10:45 PM

But....

I don't want to be an administrator. I want to make the pretty pages that do the neat things. I don't want to worry about whether I have a hole in my firewall or deal with the Apache config stuff in general.

I spent the last 9 days playing with server config stuff rather than working on the apps that I have the hosting for. Don't get me wrong -- I had some good stuff in place. I just don't really know how secure it all is or how easy it will be to add additional domains to the setup. Apache whips me and security scares me.

I am impressed with the company and how quick the small slice that I had was. I also got a LOT of really good feedback from other SliceHost users.

I just wish they had a control panel that you could use to deal with the actual hosting bits if you wanted to. They do have a control panel, but it deals with very few details with the OS mainly.

So I have put in a request to upgrade to the PS service with DreamHost. I will still be subject to the filer issues they had recently. I will minimize my risk a little, though, by not hosting email with DH. Why would you when you can use Gmail for FREE? Gmail beats Squirrel Mail all day long. The DH IMAP and POP setup is a little squirrelly, too (ha ha).

I have learned more about the magic of DNS in the past few weeks. The DH issue was good in that respect.

So I have that going for me.



Local Ruby Brigade Talk

Posted on April 04, 2008 at 04:45 PM

I participated in a lightening talk at the local Ruby Brigade meeting the other day. Nothing fancy - just a little recap on my Big Nerd Ranch experience.

The group is pretty smart, but I thought I was probably not the only nuby in the area, so it might be topical for someone else.

Here are the slides:



Dreamhost Issues

Posted on April 02, 2008 at 06:36 PM

Background

I have 3 sites currently hosted with DreamHost. I actually had a fourth site that I was in the process of testing on DreamHost, but I pulled it back.

I have a handful of sites that are also hosted with Yahoo, Network Solutions, and 0catch.

There are things that I like about the control panels for Yahoo and DreamHost. I generally do not like the control panel for Network Solutions. It is not quite as bad, but very close, to GoDaddy's control panel that I fortunately no longer have to deal with.

There is another host company that I used a long time ago. They tried to rip me off, and I don't remember anything about their control panel. I can tell you, however, that ci host is the devil.

So I have some experience with a few different host companies.

In the near decade that I have been doing websites I have never had the week that I just finished....

Post continues, click to read more...



Ruby on Rails Is A Good

Posted on March 28, 2008 at 02:30 PM

I stumbled across a post the other day that stopped me down and made me think a bit.

I don't know that I necessarily follow the logic completely. I do prefer ruby at this point over anything else. I do really dislike programming in tcl and php. That was true before I picked up ruby, though.

I don't know that I would move to hack ruby. Actually, I do know. I wouldn't move. I would find a way to work from remote and travel as needed, or find another opportunity.

I do think that this is an exciting time. Exciting for me. Ruby pulled me from a deepening rut. I think the principles around ruby and rails are also making this an exciting time.

We challenge each other at work, and I challenge myself at home. I do this for fun, and I look for opportunities to do it more.



In Place Editing

Posted on March 23, 2008 at 09:00 PM

I like the in_place_edit plugin.

I needed it to work with validations in my model, though. It doesn't.

I also needed it to work with a select box. It doesn't.

So after some googling I found a few extensions that accommodate each of these shortcomings....

Post continues, click to read more...



Capistrano + CVS = Fail

Posted on March 16, 2008 at 09:43 PM

We use CVS at work. We have an app that a handful of people are working on. Deployment by hand kind of sucks.

No problem, I say. Capistrano works with CVS now. Hooray!

It does "work" inasmuch as it does not barf when you run cap. It doesn't so much actually work, though. For me. The CVS command that it generates is crazy honked. Maybe my CVS is bad -- it's not you Capistrano, it's me.

I never found any documentation on what variables were available for the setting either. I did look at the source code of Capistrano, though.

Post continues, click to read more...



Nasty Perl Habit

Posted on March 08, 2008 at 01:00 PM

I have been working in ruby and in rails for a few months now. I came back to my Large Multinational Corporation recharged with a new zest for life. Flowers smell better. The sky is bluer. My children suddenly started behaving.

Maybe not all of those things, but I do enjoy my job again.

We recently took out a Basecamp subscription to manage the handful of projects that have become collaborative projects. This is also very exciting because we're finally doing things that we've been talking about doing for years.

We're making decisions together, and the office is more fun in general. At least this is the case on the technology side of the office. Dealing with the customers is still dealing with the customers - if you know what I mean.

Now on to the point of this entry....

Post continues, click to read more...



Rails Pet Peeve

Posted on February 29, 2008 at 04:00 AM

There is something that has been bugging me since I first looked at the skateboard book. I love the framework, and I love ruby. I also love consistency.

Having a button that does something (submits the form maybe) and a link that does something else (cancels the form maybe) bugs me. I see this a lot, and it always bugs me. I understand that we shouldn't have links that do destructive things. But what's wrong with having a complementary button to the submit?

I think aesthetically functional symmetry is important when we are talking about a visual medium.

So you might catch me putting buttons in place where they ought not be according to some of the purists. Or maybe I will get used to it because I see it all the time now and get over myself. I am finding it less jarring now than I first did.

Sigh



Converting From CVS to Subversion

Posted on February 24, 2008 at 10:24 PM

From CVS to SVN

I manage the website for a non-profit bicycle advocacy group. It's a great sandbox to try stuff out, I got the idea this weekend to take the code repository for the site, which was CVS on my localhost, and put it up in a Subversion repository on my host (Dreamhost). I have really taken a liking to svn - especially hosted not on my computer.

From what I can tell it went well, and I got it on the first run. How often does that happen? There was only 1 very minor glitch that was easily fixed. Here are the steps for this magical conversion....

Post continues, click to read more...



Let's Split

Posted on February 16, 2008 at 01:30 PM

Compare and Contrast

I was planning on this next entry being a comparison of regular expressions between a few languages used in web development (Perl, PHP, Ruby, and Tcl). Tcl? Yes - it's baked into AOLServer, which we still use some at my Large Multinational Corporation. With this week being Valentine's Day, though, I was inspired to go in a different direction.

Let's split!

I decided to use an example I have used in the real world myself: split a series of key-value pairs (querystring data, for example) and put the data into a structure that makes it easy to get to the bits that you need.

But wait, you say. I can already get to the key-value pairs in my querystring. True. This is useful for parsing data out of a server log.

Post continues, click to read more...



Syntax Highlighting Test Post

Posted on February 13, 2008 at 12:35 AM

This is a test post with some ruby code in it.

  def show
    @product = Product.find(params[:id])
  end

  def new
    @product = Product.new
  end

I used the Google SyntaxHighlighter

Here is an even better example of this in use: http://www.nullable.se/past/2007/12/12/syntax_highlighting_in_posts/



Big Nerd Ranch

Posted on February 11, 2008 at 08:15 PM

I Am A Big Nerd

I had seen a banner for the Big Nerd Ranch on a site somewhere back in December as I was plowing through the skateboard book, and I thought it was pretty clever. I actually thought it looked really great. I sort of filed it away and went on my merry way.

I've recently picked up ruby and rails, and I really dig it. We do a lot of scripting and site stuff, so this would be great. I also do some work on the side, and had already started planning how to redo the insanity of my PHP and Perl sites in Rails.

I got to the point where I had sort of hit a plateau, though. This was about the same time we were planning training for the year at work. There happened to be a Big Nerd Ranch RoR Bootcamp a couple of weeks away, and I jumped on it.

The price was a bit of an issue for us. At my Large Multinational Corporation we do our budgets with separate lines for travel, food, lodging, and training. This would hit the training budget pretty hard. If you break it down, though, it's really not a bad price. I figured the actual training probably cost $2000 - $2500 when you factor in the room and board. And how do you put a price on unlimited access to the instructor and other smart people in the class?

My boss (and my boss's boss) were generous enough to make it happen. Off I go.

Post continues, click to read more...



Typo: No, SimpleLog: YES

Posted on February 10, 2008 at 11:43 PM

Hello, World. There - I said it. This is the first post on my shiny new blog. It's actually my second run at a blog, but you wouldn't know that because I couldn't get the first run to deploy. I will admit that I am not a Rails jedi (yet), but I did spend a LOT of time crawling through Google to get the thing running. I even found a nice blog that was written about a week and a half ago for the EXACT steps I needed to do to get it to work on the host that I am using (Dreamhost).

No dice. I suck at Rails.

Then I found some nice blogs that compared Typo to WordPress or Mephisto. I even saw where some people recently switched from Typo to Mephisto (which isn't being all that actively developed on). The results were a mixed bag. Typo seems to have a pretty heavy memory situation going for it, and on a shared host that poses a problem. It also had a pretty serious not running in the first place problem for me.

Enter SimpleLog. I started seeing some comments about why didn't you try SimpleLog. It is, after all, pretty simple.

I checked it out, and here we are after only about 2.5 hours of work. That includes the time I spent checking it out on my localhost. It also includes the time I spent helping my wife with a project that she is working on for my son's school. My svn version is only 7, with the first version being the initial checkin before anything else was done.

Maybe I don't suck so bad afterall. Tomorrow will be another day, though.