Archive

BikesOfIndy.com Launched

Actually, it launched weeks ago. Regardless, if you are the Indianapolis area, and you enjoy bicycling, you should check out BikesOfIndy.com.

What is it?

BikesOfIndy.com is just a forum, at the moment. It is built on PHPBB3, the open source message board software. The idea is to build a bit of a community of bicyclists in Indy, if for no other reason than the community itself; it's nice to know people that may want to ride with you.

What is its future?

Hopefully it may evolve into a site that includes news of bicycling events in the area, a place to organize rides, a place to read articles related to bicycling locally, etc. This will involve me putting more time and effort into it, to be honest. So far I have just been really enjoying chatting with local cyclists, and learning from them as well.

From a technical standpoint, I intend to write an index page, in PHP, that pulls articles from the 'News' forum to the front page. That is the first step. It shouldn't be too difficult, I just have to query the PHPBB3 database. I have not yet decided whether I am going to try actually extending PHPBB3, or whether I will instead just roll a quick script to get the job done. Writing some sort of plug-in/add-on to PHPBB3 would probably be useful for other people, and good knowledge to have in the future, but it doesn't seem like it would be the easy route. We'll see what level of motivation I have when it comes that time.

Who is welcome?

Everyone is welcome. At the moment, the site seems to be relatively dominated by young fixed-gear enthusiasts, with a few mountain bikers mixed in. However, there are some commuters, some road warriors, and more. It doesn't matter. I just like to ride bikes, regardless of what 'type'. If you like to ride some sort of bicycle, I encourage you to give the site a shot.

What was that URL again?

I'm not sure how you missed it, but it's BikesOfIndy.com.

StripeGenerator.com: Good Tool for a Non-Designer


Update:Man, no one told me that I entered the link incorrectly. That is embarrassing. StripeGenerator.com. Stripe is not plural. I'm sorry. It won't happen again.

StripeGenerator.com does just what it sounds like it might do: it generates stripes. To be less vague, it generates small PNG files that can be used as tiled backgrounds on a website (or whatever application you may find). It can be a quick and easy interface for getting a quick, decent looking background for your website, without knowing a damned thing about Photoshop or GIMP. I actually discovered it while looking for a how-to on creating that sort of background for BikesOfIndy.com. I am no designer, so any help in that area is appreciated.

Screenshot of StripesGenerator.com Interface

The interface, initially, can be a bit intimidating. At first glance, one might think it not super-intuitive. However, I have found it to be pretty easy, once you figure a few things out. You should be able to learn a lot just by playing with it. Really, you can get a useful background image by merely choosing a stripe color and then downloading the image!

What did you do?

For BikesOfIndy.com, I chose two colors to use for the stripes (two shades of grey). I made the stripes fairly small (3 pixels, if I recall correctly). BOOM! I was done. That simple. Click download. Then upload it to your server/site, play with some CSS, and you're done. Five minutes.

(Note: You may have noticed the gradient at the top of BOI. I did grab that image and add a gradient to it in GIMP, then make that image the background of a div element at the head of the site. Still, it was easy. Easier than me getting too down-and-dirty with some design software.)

I recommend playing with it, and bookmarking it at your favorite social bookmarking site. I have already found it pretty damned handy, and I can see it being of use in the future as well.

What do you think?

Setting Up a New Slice of Ubuntu 7.10

Today, I decided to rebuild one of my slices hosted with SliceHost (because SliceHost Rocks!). It was really doing anything, and I have decided I want to hack on a few projects in which this slice may come in handy. (More on those to come, possibly.)

Psshh, This is NOT New

There are several other blogs, wikis, and how-to sites that present all of the information I am going to present here, and probably more. In fact, the first place to stop is SliceHost's Wiki. However, putting this all in once place could still be useful, even if it is only useful for me in a few months when I go to do this again. I intend to add some explanation of the steps, as well. Everyone likes a little explanation. It's delicious!

Rebuild Your Slice

Rebuilding a slice is the easiest part. Seriously. You just click the 'Rebuild' link (so intuitive!) and you are presented with this screen:

