M-x Kelsin

A Hacking Blog

Rails App Templates

I finally got around to creating a ruby app template. Of course my recent ruby work is not centered around creating new apps but I’m still glad I did it. Will save my some time!

You can read more about app templates or what a great screencast about them at other places. I don’t want to just repeat what others have already said but basically I created one so far and put it up on my github account.

The one question I have is about running this on a server without the haml gem already installed. I don’t really want it to try and install the gem in my home directory so we’ll see how that works out next time I have to do it. For now on my current linode it sets up a new rails project pretty nicely for my needs.

The one other interesting aspect of my template is my config system that I just wrote. It’s only two lines and it’s heavily stealing from other blogs. I never really had a good app config system and I don’t really want to use a plugin so I quickly wrote my own. It basically supports one config file (config/config.yml) and lets you setup default settings and then override / add to the defaults with per environment settings as well. For my wow raiding site this is working pretty well.

Here is the initializer file (config/initializers/config.rb):


CONFIG = YAML.load_file("#{RAILS_ROOT}/config/config.yml") || {}

CONFIG = (CONFIG['default'] || {}).symbolize_keys.merge((CONFIG[RAILS_ENV] || {}).symbolize_keys)

And my config.yml file from my raid site. This site uses a development environment (all defaults) and then two different production environments since I run the site for two different guilds. You can see how the “dota” environment inherits the auth setting while the “cod” environment adds a forum setting that I use when using phpbb authentication.


default:

  guild: Your Guild

  auth: login



cod:

  guild: Cake or Death

  forum: http://forum.cakeordeath-guild.com

  auth: phpbb



dota:

  guild: Daughters of the Alliance

Pretty simple and now I don’t even have to do anything to new rails projects to use it!

I lied about the last update a.k.a. I hate firewire cables!

So when I got my macbook I spent all evening installing BFD2, Logic Studio (with all content) and World of Warcraft (plus other blizzard games, go battle.net!). The next day (Sunday) I immediately started recording the proposal song.

First off the sound card did not seem to like being plugged in via the hard drive. I didn’t think much of it. Plugged the hard drive in via usb and sound card via firewire.

Right after adding drums the sound card started producing static and heavily distorting/detuning the output. I got afraid I was overloading the CPU/HD even though neither meter was very high. I did a lot of testing but really couldn’t get anything working that whole day.

Monday night I decided to test everything and eventually ended up uninstalling/installing the Duet’s software (plus full power offs in between of course). I also unplugged EVERYTHING including my USB mouse. The only stuff plugged into my computer was the Duet, power, DVI adaptor for second monitor and Ethernet cable. This let me play guitar for about 20 minutes before it started producing static again (I couldn’t drum cause I wanted to test without ever opening BFD2 and without using any USB midi devices). I got fed up and send lots of emails describing what I did in detail to the Apogee tech support line.

Tuesday came and the email back from Apogee impressed me. Basically it was like “This could only be a bad unit or a bad firewire cable” which proves they actually READ my novel’s worth of emails I sent and actually had nothing else to try. A+ to Apogee for not wasting my time!

I have no other 400-800 firewire cable to try but I did have my hard disk plugged in via USB that I could test. So I plugged that in via the 400-800 cable and sure enough in about 5 minutes I got the mac “Drive disconnected improperly” message even though I hadn’t touched the cable. This pretty much meant it has to be my firewire port (unlikely) or the sound card.

This morning I returned the cable for another one at the Apple Store. I want to take a second to talk about this too. I called at 8:45 to ask the Apple Store if I need to print my emailed receipt to return the cable. They said no. They don’t open till 9am so I was very happy they answered the phone. When I got there I said I needed to return an item and the guy said “You’re the one who called? Awesome, head right up and grab a new one and let me see the old one.” I go pick out another one and on the way down another employee said “You’re the one returning your cable?” to make sure I wasn’t just taking it away. He said good luck and when I got back downstairs the original guy told me to head to the back counter and they had me all set. Sure enough the guy in the back was like “Here you go” and handed me a new receipt for the cable and I was done. Talk about efficient use of my phone call and multiple employees to make my experience awesome. I love this place.

Anyway, since this morning I’ve been listening to iTunes on my laptop via the Duet at work and no static so far. Lesson learned? Always have spare cables to test with!

Last Laptop Update

So when arriving at the UPS location there is no one there, and no “front counter” area at all. We eventually drive a couple of places and check out this empty room that has some metal detectors in it but no people. I find a security guy that chuckles at me cause he can’t figure out why anyone on the phone well tell me to come here to pick up a package since like… no one is here.

I call the 1-800 UPS number and get a great guy that puts me right through to his supervisor and the supervisor immediately calls the UPS Center that I was at. He puts me on the direct line with the guy at the center who is like “Cool I’ll come right out” and sure enough he does come out of the building with my laptop.

So after a pretty busy week at work, with lots of laptop woes I do now have the laptop and I’m writing this post from it. Hopefully I didn’t lose any twitter followers in the process! Now to install Logic and get some recording done before the day is over!

UPS has no clue what they are doing

So this morning I check my tracking info and it says that the package is in Watertown MA and that the delivery date is Monday. I decide to call them and find out if it’s possible for me to pick it up. The automatic phone system says “You’re package is out for delivery”.

This clearly makes me very excited.

When I get an agent on the phone I ask to confirm this and she says “Sorry, the automatic message must be mistaken you’re package is not out for delivery. It will be there on Monday.” After confirming this again and confirming that I can’t go pick it up I hang up.

We go out to breakfast, we get home to a notice on the door saying they tried to deliver a package from Apple Computers.

I call them immediately and finally get someone on the phone. The nice lady (who of course I didn’t get the name of) says that they will get a research team on it and try to find the package and get the driver to bring it back to my apartment. I say thanks and she takes my phone number down.

Now that it’s an hour and a half later I call back wondering about the status and of course get run through 3 different people who all can’t find a record of any of what happened 1.5 hours ago. The most recent guy keeps saying that my phone number might have been taken down wrong? WHY DOES THAT MATTER! We are talking about the same package designated by my invoice AND tracking number. Why should my phone number be required to figure out what happened an hour and a half ago? Are all CS requests filtered by phone number and not package number? He also had the balls to tell me that anything communication I would get back should get to me by Monday and that they don’t guarantee any communication back on Saturday. WHAT??? We’re talking about you guys screwing up and then your guys telling me I’ll get a call back soon about the driver bringing me my package! Getting a call on Monday means NOTHING.

So now I “supposed” to have a manager call me back within the hour. I hope that freaking happens. This is ridiculous. If UPS didn’t TELL ME ON THE PHONE that my package was not out for delivery I would have it by now. Not to mention calling back to try and get a status is impossible cause apparently NOTHING of what my first agent told me got saved to any type of note on my account.

Update in Laptop Saga

This morning I was REALLY happy when I woke up to a UPS tracking email saying the laptop would get here tomorrow! Then at about 10:30am the tracking info removed the estimated date. I got worried.

Turns out the laptop got held up by the Alaskan volcano erupting ash. I wish I was kidding:

Tracking

News Story about Volcano

How nuts is that…

EDIT: UPS guy on the phone says the package has cleared customs in paperwork, but they don’t have the pallet that it’s on et (over in Alaska) so it’s staying “Exception” until they get it in theirs hands so they can guarantee a date. Right now he’s saying it’s scheduled for Monday so just delayed enough so I don’t have it for this weekend. The weekend I have at home with nothing to do… oh well. At least the whole idea was to be portable so I can bring it with me to parents house next weekend right?