Search Results: "hle"

3 March 2006

David Pashley: Writing Robust Shell Scripts Article

I've just finished writing an article on tips for making your shell scripts more robust. Comments welcome.

1 March 2006

David Pashley: IO::File->open() is broken

So you read the documentation for IO::File and see:
open( FILENAME [,MODE [,PERMS]] )
open( FILENAME, IOLAYERS )
so you write:
my $rules = new IO::File('debian/rules','w', 0755);
and wonder why it hasn't changed the permissions from 0666. Stracing confirms it is opened 0666:
open("./debian/rules", O_WRONLY O_CREAT O_TRUNC O_LARGEFILE, 0666) = 4
A bit further reading of the documentation you discover:
If IO::File::open receives a Perl mode string (">", "+<", etc.) or an ANSI C fopen() mode string ("w", "r+", etc.), it uses the basic Perl open operator (but protects any special characters). If IO::File::open is given a numeric mode, it passes that mode and the optional permissions value to the Perl sysopen operator. The permissions default to 0666. If IO::File::open is given a mode that includes the : character, it passes all the three arguments to the three-argument open operator. For convenience, IO::File exports the O_XXX constants from the Fcntl module, if this module is available.
and the correct way to write this is
my $rules = new IO::File('debian/rules',O_WRONLY O_CREAT O_TRUNC O_LARGEFILE, 0755)
Thank you very much perl for ignoring the permission parameter when you feel like it. Update: Steinar, yes sorry, I did have 0755 rather than "0755" originally, but changed it just to check that didn't make a difference and copied the wrong version. I've changed the post to have the right thing.
% strace -eopen perl -MIO::File \
   -e 'my $rules = new IO::File("foo","w", 0755);' 2>&1   grep foo
open("./foo", O_WRONLY O_CREAT O_TRUNC O_LARGEFILE, 0666) = 3
% strace -eopen perl -MIO::File \
   -e 'my $rules = new IO::File("foo","w", "0755");' 2>&1   grep foo
open("./foo", O_WRONLY O_CREAT O_TRUNC O_LARGEFILE, 0666) = 3
Incidentally, 0755 and "0755" are different:
 perl -e 'printf("%d %d\n", 0755, "0755");'
493 755

22 February 2006

Clint Adams: The Judgment Game

Sometimes, when there are what one might term charged discussions , I like to play a little game. I sample a few of the people who are shooting their mouths off and check to see how they're contributing to a certain project about which I might have some opinions. In some cases, I find that they are not worthless blowhards as one might conclude from the inanity of their speech and actions, but actual contributors who just happen to be terribly, terribly incorrect. In other cases, I discover that they have shown a grave lack of judgment in prioritization. Let's stereotype some of the charming winners. The worthless blowhard: This person has a contribution-to-noise ratio that is infinitesimal small. Perhaps he believes that by expressing himself, he is making the world a better place. Perhaps he thinks that his opinions matter. He is mistaken. The arrogant egoist: This person also does very little. She believes herself to be supremely qualified to dictate the way in which others make their contributions, or at least moreso than the people who are actually doing the work. She is quite often mistaken, and should be ashamed of being such a control freak. The catamite trainer: This is a version of the arrogant egoist who betters the world by taking on an apprentice. The Master supervises the Apprentice's contributions, and continues to dictate how things should be done despite being unwilling to actually contribute himself. One notable difference between this and a respectable mentorship relationship is that the Apprentice is aware that he is more qualified to make these decisions than the Master, but feels that it would be socially inappropriate to shake off the yoke of oppression. He is mistaken. The possessive stoner: This is someone who is lax in her responsibilities but means to correct these deficiencies as soon as humanly possible. If anyone offers to help her, she says, No! I'll do it myself this weekend. Then she does something else. The offer is repeated a month later, and she replies, No! This weekend for sure, Rocky! Two years later, people are still fuming that the work hasn't been done. She is a flake. On a completely different subject, let's talk about Debian. I recommend the expulsion of anyone who posts more than 5 mailing-list emails or newsgroup articles in a 24-hour period. I recommend the expulsion of anyone who finds out about Debian votes by reading Slashdot. I recommend the expulsion of anyone who reads Slashdot. I recommend the expulsion of anyone with subpar personal hygiene. I recommend the expulsion of anyone in Project Scud. I recommend the expulsion of anyone who employs statistics in a dishonest manner. I recommend the expulsion of anyone who tries to impose the values of a particular subculture that is not Debian on an international project. I recommend the expulsion of anyone who uses cdbs. I recommend the expulsion of anyone who likes tarball-in-tarball. I recommend the expulsion of anyone who makes lists. I recommend the expulsion of anyone who contributes more to Gentoo, Mandriva, Red Hat, SuSE, Ubuntu, or Xandros than to Debian. I recommend the expulsion of anyone who ever wrote an autobiography. I recommend the expulsion of Mos Def and Talib Kweli: best expulsion in hip-hop. Y-O.

