Rake aborted! Uninitialized constant MysqlCompat::MysqlRes

Leave a comment

Problem

When attempting to do a Ruby on Rails rake db:migrate on Mac OS X, you receive the following error message:

rake aborted!
uninitialized constant MysqlCompat::MysqlRes

Solution:

Steven Hamton over at TechLiberty came up with the solution for this one:

sudo gem uninstall mysql

Prior to Leopard:
sudo gem install mysql — –with-mysql-dir=/usr/local/mysql
Leopard on a PPC machine:
sudo env ARCHFLAGS=”-arch ppc” gem install mysql — –with-mysql-config=/usr/local/mysql/bin/mysql_config
Leopard on an Intel machine:
sudo env ARCHFLAGS=”-arch i386″ gem install mysql — –with-mysql-config=/usr/local/mysql/bin/mysql_config
Snow Leopard (only on Intel):
sudo env ARCHFLAGS=”-arch x86_64″ gem install mysql — –with-mysql-config=/usr/local/mysql/bin/mysql_config

Recursively Change File Permissions on Folders Only – Linux/Unix

Leave a comment

Problem

You want to recursively change all of the file permissions only on folders & subfolders in a directory, but not the files (or vice-versa: you want to change the permissions on files only, not folders).

Solution

This command will recursively search your current directory and chmod all directories & sub-directories only:

cd /yourdirectory

find . -type d -exec chmod 755 {} \;

The following command will chmod all files only (ignoring the directories):

cd /yourdirectory

find . -type f -exec chmod 644 {} \;

Solution Credit: MovableTripe

Update WordPress Without FTP

4 Comments

Problem

You want to update your WordPress installation or plugin automatically, but do want to setup FTP access on your server installation (or your hosting provider does not provide access).

Solution

Add the following line to your wp-config.php file:

define(’FS_METHOD’,’direct’);

WordPress will now update directly without requiring FTP access.

Debian 5: HP Proliant DL360 or DL380 G5 Freezes After POST

Leave a comment

Problem

HP DL360 or DL380 will freeze on boot up after POST when Debian 5 (“Lenny”) has been installed

Cause

During the install process, Debian will request a firmware file for the onboard Broadcom NIC (bnx2-06-4.0.5.fw), either on a USB floppy or USB stick.

If the USB device is left connected to server for the remainder of the install process, Grub will be installed to the USB device, not to the master boot sector of the hard drive.  The server will not boot unless the USB device is connected to the server.

Solutions

1) Remove the USB device before the Grub installation begins

or

2) Run grub-install to the /dev/cciss/c0d0 device after install