Debian

warning: Creating default object from empty value in /home/gwolf/drupal6/modules/taxonomy/taxonomy.pages.inc on line 33.

Perl6 and sigils

Submitted by gwolf on Tue, 03/25/2008 - 01:51

Zack, Wouter: Yup, Perl 6's scheme changes to reduce confusion to the programmer and to make the language better Huffman coded. Why?
As for the programmer, it comes out of observation - Changing the sigil depending on what you are expecting to get back (i.e. a hash has a '%' sigil, but if you only want one value off it, you use the '$' sigil, as it indicates a scalar variable) confuses more often than it helps - Specially newcomers. Besides, it will be easier for the interpreter itself - The sigil will become an invariant but required part of the variable name itself. Hence, Martin will be happier, as there will no longer be different namespaces under which to store your variables. Oh, BTW, Martin: Not only Perl behaves this way. Ruby also uses that concept - There, you have local variables (no sigil), instance variables ('@'), class variables (ugly '@@') and global variables ('$'). I remember in old (Quick|GW)BASIC you had numeric variables (no sigil) and string variables (postfix sigil '$') as well. Any others?
Now, about the Huffman coding part, WTF?
It is one of the design goals of Perl 6 to make the most often used operators be the shortest, so you, programmer, don't wear out your keyboard and lose your valuable fractions of seconds typing i.e. '->' for a method call when you can just type a '.' - Similarly, currently you have to type too many characters for the (too common) dereferencing - If you have a reference to a hash of arrays of arrays of objects on which you want to call methods, you have to do $something->{key}[0][0]->boo - Whereas with Perl 6 you will only have to do $something{key}[0][0].boo
Anyway, I cannot elaborate much further, as I've been -at best- just a bystander. But yes, large changes loom in Perl's future. Let see what comes on...
And when. Sigh.

( categories: )

Sudo: Windowsifying unix, step by step!

Submitted by gwolf on Thu, 03/20/2008 - 01:13

Like many people interested in bringing computer security awareness to the public at large, some eight years ago I was thrilled to get acquinted with sudo. A great tool for giving specific admin rights to specific users in a very granular way, with great semantics... And allowing for a degree of flexibility much higher than my needs, honestly.
I think it was the Canonical crew who first thougt of using it backwards, "solving" (for some definition of solution, of course) the long-known problem that desktop users cannot be bothered to understand they are using a normal account which is, for their own personal security, completely separated from the priviledged account.
So, in short, Ubuntu uses a passwordless sudo to grant users (at least I understand it is limited to the first system user, am I right?) access to whatever and whatnot... And most users seem to like this.
Yes, the same way they like Windows: Because it is the no-brainer solution. Now, give a person with no brains some choices... Guess which choice they will pick.
Now, it's assumed by most semi-newbie Linux users that sudo basically means "go ahead". I have tried to get this point across to people complaining that Debian ships a b0rken sudo because it is not basically a ALL ALL = NOPASSWD: ALL
So, as it is currently used... I do feel sadness: Unix systems tend to Windowsification, where real administrator privileges are just a matter of asking whether you are sure. Assuming single, local users for local machines.
[update] Oops! lots of comments explaining my world-view is somewhat flawed... Anyway, I'll reply to the comments themselves.

( categories: )

German and APT::Acquire::Translation

Submitted by gwolf on Mon, 03/10/2008 - 13:25

Rhonda,

The webinterface for it doesn't require any authentication at all, leading technically to anonymous translations all over the place. The so-called "review" process consists of the same not-existing authentication, leading to a situation where unknown people can put in whatever they like and have other (or potentially the same) unknown people acknowledge that.
The language team has actively chosen that way because it was said that bad translations simply won't happen and that the review (three people opening the page and clicking onto a button) will not let that happen. Well, it happened. And is happening all over the place.

Hmmm... That sounds quite like a definition of Wiki in my book. Just add a version-control layer underneath, and...
Oh, you didn't? Umh... Tough luck! :-(

( categories: )

cat STDERR | rot13

Submitted by gwolf on Fri, 02/08/2008 - 11:52

