USING MOD_REWRITE WITH VIRTUALDOCUMENTROOT

In our dev environment, we use VirtualDocumentRoot to avoid configuring new environments when we get a new developer. It’s awesome. However, if you try to use mod_rewrite, you’ll find that your rewrite rules will prepend whatever you have defined as the document root in the config file. To get around this, you have to use the PT (passthrough) flag, which will solve the issue. Example: RewriteRule ^/photo/(.*) /open.php?id=$1 [L,NE,PT] Found here, on an apache archive.

'MYSQL: INNODB MEMORY USAGE FORMULA'

I hate looking for this…. This will give you a rough idea of your innodb memory usage. I know it’s in a hundred spots, but i hate looking for it when i double check things. innodb_buffer_pool_size key_buffer_size max_connections*(sort_buffer_size+read_buffer_size+binlog_cache_size +2MB)

'LINUX: USE LSOF TO FIND WHICH FILES ARE OPEN BY A PROCESS'

lsof works under linux and MacOS X and will help you figure out what files are open. lsof | grep ‘mysqld’

ON COCOA...

I found this pretty amusing… me: i’m terrible w/ cocoa i don’t particularly like objective-c it’s to verbose **matt: ** [me putonSock:blueOne onFoot:rightFoot ignoringHangNail:YES]

QUICKLY CHECK EVERY PHP FILE IN YOUR PROJECT FOR ERRORS

Here’s a quickie - make sure every PHP file in your project parses correctly. find . -name ‘*.php’ -exec php -l {} ; | grep “Errors parsing”

'OS X: SPACES + FLUID

I’ve tried so many times to use Spaces, and I keep failing. As useful as it should be, it just never was. And I’ve finally realized why. Most of what I do is in a web browser. And spaces just wasn’t made for that. I want Gmail to always be in space 3. Facebook on 4. It just wasn’t meant for that. I’ve recently discovered Fluid. Fluid brings creates Site Specific Browsers.

SWITCHING FROM SVN TO GIT

I’ve been using SVN for several years now, so I’ve been partial to it, and reluctant to switch to another form of source control. I’m very comfortable with it, and I’ve got dozens of scripts to augment it and help me deal with it’s shortcomings, as well as a few blog posts. Easier to create a repository from existing code. This is the first thing I noticed about git that absolutely crushes subversion.

I LIKE THE GENIUS FEATURE OF ITUNES

There’s a lot of people who don’t seem to like the genius feature of iTunes. In fact, quite a few seem to hate it. The complaints vary. I’m still confused by this complaint by my friend David. He wants iTunes to recognize band names after he’s changed them. If a band has a name, why should iTunes still recognize the band name after you’ve changed it? Of course, there’s always things that can be improved.

ERLANG RECORDS CHEATSHEET

I hate looking stuff up. I just like having this type of thing 1 click away, in a nice summary. This post is mostly for me. Define a record: -record( rule, {ruleid, site, rule, original} ). You can define a record in the shell using rd: 99> rd(rule, {ruleid, site, rule, original} ). rule Create an instance of a record: 100> A = #rule{ ruleid=1, site=2, rule=2, original=3}. #rule{ruleid = 1,site = 2,rule = 2,original = 3}

'ERLANG: INSTALLING LEEX'

Leex is an erlang version of Lex, a Lexical Analyzer Generator written by Robert Virding. Robert (and several others in #erlang on freenode) were incredibly helpful and considerate in helping me understand these tools. Leex is a tokenizer. It breaks the pieces of your file or text into tokens. You can then use a tool like yecc to take these tokens and generate useful parsers. First, you’ll need the source. Leex source is available here.