Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jarich (4909)

jarich
  (email not shown publicly)
http://www.perltraining.com.au/
AOL IM: ManningBear (Add Buddy, Send Message)

I run Perl Training Australia [perltraining.com.au] with pjf [perl.org] and do a lot of the course writing and maintenance. I also organise the courses we run, so if you want one, just ask. I hang around a bit on Perlmonks [perlmonks.org] and also help run Melbourne Perl Mongers [pm.org].

Journal of jarich (4909)

Wednesday February 27, 2008
09:56 PM

SAGE-AU 2008 Call for Participation (Adelaide, Australia)

Please forward this invitation to anyone you feel would be interested. For all information, contacts and updates, see the SAGE-AU conference web site.

16th Annual System Administrators' Conference (SAGE-AU 2008)

The System Administrators' Guild of Australia

Adelaide, 11-15th August 2008

SAGE-AU was formed to advance the profession of System Administration by raising awareness of the need for System Administrators, and educating System Administrators in technical as well as professional issues. Our yearly conference provides a forum for System Administrators of all platforms and levels of experience to gather together and share their experiences. Further it provides an excellent opportunity to meet and network with acknowledged experts in the field.

SAGE-AU 2008 will be held in Adelaide from the 11th-15th August.

Tutorial Program: 11th - 13th August

SAGE-AU 2008 will include three days of tutorials of both 3 hours and 6 hours duration. Previous years have included tutorials on topics such as:

  • Automating Windows Vista
  • Change Management
  • Issues in Unix Infrastructure Design
  • Management-101

For more details and to submit your proposal(s), visit our Call for Technical Presentations

Technical Program: 14th - 15th August

For the first year, two parallel streams will be running. If your job includes looking after systems, networks, or machines for which you are not the sole-user, we'd love to hear you speak!

Previous years have included talks on topics such as:

  • Security
  • Wireless Networks
  • System Administration Ethics
  • Virtualisation
  • Standards (and Compliance)

For more details and to submit your proposal(s), visit our Call for Technical Presentations

If you have any questions or require assistance with your submission, please don't hesitate to ask!

Tuesday February 26, 2008
12:50 AM

File::Temp, binary mode and text files

In my day job, amongst other things, I write training materials and run courses for Perl Training Australia. We've only recently added File::Temp to our course notes, and since we allow our attendees to use either our portable training server (Linux) or their desktop (often Windows) we've hit a problem.

File::Temp's tempfile isn't portable for text files. This is because it opens them using sysopen and the O_BINARY flag (where available). This means that newlines printed to the file aren't converted into the operating system's preferred end of line character(s).

This shouldn't have been a surprise, it's in the documentation:

BINMODE

The file returned by File::Temp will have been opened in binary mode if such a mode is available. If that is not correct, use the binmode() function to change the mode of the filehandle.

Note that you can modify the encoding of a file opened by File::Temp also by using binmode().

However the binmode documentation rightly points out:

For the sake of portability it is a good idea to always use it when appropriate, and to never use it when it isn't appropriate.

I know I can tell the Windows students to write:

binmode($tmp_fh, ":crlf" );

after their call to tempfile(), but it's still not going to be portable. Creating a tempfile doesn't look like it should be a special case, and in my experience, it's usually safe to tell (fairly computer and operating system savvy) students that if it looks portable, it should be.

Is there a layer I can give to binmode to tell it to go back to treating the file as a text file with all the special magic regarding newlines that should happen? I essentially want a: binmode($tmp_fh, ":default");

I can always write File::Temp::Text which doesn't use O_BINARY but that's another, non-standard, module for the students to have to install.

I originally brought this question up on PerlMonks but I'm still hoping for a magic answer that lets me teach students a portable way of handling temporary text files where the file name is available. (Yes, I know about open with an undef filehandle).

Any hints?

Thanks, jarich

Sunday February 03, 2008
02:48 AM

Open Day thank yous

I just want to say thank you to everyone who was involved in Open Day. To the volunteers who spent yet another day making the conference work, to all of those who turned up and asked how they could help just because they're nice people, to everyone who brought someone along to see stuff and/or told others about it. Thankyou! Without your help, Open Day would have been much less fun.

Especial thanks go to:

Grant Diffey who took on the horrible task of making sure that every stand had power. He was roped in because he happened to be standing there at that very moment the issue was being discussed, and thus deserves especial thanks for doing it so well and swiftly.

Steve Walsh for getting the networking going. Steve's job started during the afternoon on Friday - getting the patch panel ready - and continued through to last night - tidying it up again. Steve ran cables (including to the stands who decided they needed them at the last minute), set up wireless access points, and generally did an awesome job.

Doug Chapman and Pia Waugh for presenting their conference talks a second time (and without much notice).

Paul Fenwick who took much of the organisational load off my shoulders leaving me free to do the meta organisation and registration desk handling! He also gave me a great foot massage at the end of the day, which was well appreciated.

The table organisers: Tim Ansell, Tamara Olliver, Bill Farrow, Kylie Davies, Brianna Laugher, Mark Kowarsky, Robyn, Pia Waugh, John Stern, Michael Dale, Simon Pascal Klein, Wen Lin, Mark Phillips, Jon Oxer, Aaron Seigo, Vik Olliver, Con Zymaris, Leif Eriksen, Anthony David, Martin Servior, Melissa, Annette Meldrum, Murray Bishop, Ben Balbo, Donna Benjamin, John Newbigin, Daniel Stefyn, Scott Barnett, Leslie Hawthorn and Cat Allman, Jennifer Kreutzer, Adaora Onyia, Pauline Waite, Kanchana Wickremasinghe, Rusty, Arjen Lentz for hosting tables so that we had all of these excellent stands to demonstrate Open Source to our visitors. Thankyou also to those who helped out on these stands!

Steven Thorne for his hugs and encouragement throughout the day.

All the lightning talk speakers, who keep the visitors so well entertained and to Adam Harvey for organising these so that I didn't have to! Also to Jeff Waugh for his MCing.

Thank you to Robyn M and all the others whose names I missed who gave up time from the lightning talks and closing ceremony to help me haul tables around on Friday afternoon.

Thank you to Edward Borland from "Byte into IT" on RRR, who interviewed me on radio and thus helped with the Open Day advertising greatly.

Thank you also to Donna Benjamin who not only ran the conference organisation but handled a fair amount of my publicity for me. To Peter Lieverdink for creating awesome artwork and signs for me. To Rob B for creating out-door signs. And also to Sarah Stokely for her advertising amongst the general press.

My apologies if I've missed mentioning you! Please add your name to the comments, or email me, so I can update this.

To those who gave me gifts:

I'd also like to thank everyone who gave me gifts throughout the day. I'm afraid that much of yesterday was spent in a whirl of people, so although I should know all the names; I don't! I feel terrible about this, so if this was you, please let me know.

Thank you Leslie Hawthorn for the funky Google pen.

Thank you Janet(?) for the small Ritzenhoff glass with penguins on it, which I understand to be a smaller version of the ones given to the Exec team.

Thank you unknown speaker who gave me a cute little USB mouse with this year's penguin on it.

Thank you to Darrell Burkey who gave me the caffeinated peppermints (and a rubber ball to pass onto Paul).

Thank you to Melissa Dapper for the Ubuntu t-shirt.

Once again, thank you everyone for coming to Open Day and for making it such a great success. According to my estimations we had at least 1000 people walk in, which is just brilliant!

12:44 AM

linux.conf.au (3)

Thursday 31st January

Thursday's keynote was by Stormy Peters on "Would you do it again for free?". She referenced various studies which showed that if you took someone who was doing something they loved, and paid them to keep doing it, that once the payments stopped, they'd be less inclined to continue. There was also some talk about how hiring an open source developer to continue to keep working on their open source - but then requiring that they "work as an employee" - can lead to frustration and disinterest in the project itself. Stormy suggests that some of the bigger businesses seem to have realised this and are improving matters. The end conclusion seems to be that those paid to work on open source, will continue to work on open source even without the pay... but it'll probably be for a different project.

The conference highlight of the day was being awarded a HP iPac. TA few intended recipients weren't available to take their prizes, so Donna Benjamin (head conference organiser) called out some dates, and those with birthday's on those dates won the prize. The final date was "who's birthday is closest to today" and about 6 people (including me) put up their hands. So she clarified and asked if anyone's birthday is today, and that just left me. What a lovely 30th birthday gift!