Cannot help but laugh and share.
I've been triaging and trying to reproduce some oldish bugs on pkg-perl's packages. Some bugs are no longer there, some have to be forwarded upstream, and so on. Usual tasks, yes.
Until I stumbled with #406227. I just have to laugh and share! Hope nobody feels ashamed - The bug is the result of different people coding maybe under pressure and with quite different mindsets :)
For some reason I fail to understand, the submitter's test case (rot13 implemented over a HTTP proxy) is invoked in the report as ./rot13 2>/dev/null. Of course, when trying to debug a bug report, the first thing to do is not to ignore STDERR. So, off goes the 2>/dev/null. What happens next?

  1. 0 gwolf@mosca[2]/tmp$ perl ./rot13 &
  2. [1] 4394
  3. 0 gwolf@mosca[3]/tmp$ GET -p <a href="http://localhost:8080/" title="http://localhost:8080/">http://localhost:8080/</a> <a href="http://www.debian.org/<br />
  4. Can't" title="http://www.debian.org/<br />
  5. Can't">http://www.debian.org/<br />
  6. Can't</a> locate object method "filter" via package "UGGC::Cebkl::ObqlSvygre::fvzcyr=UNFU(0k604160)" (perhaps you forgot to load "UGGC::Cebkl::ObqlSvygre::fvzcyr=UNFU(0k604160)"?) at /usr/share/perl5/HTTP/Proxy/FilterStack.pm line 126.
  7. 500 EOF when chunk header expected

WTF... Well, at least the program name gives me a clue... Lets try to "decrypt" the error message...

  1. gwolf@mosca[4]/tmp$ echo 'UGGC::Cebkl::ObqlSvygre::fvzcyr=UNFU(0k604160)' | rot13
  2. HTTP::Proxy::BodyFilter::simple=HASH(0x604160)

hrm... How comes the filter is filtering its own code and only then refusing to find itself!? Ok, time to open up the manpage - Remember, I'm only group-maintaining this pacakge, I am not yet at all familiar with it! Ok, so the core of the filter is when the submitter states:

  1. my $proxy = new HTTP::Proxy();
  2. $proxy->push_filter(response => new HTTP::Proxy::BodyFilter::simple(sub { tr/a-zA-z/n-za-mN-ZA-M/; }));

While the manpage states it should be invoked as:

  1. my $filter = HTTP::Proxy::BodyFilter::simple->new( sub { ${ $_[1] } =~ s/foo/bar/g; } );
  2. $proxy->push_filter( response => $filter );

Of course, once looking at it, the answer is simple: The submitter left out which element to act on in the anonymous function body - The ${ $_[1] } =~ part. Adding it makes gur svygre jbex nf rkcrpgrq... Err, sorry - makes the filter work as expected.

Now, bonus points: For the non-Perlers out ther: How come we get the namespace translated as well? Oh, that's very simple: In Perl, as in Python (and concievably other languages I'm unaware of), the object is passed to any of its methods as the first argument. Functions in Perl receive their arguments via @_ (read: the default array). And, of course, the tr (regex-based transliteration) takes by default the first thing it sees - the object itself. And what happens when you apply a (string-oriented) regex to an object? Of course, it gets stringified - which, by default, in Perl means converting it to the closest possible description: "a hash reference blessed as an object of the class such-and-such at this memory location". That string gets worked on, and we get UGGC::Cebkl::ObqlSvygre::fvzcyr=UNFU(0k604160). This proxy does not die on very-very-short web pages, where the whole content fits on one iteration of the code (although it does not work correctly - the text remains unaltered, of course, as it was not worked on), but if the request spans several chunks, the second time the filter is called, it will be... just gibberish.

Oh, and what about the extra ${ (...) } around $_[1]? Oh, simple: The string is passed as a scalar reference, so it can be modified in place. Yes, it's the Perl way of pass-by-reference instead of pass-by-value (the default behaviour): Of course the parameter is only passed as a value. Only that the value is incidentally a reference - but who cares? ;-)

Anyway... Many oddities. I would implement the module in a completely different way, and it looks quite backwardish in my book. But then again, TIMTOWTDI.

( categories: )

