Internet Explorer and Ajax

June 17th, 2008 by Dan

Okay, I just wasted waaaay too much time trying to track down an apparently odd Internet Explorer redraw issue. The problem was an ajax call associated with the onchange of a checkbox form element. In Firefox this worked perfectly. Click the button, the div updates itself. However, in IE 6 and 7 it would just sit there and do nothing until you would force a redraw (ctrl +a seemed to do it), or scrolled the page up & down a few times.

It turns out, this was because of the way IE handles the onchange javascript event. This only fires once the checkbox loses focus. To fix this, I just switched from the onchange event to the onclick event and everything works as expected. I’ll retract some (okay, just one) of my nasty comments about Internet Explorer now as this does make logical sense thinking about it now.

So the offending code looked like

<input type="checkbox" name="mycheckbox" value="something" onchange="update_div();">click me

whereas it should be:

<input type="checkbox" name="mycheckbox" value="something" onclick="update_div();">click me

BambooInvoice – Free Online Invoicing software

June 14th, 2008 by Dan

If you do any contract work, you’ve probably had the joy of tracking your hours (if you’re still trying to solve that issue, check out my Project Hamster post) and then creating an invoice of some sort for the client. In the past I have tried a couple of solutions such as a creative Excel spreadsheet or creating a new email from scratch each time. I’ve also checked out the online service Blink Sale, but, never really liked the thought of some other company knowing how much I’m billing my clients and making each month. That, and there was the 3 invoices per month limit for the free version.

This is where BambooInvoice steps in. It’s a FOSS solution that you host on your own server. The interface is great, and installation is simple.

Read the rest of this entry »

Simple Time Tracking with Project Hamster

June 6th, 2008 by Dan

If you’re like me, you frequently need to be able to tell people how long a project took, how much time some bug fixes ate out of the day, or what you worked on the past day. I’ve looked around for a quick & simple app to track my time usage and hadn’t come up with a good match until I recently found Project Hamster. My previous main barrier to usage was laziness and wanting a lightweight program to do this simple task. Hamster makes it dead easy to enter time, add new categories / activities and view simple reports.

Read the rest of this entry »

Faster DNS lookups with OpenDNS

June 2nd, 2008 by Dan

So, first off, what is DNS and why do you care if it’s fast? A crash course in dns is that it changes a nice, memorable name like, oh say, danklassen.ca to it’s actual IP address (209.20.65.249 in this case). Think of it as flipping through the phonebook to find out somebody’s phone number.

Now, as you are browsing the web sometimes you may notice that it can take quite a while for the page to initiate a connection with the remote server. This can sometimes be caused by a slow response from a dns server so it takes a while for your browser to figure out who to ask for content. Imagine you’re running a server and you are sending out a few thousand emails an hour, as well as pulling in content from multiple sources, and doing reverse lookups on numerous IP addresses. Any slight delay will add up to huge latency over time, and DNS lookups can be quite costly (time-wise).

Read the rest of this entry »

Server Monitoring Solutions

June 2nd, 2008 by Dan

Where I work, we run a number of servers around the world to meet the varying needs of our customers. Some of these are dedicated hardware, virtual private servers, shared hosting, dedicated database server, intranets, you name it. One thing we have always found challenging is monitoring the general status of the servers in a reliable fashion. We currently are using a combination of services and tools to achieve our goal.

We use Pingdom to monitor our web, dns and email servers. Pingdom is a relatively inexpensive service that will ping your server on a regular basis from multiple locations around the world and time the responses. It will then create some nice pretty graphs reporting your uptime. If there should ever happen to be some down time (that never happens does it?), it can notify a list of people via email or sms. The main downside to pingdom is that it is only a reactive service. By the time it sends out an email, the server is down.

A more ideal solution is to have a pro-active monitoring system. For this we use a OSS solution named Monit. It can be configured to trigger actions when certain limits are met. For example, if Apache is using up >= 75% of your system’s memory, Monit can trigger a restart of httpd. Or, if you volume is >= 95% full, it can send out a notification email to an admin to take appropriate actions. Check out their samples and documentation. It’s a pretty powerful system that can help prevent a complete server crash. One thing we have noticed how ever… if you intentionally bring down apache for maintenance and Monit is checking for a live instance of the webserver, be sure to kill monit first. Otherwise, it will unexpectedly restart apache causing potential issues.

Read the rest of this entry »