Restarting Apache Gracefully

apache

If you are restarting the web server on a live website, you should do it gracefully. A graceful restart tells the web sever to finish any active connections before restarting. This means that active visitors to your site will be able to finish downloading anything already in progress before the server restarts. If you are [...]

Read the full article →

How to Upgrade APC on Ubunutu

apache

APC — the Alternative PHP Cache — is a handy caching utility for use with PHP. We use it with W3 Total Cache to speed up our WordPress sites. I recently had a little trouble remembering how to upgrade APC to a more current version on our Ubuntu installations. We had installed APC with pecl, [...]

Read the full article →

PHP APC: How to Monitor Usage and Config for Optimum Performance

apache

APC is the Alternative PHP Cache. It’s a handy caching utility for use with PHP. We use it with W3 Total Cache on our WordPress installations. It runs OK “out of the box.” But you likely need to tune the config a bit to get the most out of it. The most common tweak is [...]

Read the full article →

Failed Ubuntu apt-get upgrade corrupts the available file

ubuntu server

I was upgrading Ubuntu packages with The upgrade failed with a segmentation fault. I tried again, but found I had a corrupted /var/lib/dpkg/available file. I first go this error: I edited the available file and fixed the problem. But then I got this: I made more edits and got more errors. It then realized that [...]

Read the full article →

How to automagically get friendly URLs in Rails 3

Ruby on Rails Tips

By default, Rails uses ID’s in URLs. For example, let’s say we have a list of categories stored in the categories table of the database. The “Super Cool” category is stored with categories#id = 5. To view that category our URL will look like: http://yourAwesomeDomain.com/category/5 That works great, but it’s not very user friendly. It’s [...]

Read the full article →

Why Your Controller Methods Should be Private

Ruby on Rails Tips

Most of your controller methods are public actions that display pages on your website. Your app’s routes will point to these methods and show the corresponding page (view). For example: But hopefully you are keeping things modular and breaking up complexity into smaller methods. For example, you might want to perform some check before you [...]

Read the full article →

Use Ruby’s ‘autoload’ instead of ‘require’ for your Ruby and Rails Apps

Ruby on Rails Tips

When googling to find the answer to a ruby (or rails) coding problem, it struck me that code snippets always use “require” to include any necessary libraries. For example, I recently searched for a way to compare IP addresses using CIDR notation. (I had IP ranges stored in CIDR notation and wanted to see if [...]

Read the full article →

How to test IE9, IE8 and IE7 from the same computer

windows

I’m a software developer and I often need to make sure that a web page or site will display correctly in multiple versions of Internet Explorer. Specifically, I need to test a site in Internet Explorer 7 (IE7), Internet Explorer 8 (IE8) and Internet Explorer 9 (IE9). When I installed IE9, I of course lost [...]

Read the full article →

Windows 7 Can’t Connect to Default Administrative Share C$

networking

The Problem: Windows 7 Fails to Connect to Default Windows Admin Shares on Networked Drives I got a new laptop with Windows 7 and I found I suddenly could not connect to the default administrative shares on other networked windows machines. For example: using \\remoteComputerName\C$ to connect to the default C drive admin share on [...]

Read the full article →

Firefox dropdown menus are flickering on 2nd monitor

firefox shortcuts, tweaks, and tips

The Problem: Firefox Menus Flicker and Go Blank Had a very weird problem with Firefox on my Windows 7 box. (It might also happen on Ubuntu desktop.) I switched the connection on my second, extended desktop monitor to use DVI instead of VGA. Suddenly, all the Firefox drop-down menus went blank. They would flicker briefly [...]

Read the full article →