Converting incoherent sets of data between charsets

Submitted by gwolf on Mon, 02/04/2008 - 23:33

Dato complains that converting changelogs to be UTF8-clean is not always as simple as running iconv - One of the reasons that took me so long to migrate my blog is that, due to having migrated (at different points in time) my previous CMS (Jaws 0.4->0.5->0.7), its underlying database (MySQL 3.4 -> 4.0 -> 5.0 IIRC), the distribution (Debian Woody -> Sarge -> Etch+backports), several reinstalls and all... Well, I had a completely mixed-up database, with some tables in UTF, some tables in latin1, some tables with mixed rows, some tables that for some strange reason had double-mixed rows (that is, that had UTF8 misrepresented as latin1 and then re-encoded into UTF8)... No, it was not fun to sort out.

( categories: )

Introspection in Perl

Submitted by gwolf on Thu, 01/24/2008 - 11:19

Some days ago, my RSS reader found Mark Jason Dominus' Help.pm - Yes, the module is (so far, at least - I could not find it on CPAN) only published as a blog post. But don't let that fool you - It's a beautiful (and simple!) Perl module that can help developers that are too lazy to go look up methods in the man pages.

Perl's introspection capabilities are not behind other dynamic languages' (i.e. Python's or Ruby's, speaking only about what I'm familiar with). However, it's used much more seldom, partly because Perl does not ship by default with an interactive console (such as Ruby's irb or Python's regular behaviour when called without an input script). Of course, writing a Perl console is an easy task, and good Perl consoles exist, although its use is not part of the Perl culture.

But of course, just glancing over MJD's code made me come up with a simple, yet useful, way to use introspection in Perl, usable as a simple one-liner. Say you want to look at all of the methods provided by IO::File:

gwolf@mosca[25]/tmp$ perl -e 'use IO::File; print join(", ", grep {defined &{"IO::File::$_"}} sort keys %{"IO::File::"}), "\n"'
binmode, carp, confess, croak, gensym, new, new_tmpfile, open, qualify, qualify_to_ref, ungensym
Want the scalar variables? Of course:
gwolf@mosca[26]/tmp$ perl -e 'use IO::File; print join(", ", grep {defined ${"IO::File::$_"}} sort keys %{"IO::File::"}), "\n"'
VERSION
Same goes for arrays and hashes. And, of course, leaving out the grep gives you anything. Yup, it's the magic package-name hash trick. Main difference between this and MJD's Help.pm? That Help.pm goes up the inheritance chain, and is thus much more correct.

Of course, I'll be uploading Help.pm to Debian very soon - And, why not, I think I'll add a way for it to query on different symbols, not just on methods. And the simple binary to call from the command line. Sounds very much worth it ;-) Thanks, MJD!

( categories: )

World Social Forum 2008 - Another world is possible

Submitted by gwolf on Sun, 01/20/2008 - 23:10
A phone call in December made me very proud: A colleague I met thanks to the Espora collective told me she was involved in the Mexican activities for this year's World Social Forum (FSM Mexico 2008 site). The Mexican activities? Yes. This year, the World Social Forum will not be held at one -or several- distinct places, but it will happen globally. There will be activities in tens of countries. The activity program for Mexico (full PDF version) is quite loaded - And I was invited to give one of the talks, this Friday (Jan 25) at 12:00, about Free Software for a Free Society, in the Foro Derecho a la Comunicación track.
I am very honored by this invitation! I just spent a couple of hours organizing/going through the topics I will be presenting. I hope to be able to be at some other of the forum's activities, as it just is too important and interesting to miss out!

Debian Developers fail Turing tests?

Submitted by gwolf on Fri, 12/07/2007 - 12:31

Ok, so two people replied to yesterday's post about triple negations - Dato (by email) and MadCoder. Both, said basically the same thing: || false and && true are silly noops. And yes, knowing this, I added them. Why? Clarity... At least having them at the end of a test shows the statement is of conditional nature (and not just another obscure attempt to do ${DEITY}-knows-what). They at least look cleaner than a one-line-squashed if block in a makefile. To me, at least ;-)

