Re: A simple and elegant job application

2013-05-15 Thread Nick Cleaton
On 15 May 2013 11:21, Travis Basevi tra...@cricinfo.com wrote: http://www.mythic-beasts.com/cgi-bin/job.pl Ours is better: http://quiz.gambitresearch.com/

Re: Memory leaks

2009-11-27 Thread Nick Cleaton
On Thu, 2009-11-26 at 15:41 +, london...@welikegoats.com wrote: Some code I have written appears to leak memory. I have been using Devel::Size on the likely candidates to locate it, but so far this has turned up nothing. Does there exist an array that lists all of the variables currently

Re: Measuring power

2009-04-29 Thread Nick Cleaton
On Wed, 2009-04-29 at 09:42 +0100, Andrew Beattie wrote: This is a long way off topic but I'm hoping that someone here might be able to share a clue... I need to measure the power used on dozens and dozens of servers. I need a breakdown by server, not a total for the room. (more

Re: Measuring power

2009-04-29 Thread Nick Cleaton
On Wed, 2009-04-29 at 12:23 +0100, Jasper wrote: 2009/4/29 Nick Cleaton n...@cleaton.net: One possibility might be to measure the heat output of the servers, rather than the electricity input. If you assume that the servers lose heat mainly by pumping hot air out with fans, you'd need

Re: Limiting process startup

2003-09-05 Thread Nick Cleaton
On Fri, Sep 05, 2003 at 11:28:02AM +0100, Paul Crowley wrote: What's the cleanest way to make sure at most N processes are doing X at once, and anyone else wishing to do X blocks until one of those N are finished? IPC::Semaphore -- Nick

Re: Audiofile::Info

2003-09-05 Thread Nick Cleaton
On Fri, Sep 05, 2003 at 04:11:19PM +0100, Mark Fowler wrote: Shucks, this is getting complicated. Ideas? Provide a base version to which you pass a list of the plugins to try at 'use' time or at object creation time, and don't have it do any detection of available plugins. Implement

Re: golf and reversed emails

2003-08-26 Thread Nick Cleaton
On Sun, Aug 24, 2003 at 05:29:02PM +0100, Scott McWhirter wrote: perl -e 'print `rev`' Can anyone beat 11 characters? yeah... remove the space... Or even perl -e 'exec rev' -- Nick

Re: talking of arrays....

2003-08-14 Thread Nick Cleaton
On Thu, Aug 14, 2003 at 10:39:03AM +0100, [EMAIL PROTECTED] wrote: I was just wondering why this: @m=([(_)x10])x5; $m[1][2]=o; for $y (0..4) { for $x (0..9) { print $m[$y][$x]; } print $y$/; } produces this: __o___ 0 __o___ 1 __o___ 2 __o___ 3

Re: Net::pcap

2003-08-14 Thread Nick Cleaton
On Thu, Aug 07, 2003 at 09:43:34AM +0100, Andy Ford wrote: I am after a Perl module that will allow me to write/read packets directly to an interface, continually while the process is alive i.e. while the process is running, sniff packets, call a function dependant on the type/content of the

Re: Messing with spammers

2003-08-07 Thread Nick Cleaton
On Thu, Aug 07, 2003 at 06:34:04PM +0100, Paul Makepeace wrote: Earle's revenge centred on abuse of a website, not emails. Email addressses are almost always forged and you'd have to be a fairly clueless geek to go after one of those given the likelihood it isn't owned, operated, or in some

Re: Messing with mail-owned files from Apache

2003-07-17 Thread Nick Cleaton
On Thu, Jul 17, 2003 at 11:18:46AM +0100, Lusercop wrote: On Thu, Jul 17, 2003 at 09:47:39AM +, Dominic Mitchell wrote: If the executable is +s, LD_PRELOAD et al will be ignored. Indeed, but will it be stripped or passed to the thing that is exec-ed (that thing is unlikely to be +s)?

Re: Messing with mail-owned files from Apache

