Marcus French's blog

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

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.

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.

Ruby on Rails on Ubuntu guide

Nice guide to getting Rails working on Ubuntu: https://help.ubuntu.com/community/RubyOnRails

Touch Error

Saw this issue in my Joomla install:
"Warning: touch() [function.touch]: Utime failed: Permission denied in /simplepie.inc on line 8631"

Fixed it by changing permissions to all files and folders under "/cache"

SVN Bug

Getting an error similar to the following when doing a branch or commit in SVN?

svn: Commit failed (details follow):
svn: MKACTIVITY of '/svn/forms/!svn/act/ebcddac9-12da-4ae4-86d8-bdcfbccdc682': 403 Forbidden

Check the case! In this instance, the svn repo was actually called "Forms." Changing the case got rid of the error.

IE6 Quote

"Whoever makes a computer virus that silently upgrades everyone to IE8 will be a national hero" -- Eric Pierce

Syndicate content