Screen for Ruby

I’ve been learning Ruby and Rails the past week or so and I really do love it. However, I have lots of terminal tabs open and this was getting quite annoying. One for MySQL, one for the server, one for the Rails console, etc. Then today I ran across a post in the TextMate mailing list from someone with the exact same complaint. The suggestion? The under-used and oft-forgotten screen command. Ah, ha!

I’m a bit familiar with screen, having used it in the pre-tab Terminal days. Ah, the Good Ol’ Days when I had one window for emacs (before TextMate, obviously), one for this server, one for that process, and a utility shell. I never got too crazy with it, but I was able to use it. I knew its capabilities, I just didn’t need anything fancy.

Today I got fancy.

What I really wanted was a screen configuration file for my project. I figure if I can separate the configuration out that way, then I can have different screen sessions running for different Ruby apps. This might come in handy in other places, too, like when I’m compiling on a remote server. It took a while to get just the right config file. Here it is:

escape "^Ff"

hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]‘

screen -t ruby  1 tcsh -c ‘cd /Users/dmkash/Develop/Ruby/project; /usr/bin/ruby script/server’
screen -t rails 2 tcsh -c ‘/usr/bin/ruby /Users/dmkash/Develop/Ruby/project/script/console’
screen -t shell 3

I’ve redefined the prefix character sequence from C-a to C-f because I still use emacs quite a little bit. C-a in emacs moves you to the beginning of a line.

Next, I did some fancy stuff with the status line at the bottom of the screen. I cannot take credit for it. I found it here. It is quite nice.

The next three lines open up three windows. The first starts the Ruby server for the project, the second gives me a Rails console for the project and the third is a utility shell. Sweet, huh?

Now, to launch a screen session for my project, I just type screen -c ~/Develop/Ruby/project/.screenrc. To make it even quicker, I added an alias with the project name to my .cshrc file. I gave the session a name using the -S project argument and told screen to reattach to the running session if possible using -D -R. My entire alias line looks like this:

alias project    'screen -S project -D -R -c ~/Develop/Ruby/project/.screenrc'

Spiderman 3

We were really excited to see this movie. My son and I loved the first two and he just couldn’t wait to see the third one. So, naturally we had really high hopes. I popped the DVD in yesterday afternoon after their nap.

Here there be spoilers

Before I go any further, I want to let you know there may be some plot spoilers in here. I’m trying not to spell out what happens in the movie, but if you don’t want to know anything about the plot before you see the movie, STOP! Go watch it, then come back.

Back to the review

The credits were really cool. Flashes from the previous two movies are intertwined with web and the “black stuff.” Whether you’ve seen the first two or not, you’re caught up by the time the movie starts. We settled in.

My daughter lost interest after the first hour. I can’t blame her. It took a little bit longer for my son to lose interest, but soon he, too, was running around with Transformers. I almost turned it off myself.

The problem is that they seem to have tried to cram two movies into one. There are three villains and too many storylines going on. You have the love story with MJ, the whole deal with Harry, the black goo, the Sandman, etc. It was just too much. You couldn’t focus on any one plot at a time because just when you were getting into it, they jumped to the next. Some scenes seemed really rushed and there seemed to be several missing scenes. None of the storylines were fully developed and yet the movie was 2 ½ hours long.

Thomas Haden Church is excellent as the Sandman. He does his best with not nearly enough time and was actually able to let the personality of his character shine through. He’s just a poor schmuck who keeps getting himself into the wrong place at the wrong time. I feel for him. Especially because he was really robbed of his story.

The black goo is really cool, but I totally expected it to play a bigger part. Again, the story about Peter Parker and his battle with this alien goo is underdeveloped and only given enough time as it takes for the viewer to understand (barely) what’s going on. There was no big inner struggle, no explanation about what the suit is doing, or why it appears and disappears with irregularity. If I hadn’t read a book my son had about the black suit (about 100 times), I wouldn’t have had any idea what was happening. Peter simply decides its been too much, and loses the suit.

Even the black goo itself is short-changed. There are a few flashes with a professor looking at it under a microscope, but no explanation of what it is, where it came from, how it does what it does, etc. Peter doesn’t seem to fight it so much as toy with it for a while, then ditch it.

