paul.j.fenwick
Freedom Loving Scientist
Welcome to my home on the internet! Everything here is free
under the Creative Commons Attribution 3.0 license unless marked
otherwise.
This site contains various pieces of writing across my various
interests, and spanning several years. You can
fork this site
on github if you wish.
Chicken Behavior
You're a chicken. You're feeling thirsty. You have the option of drinking:
- Fresh rainwater collected in an empty pot, easily accessible.
- Water from the drink-feeder, refilled yesterday afternoon, easily accessible.
- Water from a stagnant bucket of rotted compost, complete with scum and floaties, difficult to reach.
You know which of the above would have the most flavour, and so do our chickens.
I can't believe we eat the eggs of these birds. On the other hand, I have an overwhelming admiration for their immune systems.
Three easy steps to keeping your consultant happy
- Learn how to use the shift key for capitals and punctuation. Learn how to use the enter key to make paragraphs.
- When the consultant states that something is an incredibly bad idea, at least pause and think about that for a moment. Don't respond by asking how soon it can be implemented.
- Pay your invoices on time.
(read more...)
Interesting Perl Bug
To see an interesting bug which caused me many headaches, enter the following script, and mark it setuid. Then run it as any other user except the owner.
#!/usr/bin/perl -wT
$ENV{PATH} = "";
print "Hello World\n";
system($0,"1") unless @ARGV;
The result is a delightful message about how your kernel has a setuid script bug which is rather dangerous and easy to exploit... except that you don't
Perl is just getting confused because it looks like the interpretor has been started setuid before it's had a chance to do sanity checking and invoke suidperl. The result is the inability to have a setuid script invoke itself. Very bothersome.
The solution is to drop setuid privileges before the script calls itself again. Conveniently enough, Perl allows us to localise $> (effective UID), so the following program does work as intended:
#!/usr/bin/perl -wT
$ENV{PATH} = "";
print "Hello World\n";
unless (@ARGV) {local $> = $<; system($0,"1");}
Because of the use of local, setuid privileges are only dropped for the duration of the call to system. Of course, it's usually a good idea to drop setuid privileges as soon as possible, or only invoke them when you absolutely have to.
(read more...)
More Weddings!
Congratulations to Dan and Tomoko, who are also engaged. I've been holding my tongue a little regarding this, hence my rather cryptic entry on the 28th April.
Mushrooming
On Saturday we went mushrooming with Dan and Tomoko out in Emerald (an outer "suburb" of Melbourne). Dan's family regularly goes out to a very scenic golf-course every year to pick mushrooms. There's an incredible variety of fungi growing on and around the course, although there were only two types that we were picking. We ended up taking home a huge box of them, and spent the evening preserving and cooking with them.
Dan only knew the mushrooms by their Russian names, although he provided us with English translations for our benefit. However, I was curious to learn more about these fungi which (except in the pantry of Dan's family) I had never seen before. It ends up that we were collecting
chanterelles and Slippery Jacks. I've been chomping down on the chanterelles both during the preserving activities, and now again today. I haven't yet tried the slippery jacks -- we don't have as many, and I'm leaving them in the jars longer to soak up some of the flavour of the spices and herbs we added.
Diplomacy
We actually succeeded in organising and running a 7-player Diplomacy game, with (most) players arriving on-time, (most) turns taking a fixed amount of time, and actually having the game run to completion (five-way draw, with Italy holding 17 centres). I was the first player to be eliminated, and Ross the second. Despite this, we were both instrumental in planning and holding a stalemate line to force the draw.
(read more...)
No more flash ads!
I've loved
Mozilla for its ability to disable pop-ups, block ads, and generally be incredibly useful. However it's always bothered me that I can't block flash-ads in the same way that I can block normal images.
However, thanks to a helpful comment on slashdot today, I discovered there is a way to block flash ads! My web-browsing experience has now become a whole lot nicer. For instructions, you can visit Dion's stuff.
(read more...)
Weddings!
Oh wow! My friends are all getting engaged. Congratulations to Ian and Sofie who got engaged last weekend! There's even more exciting news that I'm not allowed to say, so I won't say that here.
Chickens
The chook that was having problems with her vent appears to be much better after her adjustment, and has made a full recovery.
Alas, the chicken that lays broken eggs is still laying broken eggs.
Perl Courses
Our public courses are filling up. Hurrah.
(read more...)