InnoDB Insert Locks the Table
Turns out InnoDB’s default locking method sucks pretty badly.
I don’t really care about gaps in my primary keys, I *do* care about inserts being restricted to one transaction at a time. Wow…
Updating ImageMagick on Centos5
Here’s what I did:
# DL new version (current versions are here, devel stuff here) wget "http://www.imagemagick.org/download/linux/CentOS/i386/ImageMagick-devel-6.7.4-0.i386.rpm" wget "http://www.imagemagick.org/download/linux/CentOS/i386/ImageMagick-6.7.4-0.i386.rpm" # remove the old version sudo yum remove ImageMagick-devel ImageMagick # install some needed deps (YMMV) sudo yum install libtool-ltdl lzma # install the new version sudo rpm -Uvh ImageMagick-6.7.4-0.i386.rpm sudo rpm -Uvh --nodeps ImageMagick-devel-6.7.4-0.i386.rpm # test it convert --version
Better IMHO, than building from source ala this advice.
S3 PHP putObject timeout for small files [Fix provided!]
I was getting this error today when trying to upload a small file to my S3 bucket:
S3::putObject(): [RequestTimeout] Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed
I’ve been using this library for a while, with large file uploads and didn’t get this problem, so I figured it was something to do with the smaller files. It seems others have had this issue too.
Assuming you are using the putObjectFile method like I was, it calls another method to create the request inputFile. In this method, I basically added a hack so that if the file size is small, it reads it and uploads it using a string of data, rather than the file pointers (where this bug lies, it seems).
My fix is simply to add this code to inputFile:
if (filesize($file) < 512 * 1024)
{
return file_get_contents($file);
}
So for any file under 512k, it will upload it from memory, rather than the file pointer. I'm sure my server can handle this. I guess if you wanted, you could try a whole bunch of files until you found the size at which the code works, or even fix the problem at the source, but I have more pressing priorities. I suspect it's well under the 100k mark, so my 512k figure represents an abundance of caution.
AppleIDs and multiple iOS developer accounts
“In the iOS Development Ecosystem the people are represented by two separate, yet equally important groups. The iOS Developer Users who create apps and the iTunesConnect Users who upload the apps. These are their stories.”
An iOS team is actually in two parts: the iOS Developer Team, accessed via the Member Center, and a completely separate iTunes Connect team.
It turns out that the one AppleID can belong to multiple iOS developer teams, and Apple asks you when you login to the member center which team you want to use. However iTunes Connect has no such feature, and each AppleID can only belong to one iTunes Connect “team”.
So you can re-use AppleIDs for developer accounts, but not itunes connect accounts. It’s up to you I guess if you want a totally separate AppleID for each team, or just each iTunes connect account.
monit
Monit for linux is a great way to make sure Apache is running.
I set it up with the help of this fantastic tutorial. My steps after the break.
NSDateFormatter format specifiers
Ever wanted the list of format specifiers?
Anything in single quotes is put through as-is.
Android Market Resources
Confused about what each of the images do and how they’re cropped?
Look no further than this awesome test app! Market link here.
Some high quality phone image marketing resources. I like this one.
Posting to Rails with AJAX
Don’t forget your csrf token!
The token itself can be retrieved in Rails with: session[:_csrf_token]