And, come on! Is that the best they can do to make Parker look cool? It was a joke! Perhaps it was intended to be, but I think it was the wrong place for it. Just didn’t make sense. If the goo turns him into a parody of Saturday Night Fever’s Tony Manero, then why on Earth wouldn’t he be happy to get rid of it? They needed to make a serious effort there to transform Peter in a way that didn’t make him totally laughable.

Speaking of Peter, since when is he a self-absorbed whiney little bitch? Even before he gets “infected” I’m wondering what the hell happened to him! He spends half the movie crying about this, that, and the other thing; doesn’t have a clue as to what is going on with his girlfriend (to whom he plans to propose?); and doesn’t put much effort into explaining to Harry what happened with his father. Where’s the strong, sensitive (but not too sensitive) Peter Parker from the first two movies? I didn’t buy it.

Venom, too, was gipped. That monster could have been so cool! I was totally looking forward to seeing what kind of havoc he was going to wreak, and so were the kids (my son has had a Venom action figure for about a year now). He was really awesome…in the scenes he had. Topher Grace, like Church, does a great job with what he has, but they just didn’t give him enough time to develop his character. There’s no time for Venom to really show what he can do, which is disappointing.

Poor Harry. This guy gets bounced around like a ping-pong ball: good, bad, good, bad, good… By the end, I really didn’t care much. It made for some good fight scenes, and explained how Spidey could handle all those half-developed villians, but it just didn’t do James Franco’s character justice. His storyline alone could have spanned this movie and another.

Only Kiersten Dunst’s MJ got the same treatment as in the other movies. She cries, flip-flops between the boys, and is generally pretty shallow. I don’t get why they are fighting over her, and I never have. But, whatever.

For the Kids?

I’m pretty liberal in what I let my kids watch, so yeah: I was fine with them seeing this movie. Even though there is lots of fighting, there was no blood and no one really got hurt. Venom is a bit scary, but like I said, we’ve been looking forward to seeing him on TV instead of a plastic figure. He’d probably scare most kids, though. As with any superhero movie, there is a lot of comic-book fighting. If you don’t want your kids to see any violence, don’t let them see this movie.

There was no sex or swearing (well, nothing I can think of), though. Nothing raunchy.

Verdict

Overall, I thought this movie totally felt cobbled together. Like the Raimi brothers took a bunch of, “Oh, wouldn’t it be really cool if…”s and strung them together with a really thin plot thread. The special effects were, as always, very good. It is worth watching again just for the fight sequences. But overall, my rating for this movie is: meh.

And here we go!

The house is on the market—officially. Somehow, I expected something to change when the sign went into the ground. I thought there would be something different in the air. Perhaps our neighbors would look at us differently. People might stare as they drive by.

Nothing has happened.

There’s no big fanfare, no barker in front yelling, “Step right up!” In this market there aren’t even Open Houses anymore.

Somehow, my brain unconsciously built this fantasy that as soon as the sign was planted in our front yard, someone would drive by and yell, “Stop! That’s the perfect one! That’s the one we’ve been waiting for!” They’d ask to come in and I’d take the kids and the dog for a walk around the block as they toured our pristine home and fell in love. I’d return to an offer, right there and then.

I know that isn’t going to happen. Truth be told, I’ll be happy if we can sell by next Spring. Now we wait. In the meantime, I scurry after everyone picking up this and straightening that hoping in vain that I can keep our home in “showing” condition all the time. I’m having nightmares about forgetting to put the key in the lockbox and letting the perfect buyer slip away. I’m obsessing. I have a knot in my stomach that started when we first called the realtor and I know won’t go away until we have signed the sales agreement and we have the keys to our new house in our hands. It is going to be a long year.

The Apps I Use

I’ve wanted to do one of these posts ever since I saw Brendan’s a few months ago. I just haven’t had the time until now. Anyway, here goes:

EagleFiler

I can’t say enough good things about EagleFiler. This is my brain. I dump anything into it that I want to be able to find later, which with my pack-rat nature is just about everything. I’m still trying to find my optimal system of tagging and filing, but with such fabulous search capability, I still find everything. I even use it for my movie catalog and recipes.