The "Clustered Samba" talk by Andrew Tridgell (Tridge) was quite good, and I left feeling like I understood almost everything even though I've never set up a samba server, or a clustered anything. I then walked over to probably the most loved regular conference talk "Rockhopper Robot: Designing and Programming an Autonomous Robot with Linux and Open Source" by Doug Chapman. This showed a small autonomous robot navigating around a simple maze and blowing out candles where it saw them. It was simply awesome! This meant I missed Allison Randal's talk :(, but I hope to be able to download and catch up on that soon.

Both Glenn Wightwick's talk on Linux and Home Automation and Elizabeth Garbee's talk on An Introduction to Open Source Animation also deserve a mention.

The end of the day was celebrated with both the Professional Delegates' Networking Session (PDNS) to which all delegates who paid "professional" rates, all speakers, and all exec are invited; and the Google Student Party who invited everyone else. I skipped out on both of these and had a lovely birthday dinner with my friends and family.

Friday 1st February

Happy mail-man day! I took the first part of this morning off from the conference, and thus did not get to see Anthony Baxter's keynote. I hear it was well appreciated however. I arrived in time for morning tea but was quickly mobbed by people asking about Open Day requirements, so I didn't get to eat anything.

I won free for long enough to see (most of) Kimberlee Weatherall's talk on "Stop in the Name of the Law" which was interesting, but hard to apply to what I'm doing.

Upon leaving the lecture theatre I was mobbed again until I ran off to find food and somewhere quiet to eat it.

Carefully sneaking into the lecture theatres allowed me to see Tamara Olliver's talk on "Create Your Own Open Source Dance Mat" and Jeff and Pia Waugh's talk on "The Australian Open Source Industry and Community Census 2007". These were both really interesting, although it was disappointing to see Perl so far down on the list of languages used by software developers. First was C, then C++, Python and PHP were all equal, then Java a little below them and only then Perl with significantly less people using it. Ruby trailed the pack even further.

The rest of the afternoon was spent arranging tables and room space for Open Day. I missed all the lightning talks, which is disappointing, but saw some bits of the closing ceremony. At one point (after being sent off to fetch something from HQ) I walked up to the door (at the back of the room), only to have Donna (speaking) notice me, realise that I wasn't listed on her slide of thankyous (that was on display) and thus thank me personally, which was sweet.

Friday evening was followed by the Google Party. This was a very responsible party, with a few security guards, lots of bbqed food (although not a lot of choices), lots of salad (2 choices), and plastic cups of wine, beer, orange juice, cola (sugared and diet) and lemonade. To get drinks you had to have either a blue (non-alcoholic only) or orange wrist band. Those giving out bands showed varying degrees of diligence in checking ID, but I think that orange wrist bands only went out to those over 18.

All drinks (including water) evaporated at 8:30pm which was unexpected and lead to a rapid wind-down of the evening. Some people went onwards to local pubs while others retired early. Overall, I felt the food, lighting, music and socialising was better this year than last; but the drinks and venue (more seats!) was better last year.

Open Day

Somehow I foolishly ended up starting Open Day at 8am. I was late, but the only person I seemed to inconvenience was the Micro-hire delivery person who I hadn't been expecting until 10am anyway. Other helpers showed up soon after and moved tables, added table cloths, put up posters and banners, ran cables, found power points etc Set-up went extraordinarily well, all things considered, and we were almost ready for our first guests who arrived at about 11:30pm.

The Linux Australia AGM ran long past 12pm (which was my anticipated end time for it) so lunch was somewhat delayed, but most people seemed fairly happy all the same. While the hot food ran out pretty quickly there were enough sandwiches for me to carry around a tray to all the table organisers a short while later.

I had 325 pairs of CDs to give out, and ran out by about 1:30pm. Since most visitors to my "rego" booth were in pairs or families, this suggests that I had about 650 people. There were also many who didn't come near my table too. Since the day seemed to only get busier I think it's safe to say that we topped 1000 visitors!

Paul Fenwick and Adam Harvey took care of the main talks and lightning talks throughout the afternoon, which made my life much easier. The talks appeared to be well attended so I hope the visitors got something out of them as well. Paul suggests that there were generally about 200 people in the Grand Buffet (where the talks were held) at any given time.

Clean-up ended up being remarkably swift with lots of helping hands. All the hardware seemed to find appropriate homes, and only a few items ended up in "lost and found". We generally got all the tables back to where they should have been and picked up most of our junk from the floor, so I hope that the facilities providers will welcome us back again.

After dropping the RepRap device back at the Olliver's hotel, Paul and I did a delivery run back to linux.conf.au's storage room and then headed home. After a great take-out dinner, and hot shower, Paul gave me a foot massage and I finally got an early night.

Wednesday January 30, 2008
07:01 PM

linux.conf.au (2)

Wednesday 30th January (continued)

I took the following notes from Bruce's keynote, and thought here would be a good place to store them.

In a market where the sellers know more about the product than the buyers, bad (cheaper) products drive the better products out of the market. eg 50 cars at $1000, 50 cars at $2000. Convergence price is $1500, but at this price only bad cars will be sold.

Thus in order for the seller to indicate to the buyer that their product is actually more superior they have to send signals. These might be warranties "buy this car and if anything goes wrong in the first month, I'll buy it back at full price".

In the IT field we don't have warranties (for good reasons) so we rely on reputation, opinions of others (Bruce likes it, so it must be good) etc.

Marketing and politics is about the deliberate creation of the right signals to encourage people to buy your product/idea/policy even if it isn't suitable to their needs. These muddy the water.

Wednesday continued with a few surprises. We celebrated the 10 year birthday of LWN with chocolate mud cupcakes. Mmm! I missed a few sessions after that to work on Open Day issues, and to get my slides available for the many people who've been asking. I enjoyed the hall-way track immensely.

Just before lunch, the organisers started handing out OLPC XOs in great quantities (perhaps 70 in total) assigned to selected people. This made it much easier to get a hold of one to play with and appreciate. At lunch I met an old university friend and thus got to show him the joys of these machines. He was envious that such toys are not easily available for his children. It certainly was a hit.

After lunch I attended a talk on AbiCollab: changes to AbiWord to allow collaborative document editing which was very interesting, and one by Jim Gettys about their experiences in getting the XOs out to third world countries. Knowing that their laptops is the brightest evening light source for some of these children gives me an idea of how life-changing this program will be.

A fire alarm in the later afternoon lead to some program changes, but overall, everything went smoothly.

The Penguin dinner was held at the Queen Victoria Night Market and was consequently amazing. I've never been at a conference dinner where vegetarians were so well catered for! We were given $40 broken into $5 vouchers and told to go get whatever we wanted. Thus I went to a vegetarian-Indian stand and came back with a plate of steaming curries, rice, pakodas, and naan. Other people had pasta dishes, or kangaroo burgers, or sausage or.... $15 worth of the vouchers were reserved for alcohol, although most drinks were $6.50 each (they gave change). This lead to a comparatively sober evening, although I didn't hear any complaints. It was quite possibly one of the cheaper social parties (in an organisational sense) for this conference, but I think it will be hard to top.

Tuesday January 29, 2008
08:00 PM

linux.conf.au

Sunday 27th January

LCA started on Sunday, where I got to go to the airport and hang around for a few hours running around to meet speakers/delegates and collect them up to put on our hired bus. Registration opened sometime in the afternoon, but being at the airport until 7pm meant I missed it.

Monday 28th January

First day of the conference. Spent in Portsea (2 hours away from the conference venue) scuba diving with our special guest Linus. Lost Linus at the start of the first boat dive and was very grateful to see him on the boat when we re-boarded at the end. Thought the dive master we had with us could have been better on that dive. Second boat dive was much smoother and we all managed to stay together and have a great time.

Tuesday 29th January

Gave my "Not common enough code optimisations" talk at the Linuxchix mini-conf. Discovered that I had a lot less time than I was hoping to have, so I had to speed up the talk dramatically, but it seemed to be well received all the same.

Went to a great talk by Stormy Peters about community managers. It made me think about my contributions to Open Source. I don't actually contribute code to any projects. I could, but I don't because I fill up my time with community tasks. I'm active in all of the Australia Perl Mongers groups, and hang out on the Wellington Perl Mongers list too. Where I can I organise meetings for them, especially if one of us will be in town to give a talk. I'm subscribed to almost all of the Linux Users Groups in Australia as well as several women in IT based lists. I've helped run OSDC every year since it started in 2004. I'm responsible for LCA's Open Day this year (Saturday 2nd February - come along if you're in Melbourne!), and have been doing various other volunteer things to help too. I'm also Treasurer of SAGE-AU (the Australian System Administration industry body), and am helping organise their conference for August this year.