21 February 2006

David Pashley: Marmaduke Duke

I logged into Last.fm this morning to look at my recommendations and among the more obscurer suggestions was Marmaduke Duke, who apparently are similar to Biffy Clyro, Hell Is For Heroes, Reuben and Million Dead, who are some of my favourite bands. So I decided to log into Amazon to look to see how much it was, and guess what was the music recommendation on the front page: I think someone is trying to tell me something. I'm now looking for some samples to listen to.

20 February 2006

David Pashley: Geek Girl

22:07 <@Laura-> no, there is another
Not only does my girlfriend use irc, she quotes Star Wars. *squee*

David Pashley: Slef-Harming

Slef Did it ever occur to you that the comma rather than period in the email address might possibly have been a genuine mistake rather than an attempt to target you. Your excessively and increasingly paranoid and biased blog postings are starting to piss me off. You managed to suggest that Madduck thought that cookies should never be used. Reading his post you see he referenced Sesse who only said that people shouldn't use cookies if they didn't need to. As for your assertion that wikipeda has a "extreme right-wing viewpoint", I sat and read both the blog entry you posted to and the discussion page in question. You conviently failed to mention that wikipedia's problem with the FAQ is that it is the collective work of anonymous contributors and edited by a person that google ranks below the profile of some games player. (Oh sorry, forgot google is in on the anti-mjray conspiracy). Wikipedia's policy on sources clearly states that primary sources should be "made available by a credible publication". When you've finished complaining, you might want to fix the link element in your rdf to not point to itself.

18 February 2006

David Pashley: "That's not fair!"

A thread on a mailing list reminded me of this.

17 February 2006

Holger Levsen: lost slides and videos on meetings-archive.d.n

Philipp, Joeys "slides" are published on meetings-archive.debian.net and I now have informed Wolfgang that he can update his page. Unfortunatly Joey's paper is written in german...