Growl

If you are a Mac user and you don’t have Growl then you probably live in a cave somewhere. Growl provides a common notification system for Mac apps. There are tons of applications that have Growl support and there are several different styles. The command-line growlnotify plus cron is the perfect combination for reminders.

Mail.app

This is my mail client of choice. For a long time I was faithful to Thunderbird, but I finally needed to use an e-mail client that was integrated with everything else I was using. Thunderbird is a great client, but its cross-platform nature means that it just doesn’t work seamlessly with just about anything. With a few tweaks, Mail.app has turned out to be quite nice.

SpamSieve

Mail.app has some decent junk mail filters built in, but they weren’t quite up to snuff. SpamSieve adds Bayesian filtering to just about any Mac e-mail client. It also scores e-mail rather than just declaring it Spam or Not Spam. This allows you to set up rules to deal with the almost certain spam messages and manually review the others.

Firefox, Firebug, Web Developer Toolbar

Being a web developer, I can’t live without my Firefox. Firebug and the Web Developer Toolbar are also indispensable. I have tried other browsers, but I keep coming back to Firefox. I’ve been using the version 3 betas and, except for beta 5, they’ve been pretty stable and show big improvements. Beta 5 seems to crash if I look at it funny.

Adium

It seems that every person I know is on a different IM network. Adium neatly ties them all together into one UI for me. I seldom even think about who is on which network.

Fluid

I use a lot of web applications and I used to have about 20 tabs open in Firefox. Fluid provides site-specific browsers for all of them. I don’t know that there is an actual productivity boost, but it feels good to have these sites separated out.

1Password

This is one that I really didn’t think I’d use. It was part of the MacHeist bundle that I bought and I thought, “What the hell?” I love it. 1Password uses the Keychain to save login information for web sites I visit. It is supported in just about every browser (except Opera), and even in Fluid! I get the feeling I’m only scratching the surface of its features, so I’ll have to play with it more.

Quicksilver

This is just automatic for me now and if I sit down at a Mac without Quicksilver, I find it incredibly frustrating to use. This is a swiss-army-knife application and can do just about anything you want it to.

MacJournal

This one I just bought and already I am really glad I did. With two small children, there are hundreds of cute little stories, funny things they did or said, milestones, etc. and I want to capture them all. MacJournal lets me quickly jot down a little snippet of my life. It date and timestamps it so I know exactly when it happened. I can also add photos or sound/video recordings to an entry. Fabulous! It is becoming a digital scrapbook for me.

TextMate

Ahhhhh, my IDE/text editor/blogging tool of choice. TextMate rocks. I use it for all development: Objective-C, Javascript, XHTML, CSS, PHP, SQL, shell script. Also for editing text configuration files (especially Apache) and I’m writing this blog post in it. The keyboard shortcuts, like those of emacs, are now engrained in my fingers.

GeekTool

I forget that this is even running, but GeekTool keeps my external IP address, remote client status, and a few choice logs available on my desktop.

MagiCal

MagiCal is a great little application that puts a small, unobtrusive icon in my menu bar with the date. It is much more flexible than the built-in date/time options.

Curio

I use Curio for brainstorming and organizing my thoughts. I also use it for flowcharting, although it really isn’t built for it. It really helps me when I’m planning out the steps in a particular process.

Chicken of the VNC

Chicken of the VNC is how I access computers in the office to provide tech support or run our custom database applications. It is a great VNC viewer app.

NetNewsWire

NetNewsWire has a lot of features I like: hiding read items, smart categories, Growl notifications. The thing I like the most is the internal browser. I used to have all kinds of tabs in Firefox that were blog items I wanted to read. No more. I keep them open in NetNewsWire and they stay in a sidebar right in front of me, so I don’t forget about them.

Whew!

Well, I was going to include the online applications that I use, but I think this has gone on long enough. I hope maybe I’ve pointed you in the direction of an app that is new to you, but that you’ll come to love as I do. I love trying out new apps, so please post your favorites!

I’m Naked!

With all the problems with Permalinks lately, you might be wondering if I’ve lost my fabulous theme as well. Nope. I’m naked today.