Doing this hard behind-the-scenes work proves to be quite rewarding in its own way. I turn up at conferences, and everyone seems to know my name. I suspect that if I gave my free time to coding on an Open Source project, then a lot less people would know my name - unless I was lucky enough to pick the "next big thing" project...

I never really intended to be famous; but I'm certainly not complaining.

Wednesday 30th January

This morning's keynote was by Bruce Schneier. A very interesting talk, presented extremely well. The best talk I've ever seen given without any visual assistance. Compelling enough that the right hand side of my brain didn't even notice the time passing.

Huge number of OLPC XOs are being given out, but it looks like I'm not going to be one of the lucky recipients. The focus is to encourage more people to develop more things for them, so it's reasonable I'm not getting one, seeing as how I don't program in Python much and I don't have the time to write much code right now.

I'm really looking forward to reducing my volunteer load a little.

More on today to follow...

Saturday November 17, 2007
08:05 PM

Citizens Electoral Council of Australia

Australian Federal elections always include a few crack-pot lunatic political parties. This isn't surprising considering how many political parties we have. However, for those who vote for the Senate by numbering all the candidates from 1-68 below the line (those voting above the line just put a single "1" in any of the 10 or so boxes of their choice) it can be a challenge to remember what all the parties stand for.

I think a lot of people vote based on their emotional reaction to the party's name. For example non-custodial parents might give the Non-Custodial Parents Party a higher vote than custodial parents without knowing anything about that party's policies. What Women Want is another odd one.

