Archive for October, 2009

Disqus – a single point of failure

Tuesday, October 27th, 2009

I do not understand why bloggers adopt services such as Disqus.

It is not hard to put comments on a blog. Really, it is not hard at all.

It is not especially hard to block spam. This blog may not be popular but it’s over 4 years old and gets a LOT of spam; sometimes thousands a day if some bot gets into heat. All is dealt with. It’s not effortless but it’s pretty minimal.

So why do people wilfully pervert the core strength of the internet’s redundant peer-to-peer structure and adopt a centralised commenting system for their independent blog? I just don’t get it. Especially the so-called experts at Ruby Best Practise who apparently can’t even run a fricking comment system. I qualify for “Ruby Worst Practise” most of the time and I have written and run several.

Here’s “Ruby Best Practise” as I experienced it today:

Best practise right here folks

Thanks for losing my comment, matchless professionals at Ruby Best Practise.

I love TextMate, but …

Friday, October 23rd, 2009

… but it has taken almost 2 hours now to do a simple find and replace in a (admittedly 400k lines long) single file.

That is very inefficient.

In other news, if you tried to access this server this morning, you likely couldn’t. Why?

$ uptime
19:50:39 up 152 days, 3:40, 4 users, load average: 0.68, 31.71, 64.91

That is *not* what one wants to see. A runaway image resize daemon was to blame. Couldn’t even run ssh; had to drop to console over IP and kill the offending processes, then restart ssh et al.

I want some better hardware … and I really should reboot one of these months.

Update: I ended up killing TextMate and rethinking my methods.

Song of the Week – Love Is Growing

Friday, October 23rd, 2009

From the .

Love Is Growing (mp3, 5.9M)

Another perfect song by the current greatest musician on Earth, Kanno Youko. Lyrics below.

(more…)

More Australia Tax

Friday, October 16th, 2009

Thinking about buying an SSD as about the best possible upgrade to any computer? I certainly am, so imagine my delight when I compare the differences in price of buying the drive in, say, Japan, and my wonderful Australia!

Japan: ¥45,885 (AUD$550)
Australia: around $800

A nice $250 Australia Tax there.

The Office according to The Office

Thursday, October 15th, 2009

I think this is one of the best descriptions of working life at a large company that I have ever read.

Installing nginx-gridfs on RHEL5

Thursday, October 8th, 2009

Now, installing on RHEL5. This took a while to work out!

cd ~/src
mkdir nginx_gridfs && cd nginx_gridfs
 
yum install scons boost boost-devel pcre pcre-devel
 
git clone git://github.com/mdirolf/nginx-gridfs.git  
wget http://sysoev.ru/nginx/nginx-0.7.62.tar.gz
tar -zxvf nginx-0.7.62.tar.gz
 
#note my mongo install path; different from on OSX
export MONGO_INCLUDE_PATH=/root/src/mongodb-linux-x86_64-1.0.0/include/mongo/
export LIBMONGOCLIENT=/root/src/mongodb-linux-x86_64-1.0.0/lib64/libmongoclient.a
export BOOST_INCLUDE_PATH=/usr/lib64/
export LIBBOOST_THREAD=/usr/lib64/libboost_thread.so
export LIBBOOST_FILESYSTEM=/usr/lib64/libboost_filesystem.so
 
cd nginx-0.7.62/
 
./configure --add-module=/root/src/nginx_gridfs/nginx-gridfs
make
make install

I’d like to point out that this install was by pure trial and error; a lot of trials, and a lot of errors, since I have no clue whatsoever about C++. The above Works For Me™ but is probably suboptimal and your mileage may vary.

update: it should be noted that this is very early version software; there are bugs and it’s probably not a production option yet. Great potential though, so check it out.

Installing Nginx-GridFS on OSX

Wednesday, October 7th, 2009

Follow these steps to install ’s on OSX. Linux coming soon.

cd ~/src # your sources directory
mkdir nginx_gridfs && cd nginx_gridfs
git clone git://github.com/mdirolf/nginx-gridfs.git  
wget http://sysoev.ru/nginx/nginx-0.7.62.tar.gz
tar -zxvf nginx-0.7.62.tar.gz
 
sudo port install boost pcre++ spidermonkey scons # macports!
 
cd nginx-0.7.62/
 
# i put mongodb at /mongodb - alter to fit your installation
export MONGO_INCLUDE_PATH=/mongodb/include/mongo/ 
export LIBMONGOCLIENT=/mongodb/lib/libmongoclient.a
export BOOST_INCLUDE_PATH=/opt/local/include/
export LIBBOOST_THREAD=/opt/local/lib/libboost_thread-mt.a
export LIBBOOST_FILESYSTEM=/opt/local/lib/libboost_filesystem-mt.a 
export LIBBOOST_SYSTEM=/opt/local/lib/libboost_system-mt.a 
 
./configure --add-module=/Users/sho/src/nginx_gridfs/nginx-gridfs
make
sudo make install

In nginx.conf:

server {
    listen       80;
    server_name  localhost;
 
    location / {
        root   html;
        index  index.html index.htm;
    }
 
    location /gridfs/ {
        gridfs;
        gridfs_db database-name;
 
        # these are the default values:
        mongod_host 127.0.0.1:27017;
        gridfs_root_collection fs;
    }
 
    # blah
 
}

You should now be able to start nginx using /usr/local/nginx/sbin/nginx and navigate to 127.0.0.1/gridfs/#{file_name}.

UPDATE: for snow leopard, python is in /usr/bin, so you may need to symlink it like this for scons to find it:

$ sudo ln -s /usr/bin/python2.5 /opt/local/bin/python2.5

Also, nginx is updated to 0.8.30 now; these instructions work for the latest version too.

UPDATE 2: Currently the best version of this to use is , which simply pulls together a number of different patches to make a working version. Well, works for me, anyway!

National Day Parade torrent

Monday, October 5th, 2009

Anyone thinking of watching China’s National Day military parade from a few days ago – and I should certainly recommended so, if only because they put so much effort into it – this is the torrent to get.

There are some others floating around but they are mostly taped from HK television. I hate Cantonese, and apparently the parade wasn’t broadcast in widescreen anyway.

This is just the military section, not the subsequent “floats from all the provinces and singing school children” part. The language is mandarin of course but it’s still very watchable. Anyway, the indecipherable Chinese commentary, excitedly talking over the chilling diesel drone of hundreds of tanks rolling past, kind of adds to the atmosphere. The aircraft flybys are also mixed at a very satisfying volume.

If that’s not enough – there’s girls in uniform. The only time Hu Jintao smiles the whole time is when girls walk past. They’re pretty cute!

Recommended. 45 minutes, 1.37G.

Shockingly bad memory performance under Snow Leopard

Monday, October 5th, 2009

I don’t know what caused it, but sometime after upgrading to Snow Leopard the performance of my laptop has dropped through the floor. It’s really bad, especially with video – this 2yo mac can’t play a youtube clip without CPU going to 100% and jerking unwatchably.

I’ve been busy so hadn’t had much chance to investigate, but one thing or another led me to suspect memory performance, so today I ran Xbench. As you’ll see, the results speak for themselves.

Memory Test 15.31

System 23.78

Allocate 116.31 427.14 Kalloc/sec
Fill 70.52 3428.64 MB/sec
Copy 9.67 199.83 MB/sec

Stream 11.28

Copy 10.55 217.93 MB/sec
Scale 10.50 216.93 MB/sec
Add 12.76 271.83 MB/sec
Triad 11.61 248.39 MB/sec

That is shockingly bad and a full order of magnitude lower than expected. There’s something seriously wrong here.

The ram is 2×2GB Kingston 667MHz. It was working fine before and continues to work, just 10x slower than it should. Any ideas?

update: i’m going to list some details to make it easier for others with similar issues to find this post by search.

ram details:

BANK 0/DIMM0:

Size: 2 GB
Type: DDR2 SDRAM
Speed: 667 MHz
Status: OK
Manufacturer: 0×7F98000000000000
Part Number: 0×393955353239352D3031312E4130304C4600
Serial Number: 0×160AA70D

BANK 1/DIMM1:

Size: 2 GB
Type: DDR2 SDRAM
Speed: 667 MHz
Status: OK
Manufacturer: 0×7F98000000000000
Part Number: 0×393955353239352D3031312E4130304C4600
Serial Number: 0×160AE80F

system details:

Model Name: MacBook Pro
Model Identifier: MacBookPro2,2
Processor Name: Intel Core 2 Duo
Processor Speed: 2.33 GHz
Number Of Processors: 1
Total Number Of Cores: 2
L2 Cache: 4 MB
Memory: 4 GB
Bus Speed: 667 MHz
Boot ROM Version: MBP22.00A5.B07
SMC Version (system): 1.12f5

UPDATE: removing one of the 2GB modules returns speed to normal:

Results 126.95
System Info
Xbench Version 1.3
System Version 10.6.1 (10B504)
Physical RAM 2048 MB
Model MacBookPro2,2
Drive Type FUJITSU MHW2120BH
Memory Test 126.95
System 145.21
Allocate 274.47 1.01 Malloc/sec
Fill 111.52 5422.41 MB/sec
Copy 124.24 2566.05 MB/sec
Stream 112.77
Copy 104.49 2158.22 MB/sec
Scale 106.87 2207.96 MB/sec
Add 121.81 2594.72 MB/sec
Triad 119.98 2566.73 MB/sec

This machine is actually only able to address 3GB of memory; previously it ignored the other 1GB without consequence. Seems it might not be without consequence anymore.

Sucks to only have 2GB of memory but the system is now so much more responsive it’s actually a huge win. I’ll continue like this until further information emerges.

2016 Olympics

Saturday, October 3rd, 2009

So it’s been announced that the 2016 Olympics will be held in Rio, in Brazil. That’s fantastic news for the country, will be a real boost and I strongly support that decision.

I also strongly support the games being denied Chicago. The Olympics is supposed to be about international spirit – America is a closed, unfriendly country where foreigners are unwelcome and distrusted, and its disingenuous bid deserved to be discarded in the first round.

Tokyo would have been cool but they didn’t have much of a chance, since it was Beijing just last year. Madrid was the other strong contender, and I hope they (and Tokyo) try again for 2020.

Looking forward now to seeing what architecture and infrastructure Rio pulls out for 2016. I’m much more of a fan of the preparations for the games than the games themselves!

update: removed the fruits of my time-wasting. Tsk!

sayonara CouchDB

Saturday, October 3rd, 2009
[master b5a03e0] you know what? fuck this, i am switching to mongo
 52 files changed, 76 insertions(+), 91957 deletions(-)

* i wish this blog had “Tweets” like Wincent’s. Good feature!

Song of the Week

Saturday, October 3rd, 2009

Scooters by Kanno Yoko, sung by James Wendt.

I swear, this is the last media post using WP. I need to spend a day abstracting media processing / serving out of other projects and into my replacement blog software.

(more…)