April 9th is CSS Naked Day this year. Today web developers and designers all around the world will be showing off their mastery of web standards in two ways:

First, our design is separate from our content. Content is marked up using (X)HTML and does not contain <font> or (gulp) <marquee> tags. All colors, fonts, sizes, backgrounds, etc. are defined in external CSS files that are organized and easy to update (they are organized, right?). These CSS files are site-wide (as much as possible) and are cached by browsers, making our pages faster to load.

Second, our content is marked up semantically and can easily be used without all the fancy styling. Part of my development process is to review the pages I’m working on with CSS turned off. The fabulous Web Developer Toolbar for FireFox makes this extremely easy and no web developer/designer has an excuse for not taking this step.

Disclaimer

Now, this site is actually a bit of a cop-out. I don’t have any static pages at the moment, I’m running WordPress. I didn’t even write my own templates. All I had to do was install a plug-in.

BUT I do use web standards in my everyday work. I inherited quite a large and complex site built using software that generates HTML 1.0 and full of table-based design. It started out as two web applications and has doubled since I became responsible. Slowly, old pages are worked on and brought up to date. But mostly I’ve been adding new pages or replacing old parts of the app with new parts, etc. These are all written using XHTML and CSS.

So, even though I didn’t code this site, I am participating in CSS Naked Day to show that I do use web standards.

Fun with Permalinks

The two or three of you out there who do read my blog will have been noticing some rather frustrating problems. They are all my fault. I apologize. Here’s what happened, just to explain and to make sure I don’t make the mistake again.

I recently upgraded WordPress on my server from 2.3.3 to 2.5. On my server I keep the previous version in place so that I can easily roll back. I keep the WordPress installations in a directory named with the version, so right now I have wordpress_2-3-3 and wordpress_2-5. So that I don’t have to update Apache as to what version to serve, I have a symbolic link wordpress which always points to the latest version.

My upgrade procedure is:

  1. Copy tarball to install location
  2. Remove wordpress symbolic link
  3. Expand the tarball; this results in a new wordpress directory
  4. Rename wordpress to wordpress_<version>; in this case the new directory was named wordpress_2-5
  5. Copy over everything that I need from the wp-content directory in the previous version to the new version
  6. Copy wp-config.php from the old version’s directory to the new version’s directory
  7. Reinstate the wordpress symbolic link, but this time point it to the new version

At this point I thought I was done. But I forgot one important little file. In order for “pretty” permalinks to work, you must give Apache some instructions. The easiest way to do this is to create a .htaccess file in the WordPress directory. If the permissions on the file are right, WordPress will even update it automatically for you when you change the Permalink setting.

So, this morning I finally realized what my problems were all about, copied that file over to the new version, and BINGO! Amazingly enough when WordPress has the correct configuration files and Apache has its correct configuration files, your blog is served correctly.

Again, I apologize to my few readers out there. I hope you haven’t already unsubscribed. Now I have documented the process and future upgrades should be less painful.

I’m Naked!

With all the problems with Permalinks lately, you might be wondering if I’ve lost my fabulous theme as well. Nope. I’m naked today.

April 9th is CSS Naked Day this year. Today web developers and designers all around the world will be showing off their mastery of web standards in two ways:

First, our design is separate from our content. Content is marked up using (X)HTML and does not contain <font> or (gulp) <marquee> tags. All colors, fonts, sizes, backgrounds, etc. are defined in external CSS files that are organized and easy to update (they are organized, right?). These CSS files are site-wide (as much as possible) and are cached by browsers, making our pages faster to load.

Second, our content is marked up semantically and can easily be used without all the fancy styling. Part of my development process is to review the pages I’m working on with CSS turned off. The fabulous Web Developer Toolbar for Firefox makes this extremely easy and no web developer/designer has an excuse for not taking this step.

Disclaimer

Now, this site is actually a bit of a cop-out. I don’t have any static pages at the moment, I’m running WordPress. I didn’t even write my own templates. All I had to do was install a plug-in.

