ENABLING MOD DEFLATE IN APACHE
I got an error while compiling Apache today:
“./configure” “–enable-auth-digest” “–enable-deflate” “–enable-rewrite” “–enable-so” “–enable-vhost-alias” “–disable-userdir” “–enable-mime-magic”
configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
I fixed this by installing zlib from source.
MUTABLE CLASS INSTANCE VARIABLES IN PYTHON ACT LIKE THEY'RE STATIC
There’s a weird behavior in Python when dealing with Mutable types such as dictionaries, that when you modify a variable defined as a class attribute, you’re actually modifying a shared dictionary amongst all the classes. This seemed weird to me. You can read the lovely discussion about it, if you want. Or, just follow my code for a demo on how to deal with the issue. I just started Python on Monday night, so please overlook my n00bness.
MYSQL ALTER TABLE PROGRESS BAR?
Altering a big table sucks, and to make it worse you have no idea what’s happening or how long it will take. I’d like a progress bar, or some status output, or something that gives me the feeling like my server didn’t die.
MYSQL AND MATERIALIZED VIEWS
I was poking around the MySQL Worklog again over the weekend, and found a request for materialized views for MySQL. This feature has existed in Oracle for a while, in DB2 as a materialized query table, and appeared in MS SQL Server 2000 and 2005 as indexed views. What is a materialized view? A materialized view is a database object that contains the results of a query. The FROM clause of the query can name tables, views, and other materialized views.
VMWARE, LOSING TIME, AND SESSIONS
I’ll keep it short. In the last few days, login on our dev server broke. We hadn’t changed anything related to it, and everything looked good code wise. What we finally figured out was that our session cookie was set to expire 2 days into the future, and our VMWare image had lost 2 days of time. Fix by doing the following: ntpdate ntp.nasa.gov > /dev/null
'MYSQL: TIME DELAYED REPLICATION'
I was cruising the MySQL Forge Worklog when I came across the idea of Time Delayed Replication. I had never considered the benefits of deliberately keeping a slave server behind a master. Kristian Koehntopp gives a good example: Kristian Koehntopp writes: TDS: Time delayed SQL_THREAD (Have a replication slave that is always lagging 30 minutes behind). Currently, replication is a rolling recovery: To set up replication you restore from a full dump with a binlog position.
HOW MANY LINES OF CODE?
I was curious how many lines of code were in PHPBB 3. I only wanted to know about the .php files. find . -name ‘*.php’ -exec wc -l {} ; | awk ‘{ SUM += $1 } END {print SUM}’ The downside to this is that it includes whitespace and braces as lines, as well as comments. Oh well. It’s a good approximation. Edit: There are 172,189 lines of code in phpbb3.
BBEDIT + CTAGS
I posted a complaint a while ago about BBEdit complaining about a few things. I moved onto TextMate for a few weeks, but it lacked some of the powerful BBEdit features I’ve gotten used to. Then I discovered ctags. I set up a cron on my PHP dev site to rescan my dev folder once an hour. BBEdit automatically discovered my ctags file and gave me the definitions right a right click.
MYSQL LOAD BALANCER
I’m not sure how I didn’t see this earlier, but it looks like MySQL 5.1 is coming with a load balancer for replicated servers. I’m absolutely pumped about this - we’ve got a few sites running with multiple db slaves and it’s so annoying having to check if they’re behind the master. It looks like the load balancer will automatically pull slaves out if they fall behind, and route connections to the ones that are the most up to date.
' PHP WARNING: MEMCACHE::SET(): FAILED TO EXTRACT ''CONNECTION'' VARIABLE'
I got this today. Solved by restarting the Memcached server. Move along. Edit: this is actually a reoccurring bug we’re seeing with the memcache 2.2.3 stable build on 2 different boxes 2nd Edit: Actually it was a bug in my code. I wasn’t setting the server and ip correctly, there was a typo in my configuration