My Web Presence, it is a Changin'

I'm starting to get tired of this blog, which is a normal thing for me after having the same blog for a year or two. Not sure what I want to use in it's place, or maybe I just need a new web project to occupy my time.

As I hinted at in my last post, I've been really inspired from the content and user base over at hacker news. One such blog-related topic that really stands out, is a user over there who runs their blog through github (example post). The whole idea of a host-less blog is really intriguing to me. People keep coming up with amazing new ways to leverage github and I love it. Maybe I'll try to do something over there.

Music Blog?

For a while now, I've wanted to start a music tumbler. It would be a place where I would just list new music I bought, not like a review-type blog or anything. I've always been a big music freak and lately I've found myself buying a lot of music. I enjoy nearly all types of music, as well as sharing my music with my friends and learning of new bands from them. What better way to find out about new music than to share what I'm into.

We'll have to see if I actually carry through on this idea. I've probably sat down a handful of times to get it going, but always decided against it at the last minute. Maybe talking publicly about it will be the last push I need.

Tumblr Fills a Niche for Me

I created a tumblr account a month or so ago and really like it. I have always found myself posting links to twitter that I enjoyed. I realized that a link-dump style twitter stream was not the type of content I enjoyed reading (as a follower), so why was I forcing my friends to read the exact shit that I didn't want to see? I still wanted to share interesting content with an audience and that's where tumblr steps in.

No More Twitter

I deleted my twitter account last night. With the huge surge in popularity with twitter in the past couple months I have become increasingly annoyed with the service as a whole. The stupid "who can get one million followers" thing between Aston Kutcher and CNN was not quite the last straw for me, but it was close. Then yesterday my friend showed me Ice-T's account (twitter gang? come on Ice-T, don't be a fucking jackass), then that very same day Oprah gets a twitter account and Shaq is replying to her first message? Well fuck me. I am out of here.

We'll have to see how this one pans out. I still want to read what my twitter friends are up to, but I don't want to have an account. Twitter makes it very difficult to do this. Maybe some type of third party service is in order. I've been inspired by my coworkers use of all client-side coding to pull in interesting twitter content, maybe something like that could be cobbled together to allow people to check up on their twitter friends without actually needing an account.

Lots of Rambling Thoughts

In short, I've been going through a lot of changes lately WRT my web presence and how I browse the web. I'll have to see how it all shakes out in the coming months, but this post has helped me solidify some recurring thoughts I've been having and also put my ideas to paper.

Written in / April 18th, 2009 / 7 Comments

The Difference Between Redditors and Hackers

I used to like reddit a lot. Not like I'm old school or anything, but over the last year and a half I've gone through all the phases: "oh this is cool" → "omg I'm totally addicted" → "where's the fresh content?" (current phase).

What has filled that void for me is hacker news. The content there is stimulating and fresh, plus the audience is completely different (read: mature). I'm not sure if reddit has always been this way and I was just oblivious to it until now, but it's like the internet wasteland in there. All the current events are slightly older than I think they should be, the pictures are 99% recycled internet rubbish, the videos are 99% recycled internet rubbish, and then there's the "omg the world is out to get us" kind of idiotic crap that seems to be highly encouraged.