BUT I do use web standards in my everyday work. I inherited quite a large and complex site built using software that generates HTML 1.0 and full of table-based design. It started out as two web applications and has doubled since I became responsible. Slowly, old pages are worked on and brought up to date. But mostly I’ve been adding new pages or replacing old parts of the app with new parts, etc. These are all written using XHTML and CSS.

So, even though I didn’t code this site, I am participating in CSS Naked Day to show that I do use web standards.

Life Happens

Wow. Life has been really pretty hectic lately. I’ve hardly had time to breathe. I miss my friends from CWSA, whom I haven’t even IMed with in what seems like ages. How are you Bridget? Still out there? Brad? Brad? Brendan? Eric? Joe? Everyone else?

So, what’s kept me so busy? Well, potty training for one. I thought my son would never be potty trained. No amount of coaxing, bribing, or threatening would get Timmy to go in the big potty. Then, finally, miraculously (as it seemed anyway) he one day announced, “Mommy, I have to go potty.” and he got up from his puzzle and did it. He kept it up for two days and I was starting to think this was it. But, no. He went back to his old ways for another week. When he again decided to use the big potty, I didn’t get my hopes up. However, I knew he was done with diapers when his teacher told me he had gone potty at school for the first time. I knew instantly that he was serious. He hasn’t needed a diaper since. One down, one to go.

Most of my time over the past few weeks has been spent on the section of my company’s web site devoted to our annual conference, Riemer Week. With a little help, I was able to create a design that won the approval of my superiors. Since then life has been a never-ending string of updates, changes, corrections, and additions. The program was being reworked and fine-tuned up to the last minute. Content trickled in and then hit like a tsunami. Just as things seemed settled, one of our speakers (and a good friend of many) passed away. I only got to meet him at one Riemer Week, but he was such a warm, friendly, fun-loving person, I instantly felt like I’d known him longer. I was looking forward to seeing him again, showing him pictures of the kids, and hanging out with him.

I’m both looking forward to and dreading Riemer Week. It is in May in Monterey, California and I’ll be there this year. I’m looking forward to going someplace new, staying in a nice hotel, eating good food, and hanging out with Anna and Tom (who I miss a lot working from home). I’m dreading spending a week away from my kids. I wonder how they will deal with it? Probably better than me. I’m feeling a bit teary just at the thought. Oh, how will my babies survive without me???

Ahem. Okay, I’m better now.

Riemer Week has meant weeks of work and I actually racked up some over time. Unfortunately, the extra hours I put into work meant that something else had to suffer. That something else was the housework. So, now I’m desperately trying to catch up. It is all the more urgent, as we are putting our house up for sale.

This is something that makes me really nervous, cautiously excited, and a little sad. I love my house. I’ve loved it from day one. It has been a place of solace in sad times, and of celebration in happy times. I lost a marriage and a baby here. I discovered my independence here. I was blessed with a happy marriage and two beautiful children here. This is the only home I’ve been able to call truly mine, the only home Ray and I have called ours, and the only home my kids have ever known. There is a big part of me that will be sad to leave.

But, we’ve long since outgrown it. Cozy and sweet as it is, it is bursting at the seams. Since my children insist on getting bigger, the situation is only getting worse. We are finally making the move, literally. I hope, anyway. As everyone knows, this is a horrible market if you are trying to sell. Even worse if your house happens to be in the city of Cleveland proper. Luckily, we are in a great neighborhood and you couldn’t ask for nicer neighbors. How do you advertise that?

We’re not fooling around and we’ve priced the house to sell. A photographer is coming in about two weeks and once the pictures are ready, the house will officially be on the market. That gives me a few weeks to de-clutter, thank heavens. There is just so much stuff! Then there are the Spring Cleaning chores that will need to be completed a bit early. I usually wait for warm weather so I can open the windows, but I don’t have that luxury this time around. The next two weeks are going to be filled with packing, shuttling things to my inlaws’ house (they’ve graciously agreed to let us store our extra stuff there), and scrubbing everything in sight until it all shines.

