Blogs

Candy-gram for Mongo

  • Bart: I better go check out this Mongo character.
  • [Bart reaches for his gun]
  • Jim: Oh no, don't do that, don't do that. If you shoot him, you'll just make him mad.

So I've got this Rails application that uses a MongoDB database. There have been occasional problems in the past, and a few times I've gotten frustrated with Mongo's general bone-headedness, but never anything serious. Then today, I had a face-off that firmly cemented my negative opinions of MongoDB.

VIM Delete Cheat Sheet

x - delete current character
dw - delete current word
dd - delete current line
5dd - delete five lines

d$ - delete to end of line
d0 - delete to beginning of line

:1,.d
delete to beginning of file

:.,$d
delete to end of file

Steps to getting Ruby to handle SQL Server on a CentOS box using unixODBC

1. yum install unixODBC freetds freetds-devel unixODBC-devel
2. Add your database to /etc/freetds.conf:
[(your custom connection name)]
host = (your host)
port = 1433
tds version = 7.0
username = (username)
password = (password)
3. Add this to /etc/odbcinst.ini:
[FreeTDS]
Description = TDS driver (Sybase/MS SQL)
Driver = /usr/lib64/libtdsodbc.so
Setup = /usr/lib64/libtdsS.so
CPTimeout =
CPReuse =
FileUsage = 1
4. Add your database to /etc/odb.ini:
[(your custom connection name)]

Flow of a Performance Test

Basic Flow of a Performance Test, as I've done them, for those interested:

1) Use The Grinder's TCPProxy to record a series of user stories, making sure to put in comments as you record
2) Trim down the scripts to only issue the necessary commands, delete the sleep times
3) Put in some text handling and error checking into the scripts to make things like searches into variable-based scripts, and custom site error responses (such as login redirects) into Grinder errors

CentOS: The freshmaker

Are you bored with your slick Windows 7 or OSX GUI? Have Ubuntu's cutting-edge package updates got you down? Do you like installing archaic Enterprise editions of Linux just for fun? CentOS might be right up your alley. This is a brief tutorial on how to install CentOS within VirtualBox. You'll need a few hours to kill, and a working VirtualBox installation. (I won't go into the details of how to install VBox; it's pretty easy, and besides, if you're thinking of installing CentOS for fun, you probably already have it.)

Adding Secondary Validation to Drupal’s User Login

Want to add another layer of authentication to the default Drupal login? Say, by calling a company’s internal web service? Here’s a clean approach I’ve taken. Notice that we are inserting our secondary authentication into the validators, rather than overriding anything. Also notice that if we authenticate against our local Drupal DB, there’s no reason to look at the secondary web service or DB, but rather we only look if our default local authentication failed. Then, if we authenticate against our secondary source, we create a user to be used later on.

Testing Weasel Words

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to cut away. -- Antoine de Saint-Exupéry

Manual and automated software tests often include redundant and unnecessary words which can distract the tester from the real purpose of the test. We're so accustomed to seeing them that they often pass unnoticed.

Consider the following generic test description:

General error: 126 Incorrect key file for table

Saw this error in Magento admin:
SQLSTATE[HY000]: General error: 126 Incorrect key file for table '/tmp/#sql_7397_0.MYI'; try to repair it

Solved it by increasing the tmp directory space on the MySQL server.

Declare or Impair

A topic that crops up often on the Cucumber mailing list is whether it's best to write BDD tests in imperative or declarative style.

Syndicate content