my life

day to day

Archive for the 'notes' Category

HOWTO Install Starling

Monday, November 10th, 2008

I was recently contacted by someone who got stuck setting up Starling and realized that the documentation is relatively sparse on setting up Starling. The process is easy once you know how Starling works on the inside, but not looking in.

To get started, I will assume you have ruby and ruby gems already installed. This will depend on your flavor of distribution, but should not be difficult and come standard on every modern version of Linux I’ve used.

run:

gem install starling

Create the Starling queue directory in /var/spool/starling

Start staring with these minimum set of arguments:

/usr/bin/starling -d -h $HOST -p $PORT \ -P /var/run/starling/starling.pid

Also, if you’ll be running Starling in a PHP environment, make sure your version doesn’t have the EOL bug described in my post: http://osterman.com/wordpress/2008/07/18/starling-protocol-bug-in-stats-response

Also, note that Starling creates a queue file for each key verbatim. So if a key is, ‘namespace/something’, then Starling will fail to do the set if the ‘namespace’ directory does not exist under the /var/spool/starling directory. You can also just not use ‘/’ in your keys.

Also, note that Starling does not automatically purge the queue files after it rotates them. You’ll want to cron a job to run periodically to delete them. We run this nightly to purge files not accessed in 4 days:

find /var/spool/starling/ -type f -atime +4 -delete
by creating a file in /etc/cron.daily/starling with those contents.

All that being said, we’re still very happy with it and process about a million jobs a day.

Please let me know in the comments if your still having problems!

add to del.icio.us    add to technorati favs   email this

Installing CPAN Packages for Debian

Thursday, June 19th, 2008

If you want to install CPAN modules as Debian packages, this HOWTO is for you.

First, install dh-make-perl:

apt-get install dh-make-perl

Then build & install the package. For example, if you wish to install the module Nagios::Plugins::Memcached from CPAN, simply run:

dh-make-perl --install --cpan Nagios::Plugins::Memcached

You’re done.

add to del.icio.us    add to technorati favs   email this

Configuring Mutt for IMAP support

Monday, December 31st, 2007

Configuring Mutt with IMAP is as easy as editing your .muttrc and adding the following lines.

set spoolfile=imap://username:password@host/INBOX set folder=imap://username:password@host/INBOX

You can then change folders inside of Mutt by pressing ‘c’ and then ‘?’ to get a folder list.

add to del.icio.us    add to technorati favs   email this

Unknown table engine ‘InnoDB’

Sunday, December 23rd, 2007

I was getting the error “ERROR 1286 (42000): Unknown table engine ‘InnoDB’” when trying to create/alter tables with the InnoDB engine. You can check for this warning by issuing the create or alter statements and then running

show warnings;
in the same mysql client session.

Check if you have InnoDB support enabled:

mysql> show variables like ‘have_innodb’; +—————+———-+ | Variable_name | Value    | +—————+———-+ | have_innodb   | DISABLED | +—————+———-+

The problem is that InnoDB is not enabled by default in Debian distributions of my.cnf.  To enable it, simply comment the following lines under the [mysqld] section.

#skip-innodb

add to del.icio.us    add to technorati favs   email this

HOWTO Find the Network Printer

Monday, November 26th, 2007

This is the easiest way to find a JetDirect printer on port 9100 on your local network. Useful in those cases you’re on site with a client and need to print something.

nmap --open -p 9100 192.168.240.* -T insane

add to del.icio.us    add to technorati favs   email this

Forcing Wordpress to use HTTP_HOST

Wednesday, November 21st, 2007

At times, it is convenient to force Wordpress to use the hostname of the current virtual host context. By default, new versions of wordpress rely on DB configured values for siteurl, home, and url. If for instance, you run multiple codebases for testing, it might be convenient to not have it force the values to the configured ones. To accomplish this, add the following code to a custom wp plugin or just add it to the wp-config.php at the very bottom.



function set_codebase()
{
return 
'http://' $_SERVER['HTTP_HOST'];
}
remove_action('template_redirect''redirect_canonical');
add_filter 'pre_option_siteurl''set_codebase' );
add_filter 'pre_option_home''set_codebase' );
add_filter 'pre_option_url''set_codebase' );


This code can further be wrapped in a conditional so it only gets executed under explicit circumstances.

add to del.icio.us    add to technorati favs   email this

Debian trying to overwrite add-shell with passwd

Saturday, September 8th, 2007

Preparing to replace debianutils 2.8.4 (using …/debianutils_2.23.1_i386.deb) … Unpacking replacement debianutils … dpkg: error processing /var/cache/apt/archives/debianutils_2.23.1_i386.deb (--unpack):  trying to overwrite `/usr/sbin/add-shell’, which is also in package passwd Errors were encountered while processing:  /var/cache/apt/archives/debianutils_2.23.1_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

Simply run

dpkg -r --force all passwd apt-get -f install

add to del.icio.us    add to technorati favs   email this