I’m nervous as hell about selling our house and I absolutely refuse to look at any other houses until we have a firm offer on the table, at least. Ray is optimistic and thinks it will sell quickly. It is a perfect starter home, in great condition, clean, move-in ready, and priced low. We’ve made tons of improvements, but in this market, that may not matter at all. What we need is a couple who has been looking in our price range for a bit, but not liking anything they see. Until they see our house and just fall in love with it. Then they will buy it just as we find the perfect house for us. Everything is timed just right and we trade keys before the mercury even hits 80.

Hey, it can happen.

Sharing an HP OfficeJet via SimpleShare NAS

My setup at home is rather unorthodox. We have a really small house. Really small. As a consequence, I don’t have an office. I don’t even have a desk at which to work. I use my laptop as an actual lap-top and work in the recliner or on the couch in our living room, where we truly live. When not in use, the MacBook Pro lives on the coffee table and, as you can imagine, it gets moved around quite a bit. All of my other equipment (DSL modem, router, web server, etc.) is located in our upstairs bedroom.

Among the various components located above me is an HP OfficeJet 5610 and a 500GB SimpleTech SimpleShare. Separately, I’ve been very happy with the performance of both devices. But, until now I had never tried to connect them.

I purchased the SimpleShare because I needed more disk space for my iTunes and iPhotos libraries, as well as somewhere to put backups. I didn’t relish the thought of dragging an external drive around the house with me and I wanted something that would be available from any computer on my network. A network-attached drive fit the bill rather nicely.

Getting the OfficeJet to play nice with the SimpleShare’s built-in print server was not the most straightforward process. HP does provide driver software for Mac OS X, so I’ve had no problem printing when the printer was directly connected to the MBP. I figured the drivers had to be on my computer somewhere, right?

I connected the OfficeJet to one of the USB ports on the SimpleShare, then used the web interface to enable the print server. The SimpleShare had no problem seeing the OfficeJet. So far, so good.

I then used the Print & Fax preference pane (I’m running Leopard) to attempt to add the shared printer. I could log into the SimpleShare and see the printer, but when I had to choose the driver, I was stuck. The driver for the OfficeJet wasn’t there. There were other OfficeJet drivers and I tried a few of them, but they didn’t work. The SimpleShare accepted the job, but nothing printed.

So, what was I using to print when connected directly? Apparently, some application that served as a proxy of some sort. There wasn’t a PPD somewhere that I could select. Damn.

Some Googling around led to others with the same problem, but no one finding a solution. So, I tried the Apple forums. BINGO!

Here’s the solution in a nutshell (all of these files are available from The Linux Foundation):

  1. Download and install Ghostscript
  2. Download and install Foomatic-RIP
  3. Download and install HPIJS for Mac OS X

Once these were installed, it was a simple task to add the printer in:

  1. Launch System Preferences and choose Print & Fax
  2. Under the Printers list, click the + button; this will open a printer browser window
  3. On the toolbar, click Windows
  4. Click on the name of your SimpleShare workgroup, then host; you’ll be asked to log in
  5. Once logged in, you’ll see the printer attached to the SimpleShare; select it
  6. From the Print Using drop-down, choose “Select a driver to use…”
  7. There isn’t a 5610-specific driver, but there is a driver for the 5600 series, and that is the one that works for me

Incidentally, the printer browser is a rather strange and buggy beast, with an unfinished feel. It doesn’t seem to be attached to any application: you can’t hide it, it doesn’t have a menu of its own, and it doesn’t go away when you quit System Preferences. When you are presented with a login panel, you have the option of saving the information in the Keychain. Although it appears to have been saved in my Keychain, it wasn’t using it because I had to enter my password every time. I also noticed that I was only able to see the printer once, then I had to reboot to see it again. I’m not sure if this is a bug in the printer browser or with the SimpleShare. I tend to think it is with the printer browser, though. These are annoying quirks and hopefully will be fixed in future updates. I’ll have to file a few bug reports.

Anyway, I’m happy with the outcome. I have more printer drivers than the law allows, but I can print from anywhere in my house. Now, if I can only find some software that will bring the printed pages downstairs for me…

New Look for 48-Hour Days

48-Hour Days has a brand spankin’ new look, thanks to the totally awesome and very talented Brendan Cullen. I love this theme. I could never have come up with something so amazing and I’m excited to show it off. Enjoy!