Barrett's blog

NTP out of sync?

Barrett

Is your unix-based system time out of sync? If it is out of sync by more that 1000 seconds, you will need to manually force it back into sync. Try:

# ntpd -q

to force a re-sync with the ntp time servers specified in your NTP configuration file.

Trouble with Drupal, MySQL and non UTF-8 formats

Barrett

I just figured out a fix for an annoyingly circuitous, tortuous, and baffling MySQL problem. I am not yet an expert of back-end system configuration, but I can tool around a bit (i.e. I know where the my.cnf, php.ini, etc. files live and when (mostly) to edit them). With that...

Drupal 6 Theme Test-driver

Barrett

Reading through the Weekly Drupal feed, I found a linked site that is pretty rad.

Being primarily a developer, I am always interested in exploring the way the designer's side of Drupal. Besides helping me understand Drupal more fully and write more easily extensible code, its fun/cool to make sites look fun/cool.

A Drupal version of chicken vs. egg: external API content fetching and cron failures

Barrett

Recently we had an interesting issue with one of our multi-site Drupal deployments; the cron was not running regularly. Sifting through the logs showed that the cron seemed to be running extraordinarily long. After cron has been running for over an hour, Drupal would kill the 'cron_semaphore' variable, clear the cache and attempt to re-run cron. Cron would hang-up again, and the process would repeat itself into futile perpetuity.

Drupal/AJAX: Exercise caution when using special foreign characters

Barrett

I was recently working on a Brazilian Drupal 6.x site that uses CCK forms and needed some functionality to map a dropdown select list of states to another dropdown of cities in the chosen state, which I accomplished using a combination of the drupal_json function, as well as jQuery and AJAX, hooked into the drupal menu

Using PHP/MySQL w/Drupal to update missing Google Geocode data

Barrett

We recently needed to fill missing geocode values in a project's database. Using some PHP magic and taking advantage of hook_cron() this is how we filled the missing values:


/**
 * Implementation of hook_cron()
 * When the cron runs, try to resolve any locations that have a lat or lon = 0
 */
function overmap_cron() {

Autocomplete, clearing form values and Drupal form fields

Barrett

Some browsers like to be helpful and help by remembering certain form fields. I was having a problem with Firefox auto-populating my some of my form fields (specifically field type 'password' and 'password_confirm') in a custom module I wrote.

Validating multiple drupal form fields and only outputting one erro

Barrett

I've run into this problem twice. So it was time to figure out a solution...

Check out my solution on the drupal support boards @ http://drupal.org/node/155695#comment-1263443

Installing FTP on a CentOS 5 system

Barrett

I recently had to install a FTP client on one of our live servers. This was a first time occurrence for me, so I thought it might be useful to document for anyone else looking to do the same.

- Use yum to install the FTP package:
$ yum install ftp

Removing a Unix sym link

Barrett

If you try deleting a symbolic link like this:

rm -f test/

You get this:

rm: cannot remove `test/': Not a directory

Same deal if you try to use 'rmdir' to delete it.

Here's what works:
Remove the trailing slash from 'test/' and you're all gravy.

Syndicate content