Monitoring apache with god

According to the site: God is an easy to configure, easy to extend monitoring framework written in Ruby.

While god is mainly intended for monitoring mongrels it is also a great way to keep an eye on apache itself. Below is our config for watching apache.

%w{80}.each do |port|
  God.watch do |w|
    w.name = "apache"
    w.interval = 30.seconds # default
    w.start = "apachectl start"
    w.stop = "apachectl stop"
    w.restart = "apachectl restart"
    w.start_grace = 10.seconds
    w.restart_grace = 10.seconds

    w.start_if do |start|
      start.condition(:process_running) do |c|
          c.interval = 5.seconds
          c.running = false
      end
    end
  end
end

The code is pretty self-explanatory. We’re just looking to make sure apache is up every 5 seconds.

After gem installing god, save the configuration file anywhere you want and kick if off with this command:

god -c /path/to/your_conf.god

That’s it. To test, kill apache and in less than 5 seconds it will be back up and running.

css and rollovers

I’ve recently stopped using javascript to do rollovers when reasonable. It’s much nicer because you don’t have to write onmouseover or onmouseout events, and it works without javascript. It’s also prevents a weird ‘blink’ (especially in IE) when rolling over if the image isn’t loaded in cache.

The trick is to create one image that has both states and assign the background-position of the hover state.

Using the following image and css, you don’t have to worry about javascript.

mouseover image

a.seeMore {
    background: #dce1e4
    url(/images/icons/arrowFull.gif)
    no-repeat top right;
}
a.seeMore:hover {
     background-color:#4f5a62;
     background-position:right -18px;
}

The CMS Myth

This looks like a good one to add to your RSS reader.

The CMS Myth strongly believes in the power of web CMS to be a key enabler for achieving online success. We recommend and deliver web CMS systems every day. Done right, a web CMS can be the nucleus of your web strategy and lift up all of your online marketing initiatives.

Yet for every “market leading” CMS, for every brilliant online strategy and web application, there’s a misguided effort or an ill-conceived approach ready to derail your web initiative. The goal of The CMS Myth is to help you avoid those landmines.

A couple of recent posts from their blog:

Found via InfoDesign

SVN tip: see what was changed in a revision

svn log -r 763 -v

Sending mail on a Mac

If you’re developing on a mac and need to send mail OSX comes pre-installed with Postfix. To start it up run:

sudo postfix start
 

IE Desktop Online Web Browser Live Professional Ultimate Edition for the Internet

So looks like the new version of IE is going to be called… IE8. Not very exciting but it’s funny to see someone at MS make fun of their confusing product names.

http://blogs.msdn.com/ie/archive/2007/12/05/internet-explorer-8.aspx

Linus Torvalds Presentation on Git

Linus Torvalds, creator of Linux, discusses his distributed source control system Git at Google. Features some pretty amusing quotes like “If you’re using CVS you should be in a mental institution” and “I would never, ever trust Google to maintain my source code for me, I’m sorry, you’re just not that trustworthy”.

HTML5 Preview

A List Apart has a great writeup on the forthcoming HTML5 specification.

Goodies include customizable inline audio and video players built right into the browser (goodbye, flash video players), and much cleaner HTML due to the use of new tags (HEADER, NAV, ARTICLE, SECTION, ASIDE, FOOTER = goodbye DIV).

The bad news? It’s still 10-15 years from fruition.

The Simplest ‘x’ That Could Possibly Work

Here is a great example of giving users a really simple solution without a lot of technical overhead. Dave Thomas of the Pragmatic Programmers describes how they had set out to build a robust wish list feature into their online bookstore with referrals, e-mails, messaging, automated suggestions, etc. Then they pulled back and released this instead: Pragmatic Bookshelf Wishlist. Doesn’t get much easier than that.