Automatically Rotate Rail’s Development Log (development.log)

By default, Ruby on Rails writes to the same development log, located at log/development.log indefinitely. This can lead to a large log file. Fortunately, it’s possible to rotate this log file without having to depend on any external applications, like syslog. Here’s how: Add the following to your config/environments/development.rb file. Feel free to replace “daily” with your preferred interval, like “weekly”, or “monthly”: config.logger = Logger.new("log/#{Rails.env}.log", "daily") Restart Rails: touch tmp/restart.txt That’s it! While you’re at it, you’ll probably also want to rotate your test.log file. You can do so by editing config/environments/test.rb, and applying the same update that’s shown above for...

Allowing @ Signs in MediaWiki User Names

If you attempt to create a new MediaWiki account with its user name set to the same as the email address, you’ll be greeted by a cryptic “You have not specified a valid user name” error message. The reason for this is that MediaWiki forbids the @ sign in user names by default. Fortunately, the fix is easy, but took some Googling to find buried in MediaWiki’s 1.15 Release Notes. To fix this, open your MediaWiki’s LocalSettings.php file, and add the following lines: # enable user names with an @ sign $wgInvalidUsernameCharacters = ""; Note that having an @ sign within a MediaWiki account’s user name can cause issues with InterWiki User Rights, but this shouldn’t be an issue for most MediaWiki...

Changing Mosets Tree’s Root Directory Page Title

About half of the LAMP (Linux, Apache, MySQL, PHP/Python/Perl) stack websites that I develop or sysadmin for use the Joomla CMS. I like Joomla because it has a number of excellent extensions, including Mosets Tree – my favorite web directory software. A problem that I ran into recently while installing their latest 2.1 release was that by default, the root directory’s page is givenĀ  a page title of “Directory” with no way to be updated within Joomla. Here’s how I updated the title to something more search engine optimization friendly. Open up the language/en-GB/en-GB.com_mtree.ini file with your favorite text editor. Update the following line with your title of choice:...