For me, nothing sums it up more succinctly than two (#1 upvoted on their respective sites) different comments on the same article. It is an article about a student at Boston College being investigated for computer crimes. The specific article is actually not so much about the investigation, but more about the EFF fighting to get the student cleared of any charges, have all of his computer equipment returned, and any evidence that is found on said equipment be inadmissible in court. Sounds like pretty clear "oh no the government is attacking us computer people" kind of thing, right? That is until you actually read the original warrant (the EFF has politely made available to us), which paints an entirely different picture than we are originally led to believe.

But that's not why I'm writing this. I don't really care about the case, or the student. I care about having quality online content with contributors who put thought into what they're saying.

Enough of reading a fucking sensational headline and spitting out the first thing that comes to your mind.

I didn't mean for this to turn into a big rant, but I guess it did. I wanted to just show these two quotes and then be done.

hacker quote on above mentioned article, it is the number one upvoted reply:

Has anyone actually read the warrant application? The allegations were made by a close acquaintance of the accused who directly observed him changing grades for students and cracking into other systems; the emails in question were traced back to the accused's hostname.

The EFF article completely mischaracterizes a 90% legitimate warrant.

redditor quote on the same article, it is the number one upvoted reply:

"a black screen with white font which he uses prompt commands on" HAHAHA! Oh Noes! We haz a haX0r!

Enough of this. Do not pay attention to sensational headlines and soundbites taken out of context. They are testing you, to see if you are paying attention. Let's show them that we are.

Written in / April 14th, 2009 / 0 Comments

Firefox's new Cognitive Shield and Running Multiple Firefoxes Side by Side on OS X

Firefox has got a hot new thing they're calling "Cognitive Shield", which is a "new tab" page that shows you all your most visited sites. Google Chrome was the first browser that I'm aware of that did this, but I'm sure the Opera guys will probably jump in and say "we've had this forever". Safari's Beta 4 has one too and they're calling it "Top Sites" where they show you your most visited sites in a cover-flow style.

The design idea behind Safari's Top Sites and Firefox's Cognitive Shield could not be further apart from each other. Apple predictably went the sex appeal route with thumbnails of all the sites on a reflective black background. Contrast with Firefox's screen which appears blank until you move your mouse, then the light grey text appears, showing you the most visited sites. Use Safari Beta 4 for a few days and you'll quickly see one of it's huge drawbacks: it consumes a lot of memory trying to keep those thumbnails up-to-date. Firefox on the other hand does not consume any more memory, because it's just plain text. Safari is literally running like it has 12 (the max number of "top sites" shown) tabs open at all times, plus whatever tabs the user may have open. From a development perspective, I'm a bit perplexed as to how they would actually implement this feature in such a poor manner.

I don't want to talk a whole lot more about this, since the point of this post was to share with other people how to run different versions of Firefox side-by-side without having to worry about the beta version (3.1) overwriting profile data in your stable 3.0 version. One last thing I will say about "tab pages" is that I like them. I like this new trend to introduce tab pages to web browsers and I am especially keen on the Mozilla approach of not cluttering the screen or consuming resources keeping that screen up-to-date.

Over on the Firefox lab blog, they have detailed exactly what you need to do to try out this new feature, but it requires installing a development build of Firefox, which is undesirable if you need your browser to test functionality in other stuff you work on. Here's a couple steps to get you running multiple Firefox's at the same time, these steps are assuming you have already installed the latest stable version:

  1. Launch Firefox with the profile manager, use the terminal and launch: /Applications/Firefox.app/Contents/MacOS/firefox-bin --profilemanager
  2. Create a new profile (I called mine "3.1 user") and uncheck the box "Don't show at startup".
  3. Exit the profile manager and go download the latest Firefox 3.1 development version.
  4. When you're ready to install, instead of dropping Firefox in your Applications directory, put it somewhere else and then rename the app to something like "Firefox 3.1" or whatever makes sense for you. Optionally at this step, change the icon for this app so you will be able to tell the difference between the two versions when they are both running in your dock.
  5. Now drag the app into your Applications and launch it as normal, but make sure to choose the correct profile depending on what version you are using.

If you ever remove the development version, the next time you launch Firefox just check the box "Don't show at startup" and you will no longer be bothered with the profile manager at launch. One other thing, try not to launch your different versions of Firefox and use the wrong profile. This will corrupt your profile data across versions.

Written in / March 23rd, 2009 / 0 Comments

Running Ruby as a CGI Script with Apache on OS X (Leopard)

It took me a couple different documents to get me running a Ruby script on the built-in Apache webserver that comes with OS X, so I figured I'd document the steps.

First of all you have to have the web server running, but I'm going to assume that's already setup.

The out-of-the-box Apache config file (/etc/apache2/httpd.conf) is setup to alias the webroot path /cgi-bin/ into the directory /Library/WebServer/CGI-Executables/. Write a little Ruby script and drop it in that directory. It needs to be executable by all (chmod a+x hello_world.cgi). Make sure to include the script declaration statement to let the CGI process know how to execute it. Here is an example (hello_world.cgi):

#!/usr/bin/ruby
require 'cgi'

cgi = CGI.new('html3')
cgi.out do
  cgi.html do
    cgi.body do
      cgi.p { 'Hello World' }
    end
  end
end

I used Ruby's CGI library because it removes a lot of boilerplate crap but more importantly because when I wrote a plain script that outputted its own HTTP Headers, I kept getting script errors (500s). The Apache log file told me there was something wrong with my headers, but I couldn't for the life of me figure out what was wrong with it.

OK we've got our Hello World Ruby script that is in /Library/WebSite/CGI-Executables/ so now all we have to do is edit the Apache config file (/etc/apache2/httpd.conf) to setup the execution of .cgi files. So edit the config file by uncommenting the following line: AddHandler cgi-script .cgi. In my file it was on line #391, but yours may be different. Note that this line will be located in a block that is tagged like: IfModule mime_module.

Now just make sure your CGI module is loaded by uncommenting the following line: LoadModule cgi_module libexec/apache2/mod_cgi.so. Mine was on line #102 but again, your config file may be different.

That's all you have to do in the config file, so save your changes (need sudo) and then restart Apache: sudo apachectl restart

Hit your script in the browser at the path: http://localhost/cgi-bin/hello_world.cgi and it should work.

Now that you've got it working, you can tweak your apache config a bit more to add directories in your home Sites directory to be CGI-executable so you don't have to save everything in the obscure /Library/WebSite/CGI-Executables/ path. You can also add some other extension types besides .cgi if you want, but I prefer to leave it at the default extension because it doesn't reveal to the client what type of code is being executed.

If you're the only one that uses that webserver, then I recommend changing the DocumentRoot directory to be your Sites directory. This setting is on line #163 in my config file.

Written in / February 26th, 2009 / 0 Comments

Page.Select Rails RJS Problem with Ruby 1.8.7

Yeah I know Ruby 1.9.1 is out now so posting something that is specific to Ruby 1.8.7 is pretty lame, but I have to.

I recently ran into (yet another) problem with a Rails site I have running with Dreamhost. It is on one of their 64-bit Debian 4 machines, so maybe it's specific to that environment, or maybe it's an issue across all Ruby 1.8.7 installations. I can't really confirm it because I'm running 1.8.6 on my home computer and my other dreamhost server is running 1.8.5.

Anyway, anything using the RJS Select method will raise an exception like this:

undefined method `[]' for #<Enumerable::Enumerator:0x........>

Initially, to get around this I just broke out my RJS into straight up JavaScript. It was clunky, but it worked. Then an excellent Dreamhost support person got back to me about the issue and pointed me to this documentation page on the Radiant CMS site, which included this little snippet that could be used to monkey-patch the issue:

unless '1.9'.respond_to?(:force_encoding)
  String.class_eval do
    begin
      remove_method :chars
    rescue NameError
      # OK
    end
  end
end

Works like a champ.

Note: This issue just started happening about a month ago, which means Dreamhost just upgraded this server to Ruby 1.8.7 for some reason. I hope they don't do all their servers, they'll undoubtedly cause headaches when they do since this error is so obscure.

Written in / February 6th, 2009 / 0 Comments