'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:...
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...
' 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
HOW CURL_EXEC AND URLENCODE KILLED MY SINGLE SIGN ON
If you do any work with single sign on, you’ll be familiar with the concept of exchanging tokens and validating against the authentication server using that token. One of the issues I’ve just run into which resulted in a huge headache is with urlencoding the result of a curl_exec that had a line ending. It’ easy to miss when it’s a longer string and you aren’t paying...
AWESOME AWK TUTORIAL
This is exactly what I look for when I’m trying to find a tutorial. Thank you, Andrew M. Ross. My favorite awk tutorial ever.
DECIMAL VS FLOAT IN MYSQL
While I’ve known how floating points are stored, I didn’t know if decimal was stored any differently, or if it was more or less accurate. According to a post on the MySQL list: Bruno Rodrigues Silva wrote: Dear all. The MySQL Manual inform that Decimal Data Type is used for represent exact-number, but like Float Point Data Type, Decimal use rounding case the fractional part is not...
PROBLEMS INSTALLING SUBVERSION FROM SOURCE ON CENTOS
I was setting up a new server for someone, and encountered this error while I was trying to build svn /usr/bin/ld: cannot find -lexpat Now, while I can do some things on that a sys admin can, I am by no means a sys admin. I have only installed svn a handful of times, and I didn’t know what this was. First I installed expat from source. It didn’t help.
REPORT SPACE REMAINING ON DISK ON UNIX LOGIN
I get a kick out of stuff like this. Add this to your .bash_profile to be greeted with the remaining space on your disk. df -h | awk ‘NR==2 {print “Space available " $4}’ This will actually change depending on which version of df you’re using (i think). I get different output on my Mac than I do on a CentOS machine - df seems to auto wrap lines on long drive names, so...