Search Results: "cas"

17 January 2007

Eddy Petrișor: disable the pcspkr - hacks

I blogged 5 days ago about the annoying beeper and different methods that were supposed to turn it off.

I asked for a clean solution, but I received suggestions for some hacks. Now I decided to make a new post since there was a comment added today and I remembered about a possible hack (dpkg-divert) I was thinking about.

Now here are some of those hacks and the reason behind rejecting them.

Still, the question remains, why don't the originally proposed methods work, especially blacklisting?

Update: the headphones jack works with some small changes, bug submitted (#407252)

Brett Parker: Some complete randomness...

So, today (other than work, where I've mostly been battling Java), I've been battling in my mind between 2 things that are (probably) never going to happen - in both cases I've been told at various points that they're never going to happen, so I mostly believe that - but being an optimist at heart (and a pessimist by trade), I can't garantee that either isn't going to happen, and that makes my head hurt. Lots. I can't understand what anyone would ever see in me being one of the greatest problems, I'm not particularly good at chatting, I have a limited experience of the world, I don't understand football, I don't understand religion (I can see merits in it, but also a whole lot of downsides), and I'm generally (mostly) boring... so, with all that in mind, the probably from the first paragraph mostly disappears and we're sorted! Anyways - it's gone 1.30am, there's work at 9am, and there's lots to do when I get there, so I should stop thinking and start sleeping for the good of everyone. Night all.

16 January 2007

Lars Wirzenius: Random thought: Honya budo

Honya budo is the martial arts skill of visiting a bookstore without buying a book. It is an arcane art, practiced by secret masters in obscure parts of the world for several centuries. During the 20th century, when literacy went up in the western world, and people from every social strata started frequenting shops selling books, this venerable art has begun to rise in popularity. The first level of honya budo is the "Way of the In-Out". It consists of going into a bookstore, looking around to see that they do indeed have many books for sale, inhaling the intoxicating smell of new books, and then immediately leaving the premises. This way, a novice learns to use the door and gains the right to use a plain white bookmark. The second level of honya budo is the "The Feeling of the Touch". This consists of the novice doing the "Way of the In-Out", but before leaving, actually taking a book off a shelf, opening it, caressing it with gentle hands, feeling the texture of the spine, and enjoying the exquisite sensual smoothness of the paper. When the novice can do this, and put the book back on the shelf and leave the store without buying anything, the novice has achieved enlightenment of the second level and becomes an apprentice, and gains the right to use a colored paper bookmark. The third level of honya budo is the "Path of the Randomly Hopping Rabbit". The apprentice enters the book selling establishment, visits every department therein, and looks for a book they have previously shown a special desire to have, which may not have been published. When they can't find it, they then speak to a salesperson, inquiring about the book. When the apprentice can do this and leave the establishment, without making the salesperson annoyed, and without buying anything, they have achieved enlightment of the third level and become an adept, and gain the right to use a leather bookmark. The fourth level of honya budo is the "Stretched Leg of the Giraffe". The adept visits a bookstore with another adept, and spends an afternoon there, wandering from book case to book case, taking out books and discussing them with each other, commenting on their good and bad points, and recommending especially good books to each other. When an adept can recommend a book that the other will happily buy, but they themselves do not buy anything, then they achieve enlightenment of the fourth level and become a master, and gain the right to use a bookmark signed by the author of a book. The fifth level of honya budo is the "Flight of the Serpent". When the master can visit a bookstore, and get given books for free, they have achieved enlightenment of the fifth level and become a supreme grand master, and can use any kind of bookmark they wish.

Sven Mueller

In his post “Ok, now we are getting somewhere! (Re: XML-based configurations)”, Gunnar Wolf writes that he doesn’t regard XML as a suitable standard for configuration files which need some sort of nesting (like, e.g. the apache configuration needs nesting while a config for a simple /usr/bin/sendmail replacement like nullmailer or msmtp won’t need nesting). He seems to like YAML, as you can see in his first post on the subject: Configuration files for humans and for computers. I looked into YAML a bit and to me, it doesn’t seem like a good replacement for XML in config files. Sure, the files look simpler, but I would have a heck of a problem to memorize the syntax. Sure, a colon (:) is intuitive for a direct mapping, but remembering that a pipe (” ”) marks a literal which preserves newline while the default is a scalar which maps newlines to spaces is harder. Folded style (”>”) is even harder to remember. It folds multiple lines with the same indentation into a single line unless there is a differently indented or empty line in between. More important is that I honestly hate syntaxes which rely on indentation. Indentation is dead useful when a nested config or source is read by a human, but it often causes problems when edited by a human, especially when tabs are used. A program could (and most often would) see a difference between “test” and “<8*space>test”, while a human would most probably not see a difference with default tabs. To sum it up: I see the problems with XML, most notably bad program outputs which don’t use indentation (some even put everything on a single line) and the sometimes overwhelming amount of whatever constructs, but YAML doesn’t seem to be the right solution to me neither, especially due to the indentation-used-as-syntax-element problem. What I really would like to see is a syntax that doesn’t use indentation as a syntax element and doesn’t need the name of the opening tag when closing it, but still allows to use it. In other words both of the following constructs (or an equivalent which looks less like XML) should be legal:
<x>
        whatever
</>
<x>
        whatever
</x>
While the following should raise an error:
<x>
        whatever
</y>

Erich Schubert: DBus for music players

I was considering to modify mpd, my favourite music player (using a daemon and multiple frontends, however I usually don't interact much with it anyway except the casual 'skip' button press). I wanted it to support DBus, so I could more easily add e.g. a "love" and a "hate" button, and start collecting data which songs I like. Seaching for "mpd dbus" quickly turned up a proposed freedesktop.org standard by VideoLan people and some discussion by for example the XMMS2 folks. I'm looking forward to that. Right now, my "Multimedia buttons" are bound to some shell scripts that try to find out which media player I'm running and trigger the appropriate command there.

15 January 2007

Meike Reichle: Difficult nicks and a new domain

When I was home for christmas there was also a class reunion. As it is with such occasions I had to give out my email address a number of times. Now, when I chose my domain I decided to use my online nick (alphascorpii) since it was adequately unique to be still available and could easily be associated with me. However, my nick is almost only used in writing and thus mostly copy-pasted or entered using tab-completion. Those who do use it in real life too know how it's spelled (or at least pronounced). At the reunion though I had to spell it out for a few people and the 'ph' and even more the 'ii' often caused confusion. As a result of this, alphascorpii.net can now also be reached via a10i.net! I hope this will simplify things for those who are not familiar with Alpha Scorpii.

Julien Danjou: Kicking out Web spammers with DNSBL

Every project has its story. Every war has its winner, and its casualties. They were 20 millions men, fighting for their freedom. And you'll never know their story. Because during last week, I was looking why my Web server was so heavily loaded. And I discovered that my blog was attacked by spammers trying to post comments. They were stopped by a great plug-in named spamplemousse, which use spam keywords and DNSBL to drop spam comments.
However, this plug-in is written in PHP, like the rest of my blog, so it loads Apache and MySQL in a way that is no more acceptable: the page have still to be rendered for this !@#$ spammers. Consequently, I decided to write a Apache 2.x module which will just drop a 403 Forbidden error page in the spammers' head using DNSBL servers. Here it is, and it is called mod_defensible. I'm using it since 3 days now, and I got some pretty interesting result and less load on my Web server, so c'est tout bon[1].
Notes [1] It's all good

Lucas Nussbaum: ruby & native threading

Stefano Zacchiroli said:
To balance this, according to my first read of Ruby’s threading capability, it’s my impression that not only at most one thread can execute Ruby code at a time (limitation shared by OCaml, due to the non-distributed nature of mark and sweep garbage collectors), but also a thread blocked on a syscall will block all other threads to run. Dumb Ruby threads (but I still hope I’m wrong …)
This is not totally true:

14 January 2007

Uwe Hermann: Upgraded my website to Drupal 5

I have upgraded my website/blog/podcast/photoblog/linkblog/whatever to Drupal 5.0-rc1 today (I'll skip 5.0-rc2 for now and wait for the final release of 5.0 for the next upgrade). The upgrade went quite nice, even though I had to upgrade several modules and port quite a bunch of custom hacks I had on my old (Drupal 4.6) site. I first upgraded to 4.7, then to 5.0 (as is the recommended procedure) on a test-site, and after figuring out how to fix or work-around all the issues that appeared, I upgraded the live site. I password-protected the site during the upgrade, that's why it wasn't available for a while today (and caused some problems on Planet Debian it seems, sorry for that!). New features you might enjoy: If you notice any bugs or problems with the site, please let me know.

David Welton: Stuff To Do updates

After two weeks of being operational, Stuff To Do has been a big success at work, because it lets people keep track of what they're doing with a minimum of hassle. Truth be told, I've never been that wild about "productivity" software, but I'm pretty happy with the system I've created. I really have attempted to make something that stays out of your way as much as possible. That has involved making some choices - for instance, instead of buttons to start or stop time tracking for a given task, Stuff To Do [aside: it would be much faster to write 'STD', but I think that might not be such a good idea in terms of marketing] uses some javascript to see if you've moused over (or blurred, or typed, or done anything, basically) to the window where it lives in the last 15 minutes. This will certainly reduce the accuracy a little bit, and if you get 'in the zone' and don't hit the browser for a while, it won't count your time, but all things considered, this is better than having to hit a stupid button every time you do anything, because you will invariably forget to hit the button, and leave it going overnight, and then have to go back and manually edit everything, and.... yuck. I also have some ideas about how to further improve the javascript in order to make it even easier to track whether you're active or not (with your consent, of course!). In any case, I've fixed up a number of small bugs, and added a few new features: Some other things I'm considering for the near future: In the process, I also happened upon Active Merchant, which is some cool code by the fine folks at jadedpixel.com, which was quite handy for integrating Paypal. Being somewhat of a perfectionist, I found a few things that I wanted to do just slightly differently, and sent in a patch.

Ian Murdock: On the importance of backward compatibility

I’m often asked why I’m so obsessed with backward compatibility and, as a result, why I’ve made the issue such a central part of the LSB over the past year. Yes, it’s hard, particularly in the Linux world, because there are thousands of developers building the components that make up the platform, and it just takes one to break compatibility and make our lives difficult. Even worse, the idea of keeping extraneous stuff around for the long term “just” for the sake of compatibility is anathema to most engineers. Elegance of design is a much higher calling than the pedestrian task of making sure things don’t break. Why is backward compatibility important? Here’s a great example, via Joel Spolsky (note: from 2004):
Raymond Chen is a developer on the Windows team at Microsoft. He’s been there since 1992, and his weblog The Old New Thing is chock-full of detailed technical stories about why certain things are the way they are in Windows, even silly things, which turn out to have very good reasons. The most impressive things to read on Raymond’s weblog are the stories of the incredible efforts the Windows team has made over the years to support backwards compatibility: “Look at the scenario from the customer’s standpoint. You bought programs X, Y and Z. You then upgraded to Windows XP. Your computer now crashes randomly, and program Z doesn’t work at all. You’re going to tell your friends, ‘Don’t upgrade to Windows XP. It crashes randomly, and it’s not compatible with program Z.’ Are you going to debug your system to determine that program X is causing the crashes, and that program Z doesn’t work because it is using undocumented window messages? Of course not. You’re going to return the Windows XP box for a refund. (You bought programs X, Y, and Z some months ago. The 30-day return policy no longer applies to them. The only thing you can return is Windows XP.)” I first heard about this from one of the developers of the hit game SimCity, who told me that there was a critical bug in his application: it used memory right after freeing it, a major no-no that happened to work OK on DOS but would not work under Windows where memory that is freed is likely to be snatched up by another running application right away. The testers on the Windows team were going through various popular applications, testing them to make sure they worked OK, but SimCity kept crashing. They reported this to the Windows developers, who disassembled SimCity, stepped through it in a debugger, found the bug, and added special code that checked if SimCity was running, and if it did, ran the memory allocator in a special mode in which you could still use memory after freeing it. This was not an unusual case. The Windows testing team is huge and one of their most important responsibilities is guaranteeing that everyone can safely upgrade their operating system, no matter what applications they have installed, and those applications will continue to run, even if those applications do bad things or use undocumented functions or rely on buggy behavior that happens to be buggy in Windows n but is no longer buggy in Windows n+1… A lot of developers and engineers don’t agree with this way of working. If the application did something bad, or relied on some undocumented behavior, they think, it should just break when the OS gets upgraded. The developers of the Macintosh OS at Apple have always been in this camp. It’s why so few applications from the early days of the Macintosh still work… To contrast, I’ve got DOS applications that I wrote in 1983 for the very original IBM PC that still run flawlessly, thanks to the Raymond Chen Camp at Microsoft.
I can almost feel the revulsion among my readership right about now. However, next time you’re in Best Buy or CompUSA, look at the shelf of Windows applications, then compare it to the shelf of Mac applications, and perhaps you’ll better understand why it’s important. Beyond the results speaking for themselves, I’ll argue that it takes a better engineer to move a platform forward while at the same time making sure things don’t break. It’s pretty easy to wash your hands of something and declare it to be someone else’s problem.

Thom May: Venice Project invites

As per Ugo, I’ve got some Venice invites kicking around. Conditions are more or less the same - drop thommay [at] gmail dot com a line, and blog about your experiences.
(Bribery may clinch deals in case of competition ;-) )

Stefano Zacchiroli: tickets for debconf7

DebConf7: tickets bought! I did it: yesterday I bought the plane tickets for DebConf7. I'll arrive there (from Milano Malpensa, MPX) on June 14th for leaving on June 24th. This year I decided not to attend the DebCamp since the beginning, partly due to the likelihood of university duties in June (and 3 more days can mean a lot), and partly because I'm convinced that the first days of DebCamp are not that productive/fun. Last year that was the case .... and no, not only for the network issues. Other Italians attending the conference and willing to share the plane trip can have a look at my post on debian-devel-italian@l.d.o for more info. See you in EDI. P.S. do we already have a Wiki page for stating who/is-arriving/when? Or are the information submitted in Pentabarf going to be disclosed anytime before the conference?

Manoj Srivastava: Mail Filtering with CRM114: Part 3

Uphold, maintain, sustain: life in the trenches Now that I have a baseline filter, how do I continue to train it, without putting too much of an effort? There are two separate activities here, firstly selecting the mails to be used in training, and secondly, automating the training and saving to the mail corpus. On going training is essential; Spam mutates, and even ham changes over time, and well trained filters drift. However, if training disrupts normal work-flow, it won't happen; so a minimally intrusive set of tools is critical Selecting mail to train filters There are three broad categories of mails that fit the criteria: 1. Misclassified mail This is where human judgement comes in, to separate the wheat from the chaff. 2. Partially misclassified mail This is mail correctly classified overall, but misclassified by either crm114, or spamassassin, but not both. This is an early warning sign, and is more common than mail that is misclassified, since usually the filter that is wrong is wrong weakly. But this is the point where training should occur, so that the filter does not drift to the point that mails are misclassified. Again, the mlg script catches this. 3. Mail that crm114 is unsure about This is Mail correctly classified, but something that mailreaver is unsure about -- and this category is why mailreaver learns faster than mailtrainer. Spam handling and disposition Spam handling schema. At this point I should say something about how I generally handle mails scored as Spam by the filters. As you can see, the mail handling is simple; depending on the combined score given to the mail by the filters. The handling rules are: So, any mail with score less than 15 is accepted, potentially after grey-listing. The disposition is done according to the following set of rules: In the last 18+months, I have not seen a Ham mail in my realspam folder; chances of Ham being rejected are pretty low. My Spam folder gets a ham message every few months, but these are usually spamassassin misclassifying things; and mlg detects those. I have not seen one of these in the last 6 months. So my realspam canary has done wonders for my peace of mind. With ideally trained filters, spam and realspam folders would be empty. mail list grey I have created a script called mlg ("Mail List Grey") that I run periodically over my mail folder, that picks out mails that either (a) are classified differently by spamassassin and crm114, or (b) are marked as unsure by mailreaver. The script takes these mails and saves them into a grey.mbox folder. I tend to run them over Spam and non-Spam folders in different runs, so that the grey.mbox folder can be renamed to either ham or junk, in the vast majority of the cases. Only for misclassified mails do I have to individually pick the misplaced email and classify it separately from the rest of the emails in that batch. At this point, I should have mail mbox folders called ham and/or junk, which are now ready to be used for training either crm114 or spamassassin or both. Processing these folders is the subject of the next article in this series.

Steve McIntyre: EPIC - we're done!

A group of us have been doing the Every Pub In Cambridge challenge for the last year and a bit. There are various lists of the pubs in the City of Cambridge around the Net in various places, and we based ours on the one at www.cambridgepubs.co.uk. Most Thursdays, Phil, Pod, Jon and I picked 3 or 4 pubs from their handy tube-style map and went and visited. The rules are simple: Today, we visited the last 4 pubs and finished after 14 months. We would have finished in under a year, but the football World Cup and Pod's travel-heavy new job slightly dented our schedule. In all, we visited 108 pubs and couldn't make it to 11 due to them being closed. The point of the exercise? We already knew of several good pubs in Cambridge, but expected there to be plenty of others. Plus, it was something fun to do on Thursday nights and a good excuse to drink more beer... :-) In the end, we each found some good new places to go, and some that we'd never go back to by choice. Our choices for best pub vary, but our respective best 5s basically agree. My own are the Live and Let Live, the Kingston Arms, the County Arms, the Castle Inn and the Free Press. Alongside those, there are plenty more I'd be happy to visit again. After more discussion, our other opinions were unanimous: the worst was the Duke of Argyle (nasty!), and without a doubt the most entertaining was the Cross Keys (with an amazingly funny barman). At some point we may get around to writing up reviews and posting them somewhere, but not right now... *grin*

13 January 2007

Adam Rosi-Kessel: Lawyer Bashing: Bad Politics?

The New York Times reports that the Pentagon has gone on the offensive against the pro bono attorneys representing Guantánamo detainees. Although there is a lot to criticize in U.S. detainee policy, these attacks represent a new low:
The senior Pentagon official in charge of military detainees suspected of terrorism said in an interview this week that he was dismayed that lawyers at many of the nation’s top firms were representing prisoners at Guantánamo Bay, Cuba, and that the firms’ corporate clients should consider ending their business ties. … The same point appeared Friday on the editorial page of The Wall Street Journal, where Robert L. Pollock, a member of the newspaper’s editorial board, cited the list of law firms and quoted an unnamed “senior U.S. official” as saying, “Corporate C.E.O.’s seeing this should ask firms to choose between lucrative retainers and representing terrorists.” In his radio interview, Mr. Stimson said: “I think the news story that you’re really going to start seeing in the next couple of weeks is this: As a result of a FOIA request through a major news organization, somebody asked, ‘Who are the lawyers around this country representing detainees down there?’ and you know what, it’s shocking.” The F.O.I.A. reference was to a Freedom of Information Act request submitted by Monica Crowley, a conservative syndicated talk show host, asking for the names of all the lawyers and law firms representing Guantánamo detainees in federal court cases. Mr. Stimson, who is himself a lawyer, then went on to name more than a dozen of the firms listed on the 14-page report provided to Ms. Crowley, describing them as “the major law firms in this country.” He said, “I think, quite honestly, when corporate C.E.O.’s see that those firms are representing the very terrorists who hit their bottom line back in 2001, those C.E.O.’s are going to make those law firms choose between representing terrorists or representing reputable firms, and I think that is going to have major play in the next few weeks. And we want to watch that play out.”
Perhaps the worst part is the following statement, which as best I can tell has no basis in truth:
When asked in the radio interview who was paying for the legal representation, Mr. Stimson replied: “It’s not clear, is it? Some will maintain that they are doing it out of the goodness of their heart, that they’re doing it pro bono, and I suspect they are; others are receiving moneys from who knows where, and I’d be curious to have them explain that.”
Deval Patrick, the recently-elected governor of Massachusetts, endured similar attacks for his work representing criminal defendants. Fortunately, that strategy backfired and Patrick was elected in a landslide. Although others in the administration have attempted to distance themselves from Stimson’s comments (including the Attorney General), the suggestion that large corporate clients should boycott these attorneys as punishment for representing detainees remains disgusting. The right to counsel is not a political issue. You could hold the unlikely belief that each and every Guantánamo detainee is a confirmed terrorist and still advocate for fair treatment. These attacks represent a new brand of McCarthyism. I hope that this strategy is as unsuccessful nationally as it was in Massachusetts. It strikes me that attacking the partners of some of the largest firms in the country is also bad political strategy. These attorneys are the type of people who may be major campaign donors and well-connected in both parties. I would think twice before attempting to vilify them. They are unlikely to drop their representation (and might be ethically barred from doing so) in light of these statements. If anything, I suspect their determination to ensure the detainees are accorded due process will intensify. Update: abovethelaw.com speculates that this may be an intentional good cop/bad cop strategy.

Holger Levsen: The trip to planet LCA

5 days ago I started my journey to Australia on monday afternoon by going to Hamburg airport. The security at London Heathrow was disgusting and silly as expected, but I won't go into much more detail here, just one thing: the memory of losing my beloved Free Software Foundation pullover last summer at a security checkpoint at LHR made me kept checking my stuff all the time, which somehow fitted very well in the paranoia... But I should also mention the one plus thing in Terminal 4: a nice smoking lounge with power sockets and comfy chairs. Anyway...

The flight entertainment system in the 747 was very cool, with lots of movies and documentaries on demand, so that I didnt bother to read any of the books I packed nor used my laptop batteries completly, though the latter was mostly due to the lack of space in the plane and having worked quite a bit prior to leaving. So I watched four movies to not fall asleep in the (european) night and get into australian timezone, which worked more or less quite well. Not sleeping is a good way to switch timezones, but the side effect is sleepiness, doh!

Out of those four movies the only one really worth mentioning is "Little miss sunshine", a really great movie, very funny and quite insightful as well. See it! On my way back I might even choose to see it again :) I didn't really understand much of the english in "the black dahlia" but it was quite interesting to see how smoking once was ubiquitous as the war on terror is today :)

The flight itself was not as bad and boring as expected, they even thought about the poor smokers and made the whole plane get out in Bankgok, only to enter it again 30min later. Needless to say that it took those 400 people a bit longer...

BTW, and in case the famous lazyweb is reading: Kolkata (formerly called Calcutta) from 10km above really looked like it was swamped, but according to wikipedia this only happens in summer. Any ideas what I saw / why it looks liked this?

When I arrived in Sydney, I was not only welcomed by the sun and summer (yaaaaaay!!), but also by Sylvia, the (main) FOMS organizer, who was so very kind to come to the airport at 7.30 AM to pick me up (yaaay!). More about FOMS in another blog entry very soon to come.

Clint Adams: Choke him real good

A box of strozzapreti hopped off a shelf in Osimo, headed to the sea, and booked passage on a freighter to the Promised Land. When it finally arrived in Staten Island, things were not as it expected. One thing led to another, and it fled to New Jersey, where it wasn't any happier. The thing is, it had unrealistic expectations and thus will probably never be happy. I was in no hurry when I went to rescue it, so I stopped by to visit Ari's mom. She loves WKXW 101.5 FM, so I just sat on the kitchen floor and rocked back and forth while we listened to some stupid call-in show about changing one's name for marriage. My opinion is this: if your last name is something moderately pleasant, such as King, do not change it to something horrifying, like Herschmuckler. If your name is something already horrifying, such as Shimmelshitz, get married as soon as possible to someone with a less offensive name, like Pasayunk. Look at Lou Diamond Phillips; he changed his name from Louis Upchurch, and I unanimously regard that as a good move. Some of the callers felt that for the sake of tradition and bolstering the bonds of marriage, a woman should always take her husband's name. Some callers felt that, realistically speaking, since one is bound to divorce the person to whom one has pledged eternal devotion, probably within the first three years or so, one should retain one's maiden name to save effort later. Many of the observations that the realistic forecast for a marriage is short-term included anecdotes about how finances are generally kept separate these days. Very frequently I see married people loaning their spouses money, or arguing about who's going to pay for something. I find all of this quite bizarre. It's certainly not how married people behaved while I was growing up. I bid Ari's mom good day, grabbed the box of strozzapreti, and escaped New Jersey. I have a few stories about misunderstandings over the tomato content of certain pasta sauces, but I like to save those for later.

12 January 2007

Amaya Rodrigo: The IT Crowd II: The return?

I am ansiouxly waiting for the Second Season of The IT Crowd. The first episode was supposed to have been aired on January 5th, but so far, no news. In this case, no news is not good news (at least for me).

In the meantime, feel free to explore pics from the IT Crowd set, and peek at the shelves, and see what treasures you recognize or find there. Here is a short, but to the point interview with Graham Linehan, its creator, which I want to partly quote:
Is the show an attack on 'geeks'? No way, no how. I know that's how some will take it but in the end it's very much a celebration of geekdom, geekery, whatever. I consider myself a geek and I'm proud of it.
They even want to know what your IT Crowd looks like. So send your pics to Aunt Irma!

Martin F. Krafft: Publishing files to the masses, temporarily

Especially on IRC, I am often faced with the task to share a file with someone. There are pastebins, but they don't help with binary files, quick updates, or sharing directories. Over the past year, I thus developed the pub shell script, which you can obtain from my SVN repository (you can check out the parent directory with several other helpers, or all my non-admin shell scripts). I documented it in the header, so if I excited your interest, have a look there for details. pub requires an SSH-accessible machine with a directory to which you can write, and which is exported via HTTP or FTP (it would be nice to support WebDAV in the future). In my case, that's madduck@scratch.madduck.net:/srv/apache2/stuff.madduck.net/htdocs/scratch, which is available as http://scratch.madduck.net/. Thus, I created ~/.pubrc with the following contents:
TARGETHOST="madduck@scratch"
TARGETDIR="/srv/apache2/stuff.madduck.net/htdocs/scratch"
PUBBASE="http://scratch.madduck.net/"
Here's what I can do now (lines are truncated after 80 characters):
## publish a simple file
$ pub /etc/fstab
http://scratch.madduck.net/__etc__fstab 1446 885c2219df938a059a5f0a13e65e8f9
## ... with optional verification by downloading and comparing md5sums
$ pub --verify /etc/fstab
http://scratch.madduck.net/__etc__fstab 1446 885c2219df938a059a5f0a13e65e8f9
I: successfully uploaded: /etc/fstab
$ HEAD http://scratch.madduck.net/__etc__fstab   head -1
200 OK
## remove the published file
$ pub --delete --verify /etc/fstab
I: successfully deleted: /etc/fstab
$ HEAD http://scratch.madduck.net/__etc__fstab   head -1
403 Forbidden
## bzip2 the file while publishing
$ pub --bzip2 /etc/fstab
http://scratch.madduck.net/__etc__fstab.bz2 501 16e3b533f6588b670c75160dce1f
$ pub --bzip2 --delete /etc/fstab
## same with gzip
$ pub --gzip /etc/fstab
http://scratch.madduck.net/__etc__fstab.gz 423 ea28b1fc537690a0344b74ad2f2d7
$ pub --gzip --delete /etc/fstab
## sometimes I don't want the filename to be guessable:
$ pub --obscure /etc/fstab
http://scratch.madduck.net/__etc__fstab__7eb7d8881a02e47e2906131dec256115 14
$ pub --obscure --delete /etc/fstab
## and this even works with extensions, properly:
$ pub --obscure /etc/a2ps.cfg
http://scratch.madduck.net/__etc__a2ps.9b411100f9d144d090d540c9879dd26b.cfg
$ pub --obscure --delete /etc/a2ps.cfg
## and finally: directories:
$ pub --bzip2 /etc/init.d
http://scratch.madduck.net/__etc__init.d.tar.bz2 59758 1f94314ff9fd472f28172
$ pub --bzip2 --delete /etc/init.d
You'll see how the name is chosen: __etc__fstab. If you're publishing a file from underneath $HOME, the base is truncated:
$ pub ~/debian/misc/security/debsec.zuml
http://scratch.madduck.net/debian__misc__security__debsec.zuml 14366 537b7f7
Of course, all of the above take an arbitrary number of arguments:
$ pub /etc/fstab /does/not/exist /etc/init.d
W: skipping nonexistent file: /does/not/exist
http://scratch.madduck.net/__etc__init.d.tar 337920 c350629b859e1369ed29a98c
http://scratch.madduck.net/__etc__fstab 1446 885c2219df938a059a5f0a13e65e8f9
$ pub -d /etc/fstab /does/not/exist /etc/init.d
W: skipping nonexistent file: /does/not/exist
Over time, the scratch space will fill up. Thus, I am using tmpreaper to delete files which have not been accessed in 30 days. The script in use, as well as the files that givern the way the HTTP server presents the scratch space, are available in this SVN repository. I hope this tool will be useful to some, and I am looking forward to patches and suggestions! NP: No-Man / Returning Jesus

Next.

Previous.