2003-07-17 Thread Nick Cleaton
On Thu, Jul 17, 2003 at 02:25:16PM +0100, Paul Makepeace wrote: /* buncha #ifndef/#defines for HOME, etc */ char * new_env[] = { HOME, /* 0 */ PATH, /* 1 */ SHELL, /* 2 */ #ifdef MAJORDOMO_CF MAJORDOMO_CF, /* 3 */ #endif

Re: Messing with mail-owned files from Apache

2003-07-16 Thread Nick Cleaton
On Wed, Jul 16, 2003 at 12:19:46PM +0100, Andy Wardley wrote: #include stdio.h #include stdlib.h #include unistd.h #include errno.h /* change these values */ #define OWNER_UID 253 #define OWNER_GID 253 #define SCRIPT /home/abw/web/bandq/bin/build int main(int argc, char

Re: Messing with mail-owned files from Apache

2003-07-16 Thread Nick Cleaton
On Wed, Jul 16, 2003 at 04:35:52PM +0100, Andy Wardley wrote: Nick Cleaton wrote: That passes the environment unaltered to SCRIPT. In combination with the fact that you're setting the real uid/gid as well as effective, that could lead to arbitrary command execution via PATH or LD_PRELOAD

Re: Something is wrong with my conceptual model of regexes

2003-06-17 Thread Nick Cleaton
On Tue, Jun 17, 2003 at 02:40:24PM +0100, Roger Burton West wrote: This has bitten me several times. A recent example: I have a file in HTML-like markup. I've just found a piece of text to which I might want to do something, but not if it's within a tag. The file up to but not including the

Re: weird eval

2003-05-29 Thread Nick Cleaton
On Wed, May 28, 2003 at 05:41:49PM +0100, Ben wrote: What circumstances are there under which eval {}; will not trap a program exit ? eval { exit }; -- Nick

Re: use warnings and 5.005

2003-03-31 Thread Nick Cleaton
On Mon, Mar 31, 2003 at 01:14:29PM +0100, Peter Sergeant wrote: Warnings are things that tell you when you did something you shouldn't. No, that's wrong, and apparently the central point of your misconception. Warnings are things that tell you when you *might* have done something wrong.

Re: Looking for a better way

2003-03-11 Thread Nick Cleaton
On Mon, Mar 10, 2003 at 09:44:08PM +0530, shn wrote: Hey, I was just bored and was wondering what would be a better way to titlecase something, using this right now: perl -e $_='boink boink';@a=split' ';foreach(@a){$_=ucfirst;}$_=join' ',@a;print How about: s#\b(\w)# uc $1 #ge -- Nick

Re: Net::SMTP-new

2003-02-06 Thread Nick Cleaton
On Thu, Feb 06, 2003 at 01:39:14PM +, Dominic Mitchell wrote: [SNIP] Try running the program under strace to see what's /really/ happening. It might well be that something else funny is going on. On Solaris, strace is called truss BTW. -- Nick

Re: IO::AtomicFile (was Re: The 2002 Perl Advent Calendar)

2002-12-02 Thread Nick Cleaton
On Mon, Dec 02, 2002 at 11:53:16AM +, Mark Fowler wrote: [SNIP] my $fh = IO::AtomicFile-new(foo,) or die Can't open 'foo': $!; eval { print {$fh} $self-bar(); print {$fh} $self-baz(); print {$fh} $self-buzz(); close $fh; }; if ($@) { $fh-delete;

Re: IPC::Open3 / isatty puzzler

2002-11-29 Thread Nick Cleaton
On Fri, Nov 29, 2002 at 06:26:39PM +, Adam Spiers wrote: [SNIP] (can you fake a tty?) If you replace: rsh $host $command with: script /dev/null rsh $host $command In your command line, then rsh will get a pseudo tty. That's with the FreeBSD version of script(1), which allows you

Re: Apache question

2002-11-13 Thread Nick Cleaton
On Wed, Nov 13, 2002 at 03:14:42PM +, Kate L Pugh wrote: I have a lightweight server serving static content and server-parsed files, and proxying dynamic content through to a mod_perl server. Unfortunately the server-parsed pages have '#exec cgi' directives in them, and the mod_perl

Re: Regex question

2002-10-04 Thread Nick Cleaton
On Fri, Oct 04, 2002 at 03:59:10PM +0100, nemesis wrote: Hi all, I have a bunch of jokes that people have forwarded me over the years[1] and they all have really bad formatting [2]. I am lazy and want to do as much formatting of the jokes as I can automatically. I have tried this

Re: mod_rewrite, individuality and purty urls

2002-05-03 Thread Nick Cleaton
On Fri, May 03, 2002 at 04:30:56AM -0700, Paul Makepeace wrote: $story_name = lc $form-{title}; for ($story_name) { s/\s+/_/g; s/\W//g; s/__+/_/g; s/_+$//; s/_[^_]+$// until 30 length; } I think that'll loop forever if $story_name is a single very long word.

Re: mod_rewrite, individuality and purty urls

2002-05-03 Thread Nick Cleaton
On Fri, May 03, 2002 at 06:08:19AM -0700, Paul Makepeace wrote: for (my $last = -1; 30 length and $last != length; $last = length) { s/_[^_]+$//; } for(;;). Heh. This still leaves the possibility of a long URL. Perhaps shortening it to a certain length first, then removing

Re: Quick question on Doing The Right Thing

2002-05-01 Thread Nick Cleaton
On Wed, May 01, 2002 at 09:50:43AM -0400, Andy Williams wrote: So, will its definition of the best way to send email change if it's installed on a Windows box? (I don't have a Windows box to test it.) I've used MIME::Lite from windoze before... so I would say not. However, I think by

Re: jipsy

2002-04-18 Thread Nick Cleaton
On Thu, Apr 18, 2002 at 12:20:01PM +0100, Harper, Gareth wrote: pennyworth and greengross are both too long (10 points each, if anyone can guess where the names come from, both of them are fictional assistants) Greg Alfred Pennyworth, Batman's faithful butler The other one's

Re: OSX

2002-02-01 Thread Nick Cleaton
On Thu, Jan 31, 2002 at 10:52:07PM +, David Cantrell wrote: It is traditional to: a) post your comment *after* what you're replying to; b) only quote relevant snippets, not the whole damn message; Quite. c) have some grounding in reality Absolutely. I've just written a zero-length

Re: OSX

2002-02-01 Thread Nick Cleaton
On Fri, Feb 01, 2002 at 11:32:24AM +, Dominic Mitchell wrote: -- #!/bin/sh languages=French Dutch Spanish Italian Swedish Portuguese German findargs= for lang in $languages do test -n $findargs

Re: botch to prevent a warning

2002-02-01 Thread Nick Cleaton
On Fri, Feb 01, 2002 at 01:03:57PM +, Simon Wistow wrote: On Fri, Feb 01, 2002 at 12:39:40PM +, Richard Clamp said: [simon@ns0 simon]$ cat try #!/usr/bin/perl -w use strict; use CGI; { # turn off warnings for this block # assigning directly to CGI's settings

Re: botch to prevent a warning

2002-02-01 Thread Nick Cleaton
On Fri, Feb 01, 2002 at 01:27:58PM +, Simon Wistow wrote: Ah, I thought that Perl parsed the shebang line even if it was passed the program as a filename Yup, you're right, I was wrong. You learn something every day :) As Richard points out, your solution works because of the 'use CGI'

Re: OSX

2002-02-01 Thread Nick Cleaton
On Fri, Feb 01, 2002 at 01:18:05PM +, Roger Burton West wrote: Change find / $findargs -print | xargs rm -rf to find / $findargs -print0 | xargs -0 rm -rf Much better, but even then there's a race if there's a malicious local user. Some sort of extra logic to avoid descending into

Re: Backups

2002-01-31 Thread Nick Cleaton
On Thu, Jan 31, 2002 at 11:28:13AM +, Simon Wistow wrote: Ok, so just to recap. Despite peoples warnings I haven't done this with ssh agent but at the top of my authorized_keys(2) I have host=$myhost command=rsync no-port-forwarding, no-X11-forwarding, no-agent-forwarding, no-pty

Re: OSX

2002-01-31 Thread Nick Cleaton
On Thu, Jan 31, 2002 at 10:52:07PM +, David Cantrell wrote: It is traditional to: a) post your comment *after* what you're replying to; b) only quote relevant snippets, not the whole damn message; Quite. c) have some grounding in reality Absolutely. I've just written a zero-length