I think, sometimes, that the biggest challenge can be in deciding who you put last. When it comes to deciding between great parties like Family First, One Nation, Australian Shooters Party, Christian Democratic Party and the Citizens Electoral Council; how do I decide who I like least?

Fortunately, one of these has seen fit to spam me with information on their beliefs to help me decide to put them last. Even putting the fact that they spammed me aside, I can't vote for a party who writes (in all seriousness):

... Make no mistake: the "climate change" swindle run by the British financial oligarchy and supported by our complicit mainstream media, will tax us to death—no pun intended. This tax-and-trade scheme will shut down our farmers and manufacturers and ram up the price of petrol, gas and electricity—and it’s all based on one big scientific scam. The London-centred financial oligarchy intends mass genocide ...

Yup, the Citizens Electoral Council wins most-crazy crack-pot party from me for this election.

Saturday September 29, 2007
07:47 AM

#perl on irc.perl.org tonight

Someone called "alankila" complained that women don't join ircnet #Perl. So I thought I'd go represent my gender by joining #perl on irc.perl org tonight.

What a great start! I was greeted with the following (presumably out of context) topic:

(22:32:24) The topic for #perl is: Happy 10th Birthday Purl | iPhone 1.1.1 released | <hex> It was going well until the young girls peeing. <wsdo_okadr> I've seen too many of those around lately | COCKROACH PORN

Hmm.

Since I wanted to see whether purl had a command that would allow me to see if anyone of the name alankila had been in, I PMed it and had the following "conversation":

Conversation with purl at Sat 29 Sep 2007 22:33:22 EST on jarich@irc.perl.org (irc)
(22:33:24) jarich: help
(22:33:27) purl: help is <reply>Jesus is coming! Everyone get naked and fuck!
(22:33:40) jarich: help
(22:33:46) purl: help is <reply>HELP IS AVAILABLE FOR YOU. SAY "HELP" OR ANOTHER COMMAND. FOR A LIST OF COMMANDS, TYPE "COMMANDS".
(22:33:58) jarich: COMMANDS
(22:33:59) purl: COMMANDS are HLAGH, DONGS, JERK IT