But... If you noticed this post's title, it goes beyond this comment - One of the most benefical effects I noticed when I installed Jaws 0.7 (over 0.6, of course) is that I no longer had the swarms of spambots flooding me - I often had hundreds of comments a day, and nowadays I hardly get any spam. Now, I fail to see what is so strange in my blog's comment forms (it does not even have any obvious Javascript, although it does obfuscate a bit the source of the captcha image). And you are not the first Debian people to complain you cannot post comments to my site. Strangely, few non-Debian people have ever complained.

And yes, the spam has stopped, almost completely.

So, Debian guys: Are you human?

( categories: )

Triple negations

Submitted by gwolf on Thu, 12/06/2007 - 15:18

I'm packaging Ruby's PDF::Writer module for Debian - It is a simple module and (almost) ready for upload. But anyway, it carries some issues I had to bring to debian-legal's attention, mainly, five files licensed under Creative Commons licenses (specially two of them, which are under its NonCommercial variant - clearly non-free), so I'm repackaging the .orig.tar.gz into a +dfsg version.

But I know I'm a lazy and sometimes stupid bum. Even more, the package will be group-maintained by the pkg-ruby-extras team, so we must be as careful as possible not to forget to remove the non-free material - To remove two scripts, and to replace three images with free equivalents I just made. But hey, tell me if this does not feel ugly to you. At least to the bits of you who learnt human grammar:

clean::
	# Make sure we strip out non-DFSG demo files from the orig.tar.gz
	[ ! -f demo/qr-library.rb -a ! -f demo/qr-language.rb ] || false 
	[ $$(md5sum images/bluesmoke.jpg | cut -f 1 -d ' ') == 0586eca5af7523ab871609eceb44724a ] || false
	[ $$(md5sum images/chunkybacon.jpg | cut -f 1 -d ' ') == a000b1917142ce332fd3474f0722cd6f ] || false
	[ $$(md5sum images/chunkybacon.png | cut -f 1 -d ' ') == 927feec1cbbf23c4d89a4a5ad88e6d0f ] || false

Triple negations. How nice.

( categories: )

Digging into Drupal

Submitted by gwolf on Thu, 12/06/2007 - 12:06

As of late, I've shifted quite dramatically my sysadmining/development activities. On the development front, although Perl is still my mother tongue and I maintain many systems I wrote with it (and my main involvement in Debian is through the pkg-perl group, of course), I've been largely switching over to Ruby - both under the Rails framework and doing standalone stuff.

But somehthing that's new to me (well, relatively - it has been observed I have been playing with the idea in and out for some more time) is entering this maze of twisty little passages, all alike called Drupal. What can I say? I'm quite surprised by it. It is such a reach CMS, and so twistable for almost-anything, that it still defeats me.

I've been asked (ordered? pushed?) to propose a complete plan to replace my Institute's current static-and-butt-ugly-HTML site with something dynamic and manageable, so, of course, this last week has been an intensive Drupal crash-course for me.

Drupal itself is quite complex, yes, and I thought I had it mostly mastered for the trivial tasks. But then, I started looking for some I-thought-quite-simple extra thingies - And I started discovering its user-contributed modules. I've been having quite a bit of fun with them, and as I hate messing up my clean and nice installation, I've even set up a Drupal5 modules APT repository for Etch, where I'm putting the modules as I process them.

As I'm really not into PHP, and I still lack enough of the Drupal framework understanding to really step forward and become responsable for them, I'm not yet even suggesting packaging them for Debian - but a time might come where I upload them as well ;-)

BTW, in case somebody is wandering about this Jaws-to-Drupal scripty I mentioned that other time: It basically works for blog entries (as you can see in my test site - barring some trivial latin1-UTF discrepancies). I have not yet migrated because I'm also trying to migrate my Phoo photo galleries to Acidfree albums... And it's quite a more challenging task than just migrating blog+comments. But soon, I hope - I have a bit more time than in the last weeks to be able to play with it. Anyway, here it is as it is.

( categories: )

Welcome on board!

Submitted by gwolf on Thu, 12/06/2007 - 11:40
Yes, yes, I know I already said so, and surely in a more visible site, and even he also announced his victory over DAMnation... But still, having more Mexicans in this little project I call home makes me very happy. So, welcome on board, Rodrigo!
( categories: )

