Older blog entries for Killerbees (starting at number 220)

Note to self, how to get the top tens from MySQL slow query log

Use these two commands to get the top ten and top ten repeaters from MySQL's slow query log.

mysqldumpslow -t 10 ./slow-log > /home/danny/top_ten_slow_query.txt

mysqldumpslow -a -s c -t 10 ./slow-log > /home/danny/top_ten_repeat_slow_query.txt

Syndicated 2011-01-19 17:47:00 (Updated 2011-01-19 17:47:38) from Danny Angus

18 Jan 2011 (updated 18 Jan 2011 at 13:10 UTC) »

Quote of the [specify period]

This [period]'s quote is from Nicola Morrison, ScottishPower online manager quoted on computerweekly.com, here, in a piece which quite frankly looks like marketing blurb placed by a PR agent on a day when the editor was hungover.

Anyway, Nicola have an award for improving customer service not by answering customers questions but by analysing them!

Working with [tech co][1] has ... given us an unparalleled insight into our customers' requirements through the ability to analyse the questions they are asking.

[1] I'm not going to repeat the name of the company involved, I don't want to draw attention to them!

Syndicated 2011-01-18 12:19:00 (Updated 2011-01-18 12:20:37) from Danny Angus

Note to self, how to delete files older than

Yes, yet another one that I always have to look up, I think it must be my age!

find /path/to/files* -mtime +5 -exec rm {} \;

Syndicated 2011-01-13 09:32:00 (Updated 2011-01-13 09:32:47) from Danny Angus

misprint of the [specify timeperiod]

How apt:

employment rose causing misery for many.
From this, also worth a read.
Have an award.

Syndicated 2010-11-03 14:03:00 (Updated 2010-11-03 14:03:05) from Danny Angus

Note to self, how to get row numbers in a MySQL SELECT

I've often wondered, idly, how to get MySQL to output a row number column, which would rank sorted and grouped results.
Well thanks to this excellent post I've found out how:

SELECT *, @rownum:=@rownum+1 as rank FROM ( 
-- Your Query Goes in Here
        SELECT t.*
        FROM table t
        WHERE something
        group by 2,3,4
        order by 1 desc limit 20
    ) day_rank, (SELECT @rownum:=0) r;

Syndicated 2010-10-20 08:15:00 (Updated 2010-10-20 08:15:56) from Danny Angus

21 Sep 2010 (updated 21 Sep 2010 at 13:11 UTC) »

Note to self, want stats on nfs usage, try this

I thought I'd put this in as well, since I had to google for it, using -n will make iostat provide you with stats for nfs shares too.

iostat -nh 5
You can also use nfsstat

nfsstat -cvn -o nfs

Syndicated 2010-09-21 12:06:00 (Updated 2010-09-21 12:43:03) from Danny Angus

e = internet (a logo for IE9)

I found this fascinating blog post on MSDN's IEBlog about the logo for IE9, thanks to Sam Ruby's wonderful Planet Intertwingly.
You should read it too.

Syndicated 2010-09-17 10:26:00 (Updated 2010-09-17 10:26:45) from Danny Angus

17 Sep 2010 (updated 20 Sep 2010 at 11:23 UTC) »

CAPTCHA for CASH - The end is nigh for the CAPTCHA

I  thought you may like to know (unless I'm the last one to cotton on!) that a scenario we've theorised about on the ASRG mailing list for years is finally here, there's now at least one commercial service that will translate CAPTCHA's for cash.

I found the link (shown below) to a service that will decode captcha's for you for $2 per 1000 successes. (Ironically it was in an ad served to me by gmail.)

So to anyone who ever proposed a spam "solution" that relied on differentiating between people and machines, and doubted us when we told them that the commercial imperative would be its downfall, read this: 

We told you so, and it only costs two bucks for a thousand!
I predict much more of this in time, with costs falling as more competition enters the market, and I honestly think it presages the end of the useful life of the captcha.

That link: http://www.decaptcher.com/client/

-- correction: Kevin H. politely pointed out, in a comment, that I hadn't read it properly
That isn't $2 per success - it's $2 per 1000 successes. Minimum purchase is $10 = 5,000 spam, er, advertising opportunities
Thanks Kevin, I've updated the post to reflect this.

-- updates:  According to ASRG folks

a) This site has been known about since Oct, '09, so yes I am last to the party as ever!

b) Chris Lewis kindly point this out:
... found sweatshops in India quoting some small number of rupees per thousand, claiming to be able to supply up to 250,000 per day.  At _least_ three years ago.
Incidentally, some of the spam filter companies, as part of their technology for trying to figure out whether the jpeg is naughty or not, _claim_ they can solve >90% of all captchas on the fly.
c) More intriguingly Steve Atkins said:
There's even a neural net implemented in javascript as a greasemonkey plugin that'll solve some simple captchas in the browser.
 I had a Googlearound and found this, that may interest you http://ejohn.org/blog/ocr-and-neural-nets-in-javascript/

I found that particularly fascinating, because last year Nikki was telling me all about cognitive psychology and various theories of word and character recognition in humans. I still have all that to look forward to, in my OU degree, but I'm beginning to get an idea of the kind of things I could do for my project if I ever get that far!

Syndicated 2010-09-17 09:58:00 (Updated 2010-09-20 11:19:47) from Danny Angus

1 Sep 2010 (updated 1 Sep 2010 at 18:07 UTC) »

note to self, how to change the definer of a mysql stored procedure

This is a useful one if, like us, you find that the account used to create the procedure doesn't have the privileges required to execute it, or perhaps you've revoked the original definers grant. (DoH!)

ALTER PROCEDURE procedure_name SQL SECURITY DEFINER;javascript:void(0)

Syndicated 2010-09-01 16:25:00 (Updated 2010-09-01 17:46:04) from Danny Angus

211 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!