Yup, I feel included and welcome here. :(

UPDATE: Fixed the attributions in the topic I posted as I didn't realise that use.perl was eating them.

Monday August 27, 2007
06:00 AM

PHP oddity

The PerlNet Wiki uses Mediawiki which is written in PHP so too are the plugin scripts we use to manage it. As the wiki is open to anonymous edits, we have a fun arms race with spammers. Most of the time, they get caught by our blacklist and their edits don't even get saved. However recently one spammer has done something clever...

When I first spotted this afternoon's spam I checked it for common urls and found that most links pointed to ifrance.com. I would have added it to our blacklist but it was already there! So I checked that the anti-spam bot was still active and it was. Why wasn't this page being picked up? I took a copy of the cleanup script, printed out the regex and ran that with some of the page text: yup it matched!

I printed out what the script was seeing as the text and it matched the page content. I printed that to a file and ran a simple regex over it, yup it matched. I ran the bigger regex over it, no match.

I looked at the data again. Couldn't see anything special about it except that all of it was on one line. Well... surely it couldn't be a memory issue. I was reading the whole text into memory before performing the regex, how would line boundaries make a difference? I wasted time looking into other possibilities.

I eventually came back to the fact that it was a _very_ long single line... that a simple regex could match. Could that be it anyway? I removed a few thousand characters and wow! It started matching again.

I eventually found that (for the size of regular expression we're using) strings of 13808 characters or less would match, but any more and the match would fail.... silently. I did this with the following code:

<?php
# defines $test
include( '/tmp/spam.txt' );

# Shorten the process a little....
$test = substr($test, 0, $length-1160);

# $re removed for brevity
# while I can't match, shorten the string
while(! preg_match($re, $test, $match)) {

        $length = strlen($test);

        print "$length\n";

        $test = substr($test, 0, $length-1);
}
# Yay I matched!
print "match\n";

My string started with 14979 characters!

I wondered how much of this was because it was a very long _line_ as opposed to a very long string. So I edited the data file to add newlines after each url. It matched immediately!

I thought about the length of the regular expression (it's 2584 characters). The simple regular expression ifrance\.com had worked, so I wondered if the failure was due to alternation or capturing. I added in a small hunk of the real regex for about 30 characters (4 alternations) and it still matched. Removing a third of the real regex length (string length, not necessarily alternation opportunities) resulted in matching the string one character earlier but that was it.

Odd.

Monday August 06, 2007
07:31 AM

RFC: Perl jobs mailing list guidelines and submission form

Perl Training Australia has had a unused Jobs mailing list for a while now with the bold intent of allowing all the businesses who contact us regarding Perl consulting and jobs to have (moderated) access to past students of ours (opt-in) and other interested people. But we've been busy and lazy and nothing has happened. I have good reason to believe that the list will receive in the order of 300 subscribers when we make it live.

Today I spent all day putting together a jobs submission page for businesses. This was partially caused by Skud's How not to write a Perl job post and the discussion we had while she was writting it, and also from yet another request for Perl programmers.

I've taken Skud's, Ovid's, Adrian's and Joel Spolsky's advice, and tried to make the potential employer answer all the questions I've ever have about a job when I'm reading the advert. Still I've left lots of them optional just in case they can't be bothered.

This service isn't designed for recruiters. It's for Perl businesses, or businesses who use Perl. Recruiters can use it, but I don't know if they will.

This isn't up for real yet. There's lots of work to be done, including javascript tooltips, improved page linking and the creation of a back-end to handle submissions. What I'm asking for right now is feedback.

  • Would you use this form, or decide it was just too hard?
  • Have I missed any really important questions?
  • Have I missed any really important options in my multi-option questions?
  • Do you think I should change what is/isn't optional?
  • Are there things you think I should leave out?
  • What else should I be covering in my guidelines?
  • Any other feedback.

jobs.perl.org. Before you ask, I just want to say that yes I'm very aware of this wonderful service! Unfortunately there are a lot of Perl programmers in Australia who are completely uninterested in being part of the Perl community. Many of our students are in this category. While I expect that I can ask them to let me subscribe them to our mailing list, I don't think I could ever get them to subscribe to the jobs.perl.org list. My compromise is suggesting that employers also submit their job to jobs.perl.org, hopefully we'll just help them think a little about what they want to post first. :)

Thankyou in advance!