Lucas killed ries!

Submitted by gwolf on Mon, 11/05/2007 - 18:19
Is there a causality relation between Lucas' posting and ries.debian.org's (a.k.a. ftp-master.debian.org) sudden demise? Grmbl...
( categories: )

Mini-post-mortem of a failed mini-Debconf

Submitted by gwolf on Sun, 11/04/2007 - 13:04

Over one year ago, still at DebConf 6, the Latin American Debian people (and by people I mean just interested people, regardless of whether they were/are official DDs or not) held a BoF session. One of the ideas we discussed there was that, in order to increase Debian presence in our region (which is by no means small - Let alone the geographical aspects, I'm guessing we are about 350 million people, roughly split in half between [officially] Spanish- and Portuguese- speaking countries). Yet, this is an area with very little involvement in Debian in particular, and with Free Software in general.

One of our first issues seems to be language - Just by its scale and economic importance, we cannot even put in the same scale Brazil and the Spanish-speaking countries... So I'll focus on Spanish-speaking Latin America, as (I recall) we did in that session.

So, we agree: We need more local involvement in each of our communities. And, so far, we have seen quite relevant results. The number of people directly involved in Debian in Argentina, Chile, Perú, Colombia, Venezuela, El Salvador and Mexico (excuse me if I forget you in another country!) has notably risen since I brought this topic up, together with Christian Perrier, back in DebConf5, Helsinki. An undeniable fact is that distances in our continent, however, are huge. In the 2006 BoF, we agreed we should promote regional meetings, that would serve both for working focused on Debian topics (i.e. hack sessions, as we do in DebConf) and for spreading our work to the local population, to help them see that it is not needed to be super-skilled or anything like that to contribute to a real, important and large Free Software project such as ours. Of course, taking into account the distances in the continent, we thought it would be sensible to split it in two - and to try and hold regional mini-debconfs - One for the Northern half (i.e. Perú, Ecuador, Colombia, Venezuela, Central America, Cuba and Mexico), and one for the Southern half (Bolivia, Chile, Argentina, Uruguay, Paraguay). And, for logistical reasons mainly, I strongly advocated having our first Northern meeting in Panamá. Why Panamá? Because it is a place cheap and easy to get to. They have a very important international airport, connecting to most if not all countries in the region, and -as they have risen as a business center- have good connectivity. Visa is required for many of the interested countries, but trivial to get (as opposed to what happened here in Mexico :-( ). Of course, other countries also looked interesting (there was some argument pushing Venezuela, but in the end, we all conceded it would be in Panamá.

I have to strongly thank Guillermo García - He is not (yet? :) I hope he still wants to get involved with this bunch of people) in Debian in any way, but after I contacted him, he agreed to start looking for a way to get us the right facilities in Panamá. He coordinated with a team which did most of the organization - A very nice web site is still available so you can look at their work - Quite a good job, I must add.

They contacted Universidad Tecnológica de Panamá, started talking with several potential sponsors, got information regarding hotels for us... But in the end, it flopped. Why? Because, although many of us were originally interested, in the end very few people (only three, none of them officially a Debian Developer, according to their last press release) confirmed their intention to attend.

Which brings me again to the question: Why?

First and foremost, I think it was lack of involvement. For one reason or another, all of the people that in the beginning pushed for this miniDebConf ended up busy doing other stuff, and didn't get at all involved in organization. It would have been a great present from our Panaman friends, yes, but quite unfair. And, of course, with no Debian people involved in organizing it, we got an chicken-and-eggesque situation... Where it didn't grab the attention of other Debian people.

Second, what they offered us was quite different to what we intended in the first place - At least, to what I imagined. On my first messages both to debian-devel-spanish and to Guillermo, I tried to get something close to what we had in mind: Something as informal and as intimate as it could be. My original request to Guillermo was just to get us a room where we could hack and talk, and probably sleep with sleeping bags.

Of course, I can perfectly imagine that when he requested the space to the university, on one hand, they didn't feel at ease having International Guests (with capital I and G - Very important for most Latin American universities!) sleeping on the floor. And, on the other hand, they would love to be able to show us around! Having an international project focus on a university in a non-technologically-well-known little country is quite something to show off!

Anyway... What happened? I was among the instigators, but Real Life called me away (I've been mostly inactive in Debian since September! :-( ). The miniconf was scheduled for November 14-17. I also insisted originally on having the miniconf on a long weekend (say, Friday through Sunday), as -being a miniconf and not the Real Deal- it'd be much easier for most of us to rob one day off work than a full week. In the end, this was the most important point for my decision not to join: I cannot afford more time off my work, not at this time of year. About the other involved people? I do not want to speak for any other people.

In the end, sadly, Guillermo had to inform us they cancelled - No, not postponed, but definitively cancelled. Why? Because -and I have to agree- next year we will have DebConf in Argentina... And many people in the region will focus our time and money on getting there.

Ok, making this whole story short: I'm very, very ashamed and sorry, with you personally, Guillermo, and with your whole team. And I hope we can resurrect this idea - be it in Venezuela (as it was suggested once) or elsewhere.

Click-through GPL sucks!

Submitted by gwolf on Fri, 09/14/2007 - 10:16
I completely agree with Adrian's comment. I've recently installed a lab full of OpenOffice for Windows. Of course, the installation is easy (but you have to explicitly accept the GPL to get on with it - why?), but what's really annoying is that the first time each and every user starts the program for the first time, they are also prompted for license agreement. Even worse, they are expected to fill out a quite lengthy survey (which I filled once, of course, but still is too much to ask for the vast majority of our users!). Free Software should be exempt from the stupid click-through nonsense!
Anyway... also echoing Adrian and Otavio: Robert Millan's work on win32-loader just kicks ass. If you are not reading me through Planet Debian, please take a look at this ogg video file (Windows users: you can use VLC) showing what happens if you insert the (Sid) Debian installer CD into a Windows system. No more fiddling around trying to get the stupid machine to boot off your favorite media! Good job!
( categories: )

At YAPC::EU 2007!

Submitted by gwolf on Wed, 08/29/2007 - 05:45
So here I am, sitting at a talk at YAPC::EU 2007, in the beautiful Vienna. It is too early to start thinking about a status report for what I've done and talked about, but I can say in advance that I'm very positively impressed - I expected my talk on the integration between CPAN and Debian that the Debian pkg-perl group is carrying out (presentation, full article) to be marginally interesting to a couple of people. Turns out, as YAPC drew closer, I heard from several people interested in attending it. Ok, maybe it is just for courtesy? Lets not get excited about no big deal...
Well, yesterday was the first day of CPAN - Man, after getting used to Debconf, three days of an interesting conference is just way too short! YAPC guys, for the next time... More time, please? :-}
I knew I would be meeting pkg-perl members Zamoxles and Jeremiah - Very nice to finally meet you guys! And a very welcome surprise (although we have been barely even able to talk) was to find another fellow DD, Daniel Ruoso, one of the agitators that started the pkg-perl group. He is not active (in the group) anymore, but he is still one of The Patriarchs ;-)
Ok, on with the talk: Contrary to what I expected, the talk room was quite full. I am used to longer talk slots (20 minutes is just about enough to spell my name, damnit! I presented 24 slides, and jumped only two of them - But made it just in time for the very strict Austrian staff to prepare but not wave the __END__ signal ;-) Would they show a die 'argh'; afterwards?), so I had to keep the limit from the very beginning.
Of course, there was no time for questions as part of the session. However, I've since then been approached by several people and discussed several aspects of our work and ideas for the future. I'll post more about this after YAPC is over...
My warmest kudos to the very orangy, mohawk-wearing orga team. Not only they came up with a great conference and are invariably good-mooded and nice (hey, I should learn from them!), they even have the presence of mind to be very nice, to go out with us to have a good time yesterday night!
Anyway, it shows the conference's topic is Social Perl. Nice social geeks are no longer a novelty to me, but still: The Perl community is warm, welcoming and in general, very nice. I'm quite happy to have made it here!
Syndicate content