Screenshot of Slicehost Manager rebuild screen

Choose an operating system. Choices include Arch, CentOS, Fedora, Gentoo, Debian, and both Ubuntu 6.06 and 7.10. Ubuntu 6.06 is the long-term support version; in other words, it is considered very, very stable. Ubuntu 7.10 is the newest release of Ubuntu, and is the operating system that I chose here.

Now choose a name for your slice, preferably related to Futurama in some way.

After making your choices and clicking the rebuild button, Slicehost will tell you what your root password is, so pay attention.

Initial Setup

First, we need to add a user that will be our primary administrative user. You'll want to SSH to your slice, like:

ssh root@<IP-of-your-slice>

Add the user.

adduser --ingroup users <username>

Now make sure this user is a sudoer. (This command opens up /etc/sudoers in the default editor, which will probably be nano.)

visudo

At the end of the file, insert this line:

<username> ALL=(ALL) ALL

Now, press Ctrl and 'O', Enter, then Ctrl and 'X'. In other words, save the file and exit nano.

We want to disallow the ability to SSH into this machine via the 'root' account, from now on. I won't get into exactly why, just trust me.

vim /etc/ssh/sshd_config

Find the 'PermitRootLogin' line and change 'yes' to 'no'. Then, reload SSH:

/etc/init.d/ssh reload

There are other things you can do to secure SSH. Some people even recommend changing the port used. If you want more information, 'Hardening a Linux or OpenBSD Installation' is recommended reading.

At this point, I would exit the SSH session, and re-login as the user you just created. So, uh, go do that, already. Also, I personally like to add my slice's IP to my /etc/hosts file (if you're using some version of Linux as your desktop) on my local computer, so that I can just 'ssh my-name@slice-name'. Simple.

Can We Install Crap Now?

We are now going to install some stuff. Woo hoo! We are going to install updates! Hey, quit moaning. You! Quit calling me that!

sudo apt-get update
sudo apt-get upgrade

Now we're going to install a couple packages so we can quit getting warnings about our locale settings.

sudo apt-get install localization-config language-pack-en