Re: Perl challenge

2002-01-29 Thread Nick Cleaton
On Tue, Jan 29, 2002 at 10:21:20AM -, Sam Yeung wrote: Hows about http://www.yeungs.net/cgi-bin/pic2txt.pl . /J\ will probably throw learning perl (3rd ed.) at me if he sees my code - so s.. http://www.yeungs.net/cgi-bin/pic2txt.pl?file=foo.img+src=javascript:alert(1) *slap* :)

Re: Erm, Hello?

2002-01-22 Thread Nick Cleaton
On Mon, Jan 21, 2002 at 06:13:38PM -0800, Paul Makepeace wrote: [MY RANT] Guilty as charged, although I'm sure it was unintentional -- a product of banging out the original script in about five minutes... Ah, you work for an ISP :) How about: next unless /^[^#]*VirtualHost/

Re: Erm, Hello?

2002-01-21 Thread Nick Cleaton
On Mon, Jan 21, 2002 at 09:00:56AM +, Piers Cawley wrote: I've seen it used as a 'switch' type operator: $cond1 ? action1() : $cond2 ? action2() : $cond3 ? action3() : ... $condN ? actionN(); and I'm still not sure whether I utterly hate it or not... $cond1

Re: Erm, Hello?

2002-01-21 Thread Nick Cleaton
On Mon, Jan 21, 2002 at 12:45:16PM -0800, Paul Makepeace wrote: Until the day that $cond1 is true and action1() returns '0', when it breaks mysteriously. Then you won't like, No, not a lot :) #!/usr/bin/perl -wln next unless /^[^#]*VirtualHost/../^[^#]*\/VirtualHost/

