Blogs

Tiiimestamp ain't on my side

No it ain't.

I had an existing MySQL table with a few columns, e.g. x, y, and z, and I needed to add a timestamp column `ts` to it. But when I tried, the column was filled with "<Error>" values. Read on to see how I fixed it.

:after{awesome!} is :before{CSS}

Or, "How to replace an entire text title with CSS".

For the longest time, I thought it was a cardinal rule of CSS: You can add pictures, but you can't add text. I must have been aiming for extremely old browser support when I learned this, probably IE6, because with modern browsers it's clearly wrong. Not only can you add text to a page with CSS, I've found a way to actually replace small pieces of text like short headings.

Extending Drupal 7 text field character limit

After getting the message, "There is data for this field in the database. The field settings can no longer be changed." while trying to extend the character limit for a text field in a Drupal 7 instance, I used the code below to increase the character limit. It modifies the relevant parts of the database to allow more characters. I ran the SQL code through a content node with the PHP Code Text Filter enabled, but it could also be run in a custom module.

Hypermiling: Or, How I Learned To Stop Worrying And Love U.S. Gas Prices

A lot of people are complaining about the price of gasoline these days. It's not hard to find someone who is outraged at paying nearly 4 bucks a gallon to fill up their tank, and the issue has become so politicized and polarizing that we hear a lot of arguments about whether or not we should be doing more drilling, implementing stricter standards on automobile efficiency, or investing in alternative energy sources.

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.
Syndicate content