You could install a lot of stuff, if you want. I'm going to install the build-essentials package, which comes with compilers, and all of the good stuff you need to install stuff from source. I think I'm going to go ahead and install NTP packages, to help the server keep the correct time. I also like to install the vim-full package, in case I have to do much direct editing on my slice (for instance, freakin' Apache configuration files).

sudo apt-get install build-essential ntp ntpdate vim-full

This could take some time. I recommend going to get a Mountain Dew from the fountain station of your local convenience store. I like to call these Fountain Dews. Don't you wish you were as cool as I am?

Installing Ruby

Alright, alright. Now we'll install fun stuff, like Ruby, Ruby Gems, . Luckily for us, Ubuntu now has a 'ruby-full' package that installs Ruby version 1.8.6, and nearly everything you might want with it. (In particular: ruby, irb, rdoc, ri, libdbm-ruby, libgdbm-ruby, libreadline-ruby, libopenssl-ruby, ruby1.8-dev.) To quote the package's description:

"For many good reasons, the Ruby programming language is split in many
small different packages. Installing this package will make sure you have
all the packages that add up to a full Ruby installation, with the exception
of the Tcl/Tk bindings for Ruby which are only recommended.
.
This package installs the dependencies for the current stable
version of Ruby, which is 1.8."

So...

apt-get install ruby-full

If you want to try Ruby 1.9, you'll have to look elsewhere. I'm sorry. Ruby 1.8.6 continues to be the most stable version, although I do intend to play with Ruby 1.9 sooner than later.

I'm sure you noticed that RubyGems were not installed in that package. You don't want the outdated version that is in the Ubuntu repositories (currently 0.9.4). You want the latest, greatest version. RubyGems 1.0.1!

wget http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz
tar xvzf rubygems-1.0.1.tgz
cd rubygems-1.0.1
sudo ruby setup.rb

Sweet! That was easy. Right? Now we can install Rails version 2.0.2!

sudo gem install rails

Note:If the above command results in a sudo: gem: command not found message, you will need to set a symbolic link from /usr/bin/gem1.8 to /usr/bin/gem. You could also copy 'gem1.8' to 'gem'.

sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

Gems now automatically accepts dependencies. If you want to ignore any dependencies, there's an option for that.

That's All Folks! ... for now

I am going to stop right here, for now. You've got Ruby, RubyGems, and Rails, on top of Ubuntu Gutsy. I would say that's the basics. In the future, I do intend to cover getting a Rails app deployed, although, you can find that a million other places, also. I do hope this helps someone, somewhere. Let me know if it does!

Ubuntu 8.04 Alpha VMWare Image

Ubuntu is my operating system of choice, these days. I had been using it exclusively as my desktop OS, and had vowed to never install a Microsoft OS again. Then I got a real job, and realized that being idealistic is fun, but not all that practical. My employer's 'system' is based on Microsoft products, so I end up using Windows XP daily. However, I still prefer Ubuntu, and use it daily as well, typically as a virtual machine in VMware Player.

Canonical is currently in the process of developing the next Long-Term Support version of the Ubuntu operating system, 8.04, code-named Hardy Heron. (Learn about the release by visiting the official site.) This version will be actively supported for 3 years, the same as version 6.06. There are not many drastic planned changes for version 8.04, as typically an LTS release will focus more on stabilizing the current system. (By typically, I mean, this is what happened last time.)

What's Your Freakin' Point?

The point is, I found a VMware appliance for download that will allow you to test the release in a virtual machine. You can test it, but you aren't tied to it. In other words, it could fail, and you won't be too upset, unless you randomly decided to put the only copy of your family photo album on the virtual machine. In that case, you'll be very upset, as well as stupid. From Ubuntu.com:


"Note: This is still an alpha release. Do not install it on production machines. The final stable version will be released in April 2008."

How do I get it, already?

To download a copy of this virtual machine (for VMware Player), visit this slightly ad-laden site. When I get the chance, I'll make a torrent of it and place that here, as well.

If I have any unique comments about the Alpha release, I'll let you know. Let me know what you think, as well.

Please, Just Stop It

The following is a job posting I happened upon:

We have a unique idea for a web app in an emerging niche market. Over six months of research, planning and projecting in a full business plan and detailed project plan. And a background of success with startup & mid-stage web companies.

We are seeking a talented individual to join our team as a technology consultant/lead programmer. Initial duties will be to understand the project, breakdown technical requirements, estimate project scope and begin development on the prototype.

Long term/equity partnership would be the end goal. Open to hourly rate or per phase basis until both sides are comfortable. Basic non-disclosure agreement will be required.

Please contact me with resume/technical expertise and any relevant work examples and I will provide additional details to qualified candidates.

There are just so many things that bother me about this job posting. I am not going to reveal where I found it. Indeed, where I found it is the only thing I could possibly divulge, as the post tells me nothing else. Just for fun, let's break it down.

We Have an Acute Ability to Be Vague

We have a unique idea for a web app in an emerging niche market.

Really? My mom had one the other day, too. You know, so did my neighbor. And that kid down the street that is always re-enacting dances from High School Musical 2. Hmm, should I start hiring people?

We Really Covered Some Stuff Last Semester

Over six months of research, planning and projecting in a full business plan and detailed project plan. And a background of success with startup & mid-stage web companies.

"We, unfortunately, did not have the time to look into effective communication, let alone effective job postings. This job will sell itself, because of the vague, buzzword filled posting. I mean, the word 'lead' is good for, like, hundreds of applicants."

We Hope Someone Does Our Work For Us

We are seeking a talented individual to join our team as a technology consultant/lead programmer.

Dude, you should see me kick ass at beer pong this Saturday night. Now that's talent! If you want, I can also show you my Guitar Hero III skills. Rock on!

Initial duties will be to understand the project, breakdown technical requirements, estimate project scope and begin development on the prototype.

What happened to the six freakin' months of research and planning? Actually, maybe it is a good thing that you want to hire an actual developer to tell you how long the project is going to take. I take back this particular criticism -- but I'm watching you.

We Can Pay in McDonald's Monopoly Pieces!

Long term/equity partnership would be the end goal. Open to hourly rate or per phase basis until both sides are comfortable. Basic non-disclosure agreement will be required.

Wait. Hold the freakin' phones. That first sentence is suspect. Are you trying to say, in the most mealy-mouthed, my-dad-is-a-congressman way that you would trade equity in the business for work? I'm confused, because then you talk about an hourly rate, or a 'per phase' plan. Also, in this non-disclosure agreement, can I tell my girlfriend in what city I work? So far, I'm not even sure if there's an actual job, or if we're going to brainstorm over coffee.

We Have Secrets. You Want Them.

Please contact me with resume/technical expertise and any relevant work examples and I will provide additional details to qualified candidates.

How do we know what is relevant?! How?! Tell me. Here is where the problem lies: your job posting is so vague, that you are going to receive vague, diluted resumes that will probably be depressing, for you. Guess what? You've done it to yourself. I would not consider myself a prize programmer, by any stretch of the imagination, but I wouldn't freakin' apply to this damned post. It sounds more like a resolution from Congress than a job. (You know, those things they past that mean next to nothing? No, not laws, but close.) If I had to guess, I would say that most quality programmers who have the skill and experience needed to be your lead would never apply for the position.

It's Way Web 2.0!

In other words? You've failed before you have even started.

Torrent Available: Ubuntu 8.04 Alpha 2 VMware Image

In the post titled Ubuntu 8.04 Alpha VMWare Image, I mentioned that I intended to place a link to torrent up here, when I get the chance. Well, I got the chance, so here it is. This torrent will get you the Ubuntu 8.04 Alpha 2 release.

Download the Torrent

Login: ubuntu

Password: vmplanet.net

The original site, and the location of the http download, if you're interested, is VMPlanet.net.

I also recommend Chrysoar.info. That is where I got my trusty Ubuntu 7.10 image, with VMware tools already installed. They also have OpenBSD and Debian images.

I have only just booted 8.04 Alpha 2, so I have no opinions to put forth as of yet. I'm sure they will explode out of my gaping head-hole any day now. Have a nice day!

Uninitialized Constant Gem::GemRunner Error

Recently, I was attempting to freeze a Rails app at work. When I attempted to run rake rails:freeze:gems, I received this fun error:

uninitialized constant Gem::GemRunner

I had heard some rumor of an issue with Gem version 1.0.x and Rails versions less than 2.0. I was hoping that some magical silicon gnome would smooth out the wrinkles before I got a chance to trip over one, but alas, that was not the case.

Apparently, since Gem version 0.9.5, gem_runner is not required automatically for the rake tasks. The simple solution is to edit your framework.rake file, and add the require line in the rails:freeze:gems task. (For me, located in '/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/tasks'.) It should end up looking something like this:

namespace :rails do
  namespace :freeze do
    desc "Lock this application to the current gems (by unpacking them into vendor/rails)"
    task :gems do
      deps = %w(actionpack activerecord actionmailer activesupport activeresource)
      require 'rubygems'
      require 'rubygems/gem_runner'
      Gem.manage_gems

I hope that helps someone.

LinkFest: Merb

Merb is a Ruby web framework, not unlike Rails. In fact, you might call it Rails Lite (although, I'm not positive either party would appreciate that comparison). Merb was built, from the beginning, to be lean and fast. It was built with Mongrel and Erb at the basis, hence the name. Merb has a pretty small footprint, but in playing with it recently, it's is still pretty powerful, as well as flexible. (Damn, I sound like a marketing guy.)

Enough Sales Talk!

One way in which it is flexible is that it doesn't install with an ORM, like ActiveRecord, as a dependency. There are three ORMs officially supported at the moment: ActiveRecord, DataMapper, and Sequel. Chances are that you already know about ActiveRecord. I would call DataMapper ActiveRecord Lite, but, again, I don't know if that's what everyone would like to hear. One small thing I really love about DataMapper is the ability to express the model's properties within the model, which will subsequently create the database table.

There really is much more to Merb. I'm sure I will have more to say in the future. File uploads are easy and fast. Using some other "templating language" is easy, and I've been loving learning Haml and Sass. It currently defaults to Erubis (faster Erb, from what I understand), and support for Markaby is baked in as well. A much better and clearer (and prettier) highlight reel is available here: Rethink - Merbtastic.

Why should I take Merb seriously?

Did I mention that Merb is written by Ezra Zygmuntowicz from Engine Yard? The same engine yard that recently took a few million in VC funding. The same engine yard that has thrown around 5 developers at Rubinius. The same Engine Yard that much of 'The Industry' has begun taking much more seriously. They have some of the best, if not the best Rails hosting in existence. Why should you take Merb seriously? Oh, you mean, other than all of the cool stuff? Because it has some serious support behind it. It's going places.

Where is it going?

The Merb guys recently announced that Merb is splitting up. Not in a bad way, in a good way! Like when Ben Affleck and Jennifer Lopez split up, showing mercy for all of us that wanted to hack our ears off every time we heard the term "Bennifer". Merb is going to become 'merb-core' and 'merb-more' (man, they're clever bastards). The merb-core gem will be just the very basics for running web services and simple sites. Essentially, it's going to get even more modular. The point release before its 1.0 release will be 0.9, and should include most of the 'new stuff'.

One of the 'new things' that I want to highlight is that Merb will no longer be solely dependent on Mongrel. Don't get me wrong, Mongrel is freakin' awesome. However, there is a new little server creeping around on our block. It's in a simiilar spirit to Mongrel. In fact, it utilizes the Mongrel parser, as well as Event Machine, and Rack. It's called Thin, and it is not only freakin' awesome, but it's also freakin' fast! It'll talk more about Thin in the next couple days.

There are other frameworks out there, as well. There is one in particular (Ramaze), that I would like to test out pretty soon, as it already runs on Ruby 1.9, and is evidently extremely speedy, as well. That said....

Merb is Freakin' Awesome

Merb is small. Merb is light. Merb is fast. Merb is for realz.

Uh, that was a LinkFest?

Oh! By the way, the article merb + datamapper + noob: quick start could help you get started with Merb. If you don't believe it when I tell you why you should care about Merb, Luke at Rails Spikes does a better job, and also gives a better intro, and probably writes better. I also recommend just going through del.icio.us bookmarks. It's fun. Good luck!

Uninitialized Constant MERB_ROOT Error

I intend to write articles covering actual programming soon, as opposed to the hodge-podge, link-filled, advocacy-style articles I have written up to now. In spite of that, I hope that the couple short blurbs about Rails or Merb errors do help a person or two. These little things can be frustrating as hell.

Where Did This Error Come From?

If you have gotten this error, you are probably using Haml and Sass in your Merb application, right? You installed Haml, wrote a few views with it, and then decided to move on and generate the next controller or model, right? Right. This is probably what it looks like:

>script/generate controller sessions

Connecting to database...

/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb
:266:in `load_missing_constant': uninitialized constant MERB_ROOT (NameError)
        from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb
:453:in `const_missing'

        from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb
:465:in `const_missing_before_generators'
        from /usr/lib/ruby/gems/1.8/gems/rubigen-1.1.1/lib/rubigen/lookup.rb:13:in `const_missing'

        from /usr/lib/ruby/gems/1.8/gems/haml-1.8.0/lib/sass/plugin/merb.rb:13
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'

        from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb
:496:in `require'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb
:342:in `new_constants_in'

         ... 23 levels...
        from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb
:496:in `require'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb
:342:in `new_constants_in'

        from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb
:496:in `require'
        from script/generate:12

Crap. What do I do?

Ardekantur knows what to do. His blurb on the subject is what helped me. I ended up opening the Sass' Merb plugin file in Vim, and replacing it all with the trunk version.

Open the file.

sudo vim /usr/lib/ruby/gems/1.8/gems/haml-1.8.0/lib/sass/plugin/merb.rb

It should look like this:

  unless defined?(Sass::MERB_LOADED)
    Sass::MERB_LOADED = true

    Sass::Plugin.options.merge!(:template_location  => MERB_ROOT + '/public/stylesheet
  s/sass',
                                :css_location       => MERB_ROOT + '/public/stylesheet
  s',
                                :always_check       => MERB_ENV != "production",
                                :full_exception     => MERB_ENV != "production")
    config = Merb::Plugins.config[:sass] || Merb::Plugins.config["sass"] || {}
    config.symbolize_keys!
    Sass::Plugin.options.merge!(config)
 
    class MerbHandler # :nodoc:
      def process_with_sass(request, response)
        Sass::Plugin.update_stylesheets if Sass::Plugin.options[:always_update] || Sas
  s::Plugin.options[:always_check]
        process_without_sass(request, response)
      end
      alias_method :process_without_sass, :process
      alias_method :process, :process_with_sass
    end
  end

Uh, go ahead and delete all that. Yeah, delete it all. Paste this in there:

unless defined?(Sass::MERB_LOADED)
  Sass::MERB_LOADED = true

  version = Merb::VERSION.split('.').map { |n| n.to_i }
  if version[0] <= 0 && version[1] < 5
    root = MERB_ROOT
    env  = MERB_ENV
  else
    root = Merb.root
    env  = Merb.environment
  end

  Sass::Plugin.options.merge!(:template_location  => root + '/public/stylesheets/sass',
                              :css_location       => root + '/public/stylesheets',
                              :always_check       => env != "production",
                              :full_exception     => env != "production")
  config = Merb::Plugins.config[:sass] || Merb::Plugins.config["sass"] || {}
  config.symbolize_keys!
  Sass::Plugin.options.merge!(config)

  class MerbHandler # :nodoc:
    def process_with_sass(request, response)
      Sass::Plugin.update_stylesheets if Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
      process_without_sass(request, response)
    end
    alias_method :process_without_sass, :process
    alias_method :process, :process_with_sass
  end
end

Save that. Then try your script/generate line again. It should work now.

Wait, Don't Go Yet!

Really, Ardekantur did all the work. I sort of feel like I plagiarized this whole article. You should go ahead and check out his blog. In particular, he has written an article Writing A Web Application In Merb, Part I, in which he exudes a test-first attitude, and uses RSpec, both of which are a Good Thing. I think I'm going to subscribe in anticipation of the next part (I assume II, or maybe J). You should at least take a look!

LinkFest: Thin

Many of you have likely heard of (and use) Mongrel, the HTTP library and server for Ruby. However, you may not have heard of the new kid on the block, Thin. (It's got the Right Stuff! Sorry, couldn't resist.)

Thin is a Ruby web server that can operate as a drop-in replacement for Mongrel. Indeed, early benchmarks have shown it to be faster than Mongrel! It marries three exceptional pieces of software, the Mongrel parser, Event Machine, and Rack.

Hype, hype, hype, tell me something else

It's simple. It's fast. It can be dropped in to many frameworks/situations and perform wonderfully. You can, right now, install it and use it as your development server (instead of Webrick or Mongrel). That is a great way to test it, get to know it. Who knows? Maybe the two of you will hit it off! I wish you the best.

sudo gem install thin

...

thin start

The pretty benchmark:

Are You Going to Continue Parroting Everyone Else?

Several other people have covered this much better than I am able. It would probably be in the best interest of both myself and you, the reader, for me to just list some links and let you go at it. I could get back to hacking up this Merb app I've been working on (more on that later), and you can quit reading my monotonous article. Right?

It's cool to see some of the activity at the Google Group: thin-ruby. Thin is actively developed, and has had several releases in the past couple weeks. Anyone willing can hack on it, so you're welcome to check out the git repository as well.

More articles:

There's a lot of potential in this thing. In fact, in the next version of Merb, the framework will be flexible enough that you can easily switch from Mongrel to Thin. I hope, at that time, to tell you how I did it (and how easy it was!).

Powered by Drupal - Original Theme by Artinet - Theme Enhancements by Me