Also the round of introductions from the QA meeting in Darmstadt is now online (because of rsync-times you'll only be able to see it in three hours). I did not publish it earlier, because someone said something which should remain private. Instead of saying this in advance, so that the recording could have been stopped, this remark was made after saying these things, and therefore required post-processing.

Then it took me three months until I finally looked at that video to edit it. What I saw made me speechless (and smile), the video was already edited! But as nobody told me that, I didn't know :-) Or maybe I was told this when leaving Darmstadt, but it didn't reach my memory...

Now, about four weeks later, I got over my embarrassment not looking at it earlier...

16 February 2006

David Pashley: A Bit of a Confusing Morning

So far, in the last 12 hours, I've discovered that my payslips from this time last year bear no resemblence to reality, my pension company has failed to recieve approximately 1900GBP of money that should have been paid into it and O2 have managed to transfer my mobile number to completely the wrong SIM. I'm still waiting for April so I can call the Inland Revenue to find out what happened to all the student loan repayments I made at my previous company (Approx 700GBP). Have spoken with O2, who are going to transfer my number ot the right SIM, hopefully in the next 2 hours. Need to speak to the guy that does payroll in the office, when he comes in next. Sucks to be me. Update: Phone now works.

14 February 2006

David Pashley: Valentines Day

I don't think a card says "I love you" so much as "Society expects me to buy you a piece of paper, so I felt obligated to get you this."
Discuss.

13 February 2006

Meike Reichle: Back from Cambridge

Returned from Cambridge tonight, back at work now. The weekend was really great, a more detailed report (and maybe a few pictures, depends on how they turned out) will follow once I slept, cleared my backlog and did the things I'd actually planned to do on the plane/train/coach. (Gaaah, I want my laptop back!)
For now I'd just like to let you know that I made it there and back without any problems, the workshop was great and I would like to thank everyone involved. Cheers! :)

PS: I arrived quite late or rather early this morning, I am dead tired, watching Amaya's video of her cats comfortably lolling around on a cosy blanket on a heater does *not* help! *whimper*

Benjamin Mako Hill: Debian: A Force To Be Reckoned With

I submitted the following proposal for a talk at Debconf6:
This talk offers a "Debian Themed" quick tour through the academic, legal, and business worlds. It overs insight into what everyone outside of Debian is saying about, doing with, and learning from the Debian project. In doing so, it hopes to give Debian participants some insight into fields and areas that they are largely unfamiliar with (e.g., management, sociology, anthropology, economics, computer supported collaborative work, etc.). It illuminates what others -- especially academics -- find useful or inspiring about the project and to facilitate self-reflection and self-improvement within Debian. It reflects on the impact that Debian has had in the world beyond the Debian project and, in particular, in those areas that many Debian developers may not be familiar with.
The good news is that the proposal was accepted. The bad news is that this means I actually have to finish doing the research to make the talk happen. To make the talk excellent, I wanted to solicit examples from you, great Debian community. I've already got my own list but I'd like to hear what you think I should talk about? What I'm not looking for is examples of people or organizations that use Debian. This talk is not about people who use the OS or the people who build it. This is about people who have learned from Debian as a community. Primarily, I'm looking for academic publications on Debian. However, anyone who has learned and designed a system or community based on such a paper or from observation would be good as well. People who use or have learned from our voting structure might be a good example as would communities with a Debian-derived social contract. Software engineering research is fair game. Be creative but remember that I've got a limited time on the podium and may be forced into the unpleasant position of being ruthlessly selective. Please add examples to this wiki page or just email mako@debian.org. That's if for now and I'll see you in... Umm... Oaxtepec.

10 February 2006

Meike Reichle: Off to Cambridge

In about an hour I'll finish work and leave for Cambridge. The plan is to take a train to Berlin-Schönefeld, then fly to London Standsted and take a coach from there to Cambridge, where I'll arrive somewhen between midnight and 1am and hope to find (1) King's College and (2) someone who knows who I am and where my bed is.

I usually don't suffer from travel nerves, though this trip is so far foreshadowed by a chain of unfortunate events:
Firstly I scalded my hand with hot oil last weekend and it is now in the state of getting rid of the old burned skin, exposing the tissue underneath that is not real skin but some thin algesic replacement. Ouch!
Secondly my laptop, beloved dropkick, lost its display this week. Well, not physically, but when I booted it up on Thursday the colors where heavily distorted. I tried to fix it yesterday but at some point it just stopped working alltogether. :( Background lightening still goes on and off but nothing is displayed. I am pretty frustrated by this. Not only because I had planned to use the laptop this weekend but also because I really like it and have grown kind of attached to it. Since a professional repair would probably cost almost as much as the thing is worth and I am pretty broke at the moment I'll try to get a used display and replace it myself. (Relevant hints and advice are welcome!)
Lastly, I haven't packed yet, my belt loop is ripped and the prospect of spending long waiting periods with only a book plus pen and paper as means of distraction is not too thrilling.

Anyway, still looking forward to the weekend! (<phlox>Optimism!</phlox>) I'll let you know how it went (and what further mishaps struck me) when I return. :)

7 February 2006

David Pashley: Perl Style and readability

Which of these two fragments is more readable?
$self-> catalina_base  = $ENV 'CATALINA_BASE' ;
if (!defined $self-> catalina_base )  
    $self-> catalina_base  = $self->getTomcatHome() ;
 
if (!defined $self-> catalina_base )  
    CCM::Util::error ("CATALINA_BASE unset and TOMCAT_HOME undefined", 3);
 
or
$self-> catalina_base  = $ENV 'CATALINA_BASE'    $self->getTomcatHome()
     CCM::Util::error ("CATALINA_BASE unset and TOMCAT_HOME undefined", 3);
Update: or
$self-> catalina_base  = ( 
   $ENV 'CATALINA_BASE'  
   or $self->getTomcatHome()
   or CCM::Util::error ("CATALINA_BASE unset and TOMCAT_HOME undefined", 3) 
);

David Pashley: OMFG Google evil

MJ Ray, I think you're distorting what is going on. Google are, rightly, protective of their search results and work actively against people that try to manipulate the search results. This is what BMW.de had done by giving a spam page to google and using javascript to redirect users to the right page. As an aside, this would have broken for text browsers or anyone without javascript. It's not the pinicle of accessibility is it? Google were protecting their index, not using it as a vendetta against people it doesn't like as you were suggesting. Stop being so paranoid and stop distorting the story, or you're no better than the devil you're trying to paint Google as.

5 February 2006

David Pashley: SQL::Translator

Today, I discovered SQL::Translator, which seems to have some very interesting use cases. Basically, it is a perl module for translating a database schema from one of a number of formats and turning it into another format. Parsers include: Output formats include: Several things spring to mind with this:
  1. Defining your Schema in XML and using SQL::Translator to convert it into SQL for several databases and a set of classes for Class::DBI, which would make your application immediately target any of the supported databases.
  2. Documenting an existing database for which you've lost existing documentation by pointing it at a running database instance and outputting HTML page and, thanks to the Diagram output module, visual representation of the structure.
  3. Convert one database from product to another. Point it at a MySQL database and generate SQL for postgresql. If you generated some Class::DBI stuff you could possibly quickly write a script to copy data too.
  4. Using the sqlt-diff script, compare you current SQL to what is running on the database and generate a SQL script to upgrade the database structure using ALTER TABLE etc. Presumably you'd need to convert any data yourself, but is still a time saver for large databases.
I'm sure other people could think of some interesting uses for this. Having looked at the Class::DBI stuff, I think it could do with some improvements. I can't see a way to set the class names, although I haven't spent that much time looking and it insists on having all the classes in one file. Also the XML and YAML formats generated are rather verbose and I haven't looked to see how much I could cut them down to use as the source definition. I suspect that I can make it a lot shorter and rely on sensible defaults. My initial reason for wanting to use SQL::Translator is that Class::DBI::Pg has a large start up time and isn't really suitable for CGI use if you have a complex database. This might be mitigated by using mod_perl, but in the mean time I was hoping I could speed up startup by telling Class::DBI my column names, rather than it querying the database. SQL::Translator should allow me to save duplicating the database structure, whilst allowing me to support multiple backend databases. If I get this working, I'll write up a short HOWTO.

4 February 2006

David Pashley: Trading_A ert starting 01-25-06

EVER-GL0RY_INTERNATI0NAL_GR0UP_INC. (E.G.L.Y) WE CALLED IT AT .38 CENTS NOW ITS AT $2.00! WITH ALOT MORE ROOM TO MOVE! WE EXPECT IT TO BE TRADING AROUND 5-6 D0 ARS BY EARLY NEXT MONTH! A MAJOR PR CAMPAIGN IS STARTING WEDNESDAY FOR THE REST OF THIS WEEK INTO THE NEXT!! THIS ONE IS GOING BACK ON THE MOVE! GET IN EARLY!! ** ACT QUICK AND TRADE OUT THE TOP ** About the Company: Shares issued and outstanding: 10.5mi i0n Profits for the 9 months ended Sept, 30 2005: $1.1mil This means that this company is earning over 10 cents per share in only nine months! In our view, this in itself is reason to buy. About the Company: EVER-GL0RY_INTERNATI0NAL_GR0UP_INC(E.G.L.Y) is an American public company engaged in international business and garment manufacturing mainly for high grade well-known casual wear, outwear and sportswear brands such as Reebok, North Face, Levi's and many more. It has a wholly-owned subsidiary company in mainland China-Nanjing Goldenway Garment Company Ltd. The company has over 700 team members, total assets near US$7.5 mi i0n, and annual revenue of approx. US$8 mi i0n. We here at Smart Money feel that the fundamentals of this company and the hot market sector make it a winner. But what is really going to make this company take off is expected BIG NEWS! Please go read the latest news now!! We all know it's the big announcements that make these gems move. We believe the time to get in is now. Watch this one go higher and higher all MONTH! **GOOD LUCK AND TRADE AT THE TOP**

3 February 2006

David Pashley: UK Acts online

I can't believe in this day and age that OPSI (formerly HMSO) still don't have copies of UK acts of parliament before 1988 online. According to their website:
Q. Why do you only display legislation back to 1988? A. The website was launched in 1996. Initially, legislation was only available from that year. In 2000 we took the decision to include older legislation for which we had electronic files. These files only dated back to 1988. Prior to this, legislation is only available in its original print format.
I don't think it's acceptable to say "Oh it's a bit of work to make them available." If Project Gutenberg can make 17,000 out of copyright works available, I fail to see why the government, who have resources at their disposal, can't make the text of approximately 3000 acts from the last 100 years available. This makes several key acts which govern us today unavailable to the UK public, including the Telecommunications Act 1984, Sale of Goods Act 1979, Supply of Goods and Services Act 1982 and Unfair Contract Terms Act 1977. On a similar note, they have only just started making PDF files avilable for download (since October 2005). They don't appear to be planning on making existing documents available in PDF. Again, I don't think it would be too hard to make all their content availble in alternative formats.

Meike Reichle: Some work on gender and FLOSS

I've been pretty busy lately, reading and writing up some stuff on women in/and FLOSS. The source of this "activity fit" was Michel Bauwens, who sent me an e-mail at the end of November. He asked me to look into the research he did on peer production, peer governance, and peer property modes (short essay on the topic) and comment on it with regard to the underrepresentation of women in P2P communities. I felt quite flattered by his request, so I put some effort in it, in order to give an (as I hope) well-founded answer. The result is this mini-essay, that is now featured in the P2P Foundation blog and may also pop up in a few other places.
This also coincides nicely with a mail I got at about the same time from the FLOSSPOLS Project. They are organising a workshop on gender and FLOSS in Cambridge next weekend and invited me to participate. I am very much looking forward to this! Not only because it's an interesting topic, but also because I am finally going to personally meet some very interesting women, who I've only virtually "talked" to or only read about until now.

Also, this happens at just the right time, since I have recently begun to grow a bit bored by the whole Women and FLOSS Issue and it's ever-repreating discussions. I feel that these events give me back some of the momentum I've lost over the last months. Raising the number of women in FLOSS is a complex, longsome and sometimes even tedious business and it's good to get a little push from time to time.


PS: Congrats, honey! ;-)

31 January 2006

David Pashley: Libelous

Found out that I'd been libelled by an old school friend last night. Apparently I was mentioned as part of LugRadio's highly amusing Look Queer for the New Year competition. Listen to the stream here (about 2 minutes in). I mean how insulting is it to be told you look queer by a guy who looks like this: I don't know if I'm more insulted about only coming third or by the fact that I don't get a prize. Wish I'd slept with his girlfriend now (or at least her sister). You can run Jono, but you can't hide.

Next.

Previous.