Re: Erm, Hello?

2002-01-20 Thread Nick Cleaton
On Sun, Jan 20, 2002 at 05:39:16PM +, Jonathan Stowe wrote: On Sun, 20 Jan 2002, Greg McCarroll wrote: [?: DEBATE] How do we feel about the use of ?: in this code ? Strictly speaking it's a triple nested ?: but I like the pattern it makes. s[ (?: !--.*?--

Re: black hat hackers

2002-01-11 Thread Nick Cleaton
On Fri, Jan 11, 2002 at 06:42:19PM -, Robert Shiels wrote: Actually someone emailed me offlist and he had a quick go at hacking my machine, and didn't get anywhere. A more persistent effort will probably be more successful. As with most people, I'll probably only really do something

Re: Damn Hackers

2002-01-07 Thread Nick Cleaton
On Mon, Jan 07, 2002 at 12:38:12PM +, Roger Burton West wrote: On Mon, Jan 07, 2002 at 12:23:35PM +, Dominic Mitchell wrote: Rather than portscanning yourself (and tripping off your own alarms :-) it's much easier to just do netstat -an | grep -w LISTEN and see what is listening.

Re: Dual boot

2001-12-20 Thread Nick Cleaton
On Thu, Dec 20, 2001 at 12:18:59PM +, Struan Donald wrote: vmware is nice only if you have shit loads of ram[1] though and a fast processor. plus you have cost of vmware + cost of windows license so more expensive. vmware also seems happiest if you give it it's own disk... (this is

Re: Be afraid. Be very afraid.

2001-10-25 Thread Nick Cleaton
On Wed, Oct 24, 2001 at 04:15:08PM +0100, Lucy McWilliam wrote: If anyone can think of a better (i.e. quicker) way to do it - even if it means having to relearn C - I'd love to know. Code snippets below. Bonus points for the subject line ;-) If you have enough swap and RAM, you could

Re: Be afraid. Be very afraid.

2001-10-24 Thread Nick Cleaton
On Wed, Oct 24, 2001 at 05:21:25PM +0200, Newton, Philip wrote: Lucy McWilliam wrote: open(OUT, $x); Wot, no error checking? Or close quote. Nick -- ($O= #\ /#{O$}xb|

Re: Self-test

2001-10-18 Thread Nick Cleaton
On Thu, Oct 18, 2001 at 08:57:27AM +0100, Mark Fowler wrote: As is my right under the 1984 data protection act I demand a copy of all information that you have pertaining to me in electronic form. As I understand it, Greg is allowed to charge a reasonable admin fee for this. About 4 pints

Re: Advanced mail management

2001-10-02 Thread Nick Cleaton
On Tue, Oct 02, 2001 at 02:25:02PM +0100, Dominic Mitchell wrote: I know that. You know that. Try explaining that to people who don't care. I don't care. Practice on me if you like. Nick -- SPAM while y#SPAM?\r\n# #d||s#.{24}#$PAM^=$,''#e||s'$^'sPaM!SpaM!SPaM!SP@M

Re: Politics on London.pm

2001-10-01 Thread Nick Cleaton
On Mon, Oct 01, 2001 at 04:03:39PM +0100, Greg McCarroll wrote: [snip] Ok, let me scratch my first call, could I just ask that a lot more of the topics on London.pm are non-political, my take on London.pm is we are a social list, so lets have more topics about things we are doing, how