Search Results: "nate"

30 March 2008

Benjamin Mako Hill: The Most Photographed Bus Company in America

I suspect that Lamers Bus Lines, Inc. (golamers.com) may be the most disproportionately photographed bus line in America by young Internet-savvy photographers. These photographs, and many more, are taken from Flickr: When it comes to the most insulting bus company, however, the unfortunate typography that rendered the Pioneer Valley Transit Authority buses dangerously close to "puta" may give Lamers a run for their money in Spanish speaking communities.

Cord Beermann: Geocaching with the n810

Today i tried the first time to do GeoCaching with my Nokia N810 running the Maemo (which is a Debian-based Distribution). I already own a Garmin Geko 201 with which i found 100+ Caches, so this is my reference.

The GPS-Receiver of the N810 is better than the one in the Geko (at least since i use the fixed gpsd, which normally shouldn't do something on the performance, but in my case... it made me feel better), so fixes come faster, and more accurate than on the Geko. (from hearsay the SirfIII-Chip is even better)

I run Maemo Mapper on the N810, a free (as in speech) Software written to do things better than GpsDrive at least on the Nokia Internet Tablets.

I wrote some programs to be the glue between Geocaching-Websites and GPSdrive (which depends on MySQL) and i modifed those to put the information into SQLite, which is the Database used by Maemo Mapper.
If i pump all my waypoints in such a file (which are currently 94607) Maemo Mapper gets slow. so slow that Maemo Mapper becomes useless.

On the Garmin-GPS-Receiver, i can have only 500 Waypoints, but i have a 'goto'-function, so i store my destination coordinates and say 'Goto' and the thing provides me an arrow which points to my destination and shows the distance (it doesn't know about ways so it points the direction directly, but that is usually fine as GeoCachers often are so abroad that no one has maps about the area.).

In Maemo Mapper i couldn't find such a function. I can say 'Goto Coordinates' and then it centers the map to there, but there isn't a sign and no line or arrow which direction i have to turn to. This is a problem (or something for the wishlist.)

So from GeoCachers view (and those people who want to navigate for other reasons) free Navigation-Software for Linux is an area where more work is needed.

29 March 2008

Adam Rosi-Kessel: Free Books

Via Lifehacker, legal cost-free books under copyright from Wowio. This is a great idea, and I give it even odds for being the future of books. (Or at least, part of books’ future).
What is WOWIO?
WOWIO is a new kind of online bookstore that enables readers to download ebooks for free, using commercial sponsorships to compensate authors and publishers. Readers get free ebooks. Sponsors get a powerful new channel to communicate their message to precisely the people they want to reach. Publishers get a new means of distributing their books, expanding their readership, and monetizing their intellectual property.

Does WOWIO use any kind of digital rights management (DRM)?
Since anyone can defeat the most “sophisticated” DRM with the print screen button, we believe that technology-based DRM is essentially a fraud. Our approach takes the market incentive out of misbehaving, rewards people for doing the right thing, and tries to stay out of the way of honest users. To help keep everyone honest, however, readers must authenticate their identity and agree to a licensing agreement when they set up their account. Then, each ebook is serialized with the reader’s authenticated name and a unique serial number, as well as other less visible markers. WOWIO will immediately terminate the account of anyone caught illegally distributing ebooks, and will prosecute serious offenders.
Technorati Tags: , , , ,

Jonathan McDowell: DG834G + OpenWRT + IPv6 love

As I type this my internet connection is being once again powered by my DG834G. It's also very dark, but that's because I'm observing Earthhour (I don't think it'll change the world, but I don't mind sitting in the dark that much and there's only me in the house). After my last OpenWRT/AR7 experiment I thought I'd bricked the Netgear. I ended up using my BT Home Hub as a stop gap solution and wondered how to proceed. I bought a Conexant Accessrunner USB modem and tried it with the WGT634U. This proved more stable than the USB Speedtouch, but still resulted in a couple of line drops a day at least. AR7 still seemed the way forward. I picked up a D-Link DSL-502T off eBay. This has a USB port, an ethernet port and no wireless. However it's AR7 based and has 4MB of flash and 16MB of RAM; the same as the Netgear. It also has a serial header already soldered on, so it was easy to connect my level shifter up and have a play. I built up a recent OpenWRT and managed to install it successfully and then hook it up to my ADSL. All seemed quite stable and I was feeling pretty happy. In parallel with this I'd picked up a cheap D-Link G604T off eBay - this has a 4 port switch and wireless and is basically the same hardware as the Netgear. It was listed as faulty, but I was hoping to be able to use it for parts or at the very least for testing. As it turned out it worked perfectly; didn't need to reflash it or anything to get it going. I put the image I had working on the 502T on it and hooked it up. Again, everything seemed stable. I managed to get the wireless detected ok, but the driver doesn't seem to support AP mode that well - there are big warnings in dmesg when you enable it. It's an acx111 chipset and unfortunately there doesn't seem to be a lot of upstream activity - there's some work on a version using the in kernel 802.11 stack, but it doesn't currently compile with 2.6.24 AFAICT. Anyway. I had working ADSL with OpenWRT, albeit without wireless (having the switch was useful though, as the router lives beside the media box but also needs to be connected to the switch upstairs in the study). I'd chased Enta a week ago about IPv6 but still not heard anything, so I gave them another prod. This time I got a speedy response indicated my account was now enabled for IPv6 and providing me with a /64. I added +ipv6 to /etc/ppp/options and restarted PPP and it all just started working. In addition I've configured up radvd on the box so everything on the ethernet autoconfigs. Flush with the success of all this I thought I'd try my Netgear again and see if it was really dead or if I could get the original firmware back on it. For some reason that worked first time and the router booted fine. So I thought I'd try OpenWRT again, given that I had an image I knew worked fine on another AR7 router - if it didn't work on the Netgear I'd know there was some sort of hardware difference or problem rather than a build issue. And it worked. My DG834G is now running OpenWRT SVN r10685, doing IPv6 and generally everything I need except for wireless. I've updated my DG834G page a little bit, including a link to the OpenWRT config I'm using. Hopefully the wireless will get there; certainly most chipsets seem to be getting much improved upstream support these days and I'm sure it must be possible for the ACX guys to make use of the in kernel stack to reduce their work.

Jonathan McDowell: Archos 705 media player

El Reg reviewed the Archos 705 yesterday. They only gave it 50%, which I think is a little harsh. I bought one of these back in November when they first came out, as something to help easy my daily commute by train. I have to say I don't regret the purchase; while there are various niggles that annoy me it basically does what I want. My main drive was the size of the screen. There are plenty of options available if you want in the region of 4", but I wanted something bigger that could still be shoved in a bag without any hassle. The 705's 7" screen is great. I can sit it on the tray table on the train and it gives a clear viewable image that doesn't leave me squinting trying to see it. The second concern was the battery life. At 7" you start to get into the UMPC area. However there didn't seem to be anything around that both offered enough battery life and had the grunt to decode DivX. I need a guaranteed 2hrs (ideally a bit longer) so I can watch something without being interrupted. I've certainly had over 3hrs on the Archos and various reviews claim it'll do 5hr for video without problems. Archos call the 705 a DVR. I've no idea why; I certainly wouldn't consider it one. I have the DVR station, but I've only used it to connect the Archos up to a hotel room TV and never for actually recording anything. There's no tuner (neither analog nor digital), so you need a Freeview/cable/satellite or similar box to provide a signal. Plus it seems pointless to convert a digital TV signal to analog and then for the Archos to have to re-encode it. Much more sane to record TV on your PVR and pull the file off that and onto the 705. Except there you hit a bit of a problem. By default the Archos supports DivX and WMV. To get MPEG2 or H.264 support, or indeed AC3 audio, you need to pay extra for a license that will enable the appropriate codec. This is annoying and I've ended up just using mencoder to convert Freeview records to an Archos friendly format rather than shelling out more for the codecs. Archos do seem to have dropped the ball here. The MPEG2 license fee seems to be $2.50 per device. The TI licensing seems to be about $2 for MPEG2 + AC3. Archos sell the plugin for €19.99. I doubt AC3 licensing is over $15, which rules out Archos merely keeping the cost down for customers by allowing them to pick and chose which codecs they want to avoid paying license fees. The 705 also comes with a web browser. Which, of course, you have to pay for. I ended up getting this thrown in with my 705 + DVR station bundle. It's powered by Opera and reasonable enough. The only time I've really made use of it is while staying in a hotel; it was quite nifty to have the 705 hooked up to the TV and be able to lie on the bed with the keyboard remote control and lookup film times or interesting places to go. Internet access is provided by wifi; if it had bluetooth as well then I might make use of it on the train, but as it is it's not really something I use much. As I said at the start I'm still happy with my purchase. It's not a cheap item, but it has the screen size and battery life I wanted and there wasn't a lot else out that offered both. Having to pay for codecs is a bad move on Archos' part, but I've avoided doing so by re-encoding. If you want something that's a decent media player of this size then the 705 is definitely worth considering; if you're not sure about the size aspect you may be better off with a 605 (the 4.3" screen version) or even something from Cowon (who unfortunately don't seem to have anything in the 7" range). Finally, if you already own a generation 5 Archos device, you might be interested to know that shell access has been obtained. The device is pretty locked down (signed kernel modules, no /dev/mem, signed root cramfs filesystem), but there's an arcwelder exploit to get an ssh login over wifi and an Archos Hacking forum on Archosfans.

28 March 2008

John Goerzen: A Realistic View of the Economy

Yesterday, I read an article on CNN called From $70K to food bank.

It describes a woman who was laid off in February from a job paying $70,000 a year. "Weeks later", with bills "piling up and in need of food for her family", she went to a food bank.

The article proceeds to talk about the subprime lending situation at great length, which is largely irrelevant to this person's situation.

Then we learn she applied for food stamps, but was denied. There's a quote from this person about how frustrating that was, and general "tugging at the heartstrings" trying to make us feel sorry for this woman with two children whose mother moved in to help make the house payment. It seems to me that this is a correct decision; someone that can pay a $2500 mortgage each month ought to move into an apartment before trying to leech food or money from social service agencies.

And that's where this story gets interesting.

She has an interest-only mortgage, and is managing to pay the $2500 bill each month.

If you're not familiar with an interest-only mortgage, here's how it works. The bank loans you money to buy your house -- say, $200,000. This is a loan, and you have to pay interest on it each month, just like a regular mortgage. But with an interest-only mortgage, you never pay off the loan. You could be making monthly payments for 30 years and still owe $200,000. In general, the only ways to "pay off" this kind of loan is to sell your house, or get a conventional mortgage that pays off the interest-only loan.

Interest-only mortgages were largely banned after the Great Depression. Prior to that time, they were how mortgages normally worked. But there are several problems with them. One is that you have to pay on them forever, even after you retire. Another is that you can't move unless you can sell your house for at least as much as the bank financed, even if you've lived there for 20 years. In times of declining housing prices and unemployment, that really stinks. People often default on the loans, and from a bank's perspective, that really stinks, too.

Interest-only mortgages are usually used by banks financing construction (we had one for a few months when we renovated our farmhouse) or other short-term projects such as professional real-estate investors that buy old houses and fix them up to sell at a profit. Except for these things, in general, they should never be used for a primary house. It's not in the interest of the bank or the homeowner.

But since you never pay off the principal, the monthly payments can be lower. It seems likely that this woman took a knowing gamble, buying a home more expensive than she could afford, and somehow found a bank willing to finance this. Problem is, both she and the bank took a knowing risk. If she ever ran into financial difficulties, she'd have to sell the house quick. But now the house is probably worth less than the value of the mortgage, so selling it won't remove the loan -- BUT it would let her pay off a large part of the principal, reducing her monthly payments and giving her some wiggle-room to buy food and pay off the rest of it.

It seems to me that she is unwilling to own up to the calculated risk she took, and wants society to help bail her out. Don't get me wrong; I think we need to help people that run into hard times. We need to help make sure they still have the tools they need to find a job and a place to stay. But bailing out people that take huge financial risks shouldn't be the job of society. Let's help them land softly, but not be enablers keeping them in a home they never could -- and still can't -- afford. Fortunately, I don't think anyone in government (or running for president) is suggesting we should.

Not only that, but her bank shouldn't have ever made that loan. Banks should be held accountable to not sell unwise products to people that rely on them for their primary residences.

Here's another interesting point: in just a few weeks, she had burned through her entire savings.

This, unfortunately, is a quite typical situation for many Americans. My financial planner, and I think most experts, suggest that everyone ought to have 6 months of income in liquid non-retirement assets (savings accounts, investments, etc.) in case something like a layoff happens. Very few Americans have this.

And when it comes down to it, isn't that part of the problem? The economy thrives on consumer spending. Or, put more starkly, overconsumption. If people start saving like they ought to, and stop feeling like they're outcasts just for not keeping up with the Joneses and buying every last gadget or the biggest house, we'd all be in better shape -- but the economy wouldn't have grown as much.

The growth it would have seen, had we all been more responsible, would have been a lot more durable and recession-proof, I think.

27 March 2008

David Pashley: Installing java non-interactively

Installing the Sun Java packages on Debian or Ubuntu require to you accept Sun's license before you can install them. This means that it's not easy to install non-interactively, for example when using pbuilder. Fortunately the license uses debconf to check to see if you have already accepted the license. This means you can use debconf to accept the license before you install the packages. Create a file containing the following lines:
sun-java5-jdk shared/accepted-sun-dlj-v1-1 select true
sun-java5-jre shared/accepted-sun-dlj-v1-1 select true
sun-java6-jdk shared/accepted-sun-dlj-v1-1 select true
sun-java6-jre shared/accepted-sun-dlj-v1-1 select true
Then run /usr/bin/debconf-set-selections <file> and when you install the java packages, you should find it doesn't prompt for the license any more.
Read Comments (0)

26 March 2008

Joey Hess: my anti-platform: followup

A year ago I posted an anti-platform with some things I wanted to work on over the next year or three. This is a followup to see what, if anything, has been accomplished. constantly usable testing CUT generated some discussion in the project, but I've done nothing toward it myself. The only real progress in this area over the last year has been increasing improvements in the testing security team, and the release team, both of which I'm not currently active in. deprecating www.debian.org This continues to happen organically, for example, Debian Weekly News stopped and http://wiki.debian.org/DeveloperNews took its place. Aside from pointing out that this is happening, I haven't done much to push it. double the archive sync frequency again Sadly, this has not happened yet. automated whole system testing HP donated a test machine, which I set up to run emulated tests of installations of i386, amd64, s390, mips, and mipsel. (Arm and armel should be added soon.) I don't always manage to keep all the tests working at all times by myself, but they have been valuable. developer (virtual) machines My test machine spits out disk images for 5 architectures that have debian pre-installed on them, but due to hosting issues I have not been able to share those images with others yet. find the next nslu2 I was pretty sure this would be OpenMoko's Neo phone, but I have only briefly had access to one, and it's not clear it will be easy enough to get the hardware to make it worthwhile to target it. Meanwhile, tbm has found a more nslu2-like next nslu2, the QNAP Turbostation NAS device, and there's work underway to fully support it from d-i onwards. Others have also worked on running Debian on various related AP hardware, including the ASUS WL-500g and Linksys WRTSL54GS, using OpenWRT to boot Debian. There's instructions and downloads on a wiki page. It would be good to get this fully supported without the hacks.

Nico Golde: streaming from your fileserver using mpd and icecast

My mobile music player is often missing the files I want to hear right now if I'm under way because my music collection is too big to fit on it.
Long time ago I used gnump3d which seems to be unmaintained in Debian for quite some time and then I often listened to some live streams, network connections are available nearly everywhere.
But I always wanted my own live stream with music I want to hear. There are several solutions out there for this task but they all require the creation of a playlist before the streaming starts.

Fortunately mpd provides the possibility to define different output targets and also one for streaming to a shoutcast or compatible server like icecast.

So after apt-get install mpd icecast2 (on a Debian box) you have to edit /etc/mpd.conf
There is not much to do, be sure to set music_directory to the place your music is located and the configure the output part.
Add the following to your mpd.conf and adapt some values:
  1. audio_output {
  2.         type "shout"
  3.         name "foobar stream"
  4.         port "8000"
  5.         host "localhost"
  6.         format  "44100:16:2"
  7.         mount "/stream.ogg"
  8.         password "somepass"
  9.         quality "2"
  10.         user "source"
  11. }

The type defines that this output will be streamed to a shoutcast target. The name will be displayed by the client you use to play your stream. 8000 is the port icecast2 will listen on host "localhost" (in this example the icecast2 server is on the same host). format specifies the audio format of the stream, the first number is the sample rate in Hz, the second number is the number of bits per sample and the last number defines the number of channels (2 is stereo here). Those values should work for most of you. mount specifies the path under which the stream is available later from the server root, in this example http://localhost:8000/stream.ogg.
quality defines the ogg encoding "quality". You can also specify the bitrate instead of it. The user and password values are used to authenticate mpd at the source input for icecast2.

There seems to be a bug in the 0.13 release (which is also in Debian) of mpd that prevents this from working. I don't know the details about this bug but adding
  1. audio_output {
  2.         type "alsa"
  3.         name "fake out"
  4.         driver "null"
  5. }
fixes it.

Make sure to set START_MPD=true in /etc/default/mpd to enable mpd.
That's all that needs to be done for mpd.

The next step is to edit /etc/icecast2/icecast.xml.
The default configuration nearly ready to use. Configure the authentication part:
  1. <authentication>
  2.       <source-password>somepass</source-password>
  3.       <admin-user>admin</admin-user>
  4.       <admin-password>someadminpass</admin-password>
  5. </authentication>

The source password is the one we specified in the mpd configuration. This is needed to authenticate mpd with icecast. source is the default user name icecast uses here. Additionally we define an admin-user that can be used to add users to icecast later because we want to protect the stream by a username and a password.
Then set
  1. <hostname>you.somehost.org</hostname>
.
This hostname is used to generate URLs in icecast that a user receives.

Because we want a very simple authentication for the stream we need to add some options for the mount (/stream.ogg):
  1. <mount>
  2.     <mount-name>/stream.ogg</mount-name>
  3.  
  4.     <max-listeners>1</max-listeners>
  5.     <authentication type="htpasswd">
  6.             <option name="filename" value="/etc/icecast2/htpasswd"/>
  7.             <option name="allow_duplicate_users" value="0"/>
  8.     </authentication>
  9.     <on-connect>/home/icecast/bin/stream-start</on-connect>
  10.     <on-disconnect>/home/icecast/bin/stream-stop</on-disconnect>
  11. </mount>

I think the xml tags are pretty much self-explanatory. Keep in mind to set the filename to a location the icecast daemon has access to, that's why I used /etc/icecast2. Then you can add users with htpasswd or using the web interface on port 8000 and add a user there.

The last thing to do is to adjust the <alias source="/" dest="/status.xsl"/> setting. Change status.xsl to auth.xsl people need to authenticate if they connect to the web interface before seeing the stream information.

Now you can login via ssh on your home server and use your favorite mpd client to configure playlists on the fly, I use ncmpc for this. Of course the authentication is not secure, people who sniff your traffic can see your login data.
One thing to keep in mind is to restart mpd after restarting icecast otherwise mpd will hang and not continue to stream, this seems to be a bug.

After routing through your NAT, you should be able to play your stream via http://you.somehost.org:8000/stream.ogg.

25 March 2008

Ond&#345;ej &#268;ert&iacute;k: SymPy accepts Google Summer of Code applications

SymPy is a pure Python library for symbolic mathematics. Last year SymPy had 5 excellent students and this year we are accepting students again.
Why should you apply? And why to SymPy?

Well, let me give you some reasons:



Read also the current status and motivation of SymPy and it's relation to Sage. If you want to apply, all the necessary information is on our wiki page.

Nevertheless, if you decide SymPy is not for you, but still you'd like to do GSoC project in a similar area, there are other good options too - one is SciPy/NumPy, the other is Sage. Unfortunately Sage was not accepted as a mentorship organization, but it has several good projects too, some of which you can do for example under the umbrella of the Python Software Foundation.

One of them is improving the Sage notebook. If you've never seen that - download Sage, start it (./sage), type "notebook()" and a nice Mathematica like notebook will popup in the browser. It allows collaborative editing ala Google Docs and many other things. If you'd like to work on it, reply to the email on sage-devel.

Martin F. Krafft: Looking for an environmental charity

I am looking for a charity to receive regular donations. I would like to support the environment and wildlife, rather than people directly, and the World Wildlife Fund immediately comes to mind. While I ve been supporting the fund s work for two years now, I feel a bit uneasy about its size. It seems plausible that they can leverage synergies much more effectively, but large organisations also burn through heaps of money just to be able to do what they want to do. In addition, I feel the whole organisation is too professional and anonymous. The same applies to Greenpeace. With none of this do I intend to discredit the work of the WWF or Greenpeace! They re just not what I am looking for. I have previously donated to a charity in China, but the troubles and efforts involved with this were too much. And while China certainly needs a lot of help and support in rethinking their environmental policies, it s not like central Europe or other parts of the world couldn t put money to good use in this sector as well. So what I seek for is a small charity who operates in a niche and to whom regular donations, even if small, make a difference. EuroNatur looks promising. I d love to have more choice though. If you know of any, please let me know. NP: Barclay James Harvest: Eyes of the Universe Update: Micah Anderson pointed me to the Rainforest Action Network and Ron Lee introduced me to the Sea Shepherd Conservation Society, started by Greenpeace co-founder Paul Watson, who resigned from the Greenpeace Foundation (in 1977) because of disagreements with the emerging bureaucratic structure of the organization . I have contacted both and asked for their annual reports and whether they have experience with tax-deductible donations from Central Europe. Update: Karen O Sullivan suggests the Jane Goodall Institute and the International Fund for Animal Welfare. I ve written to them as well.

Wouter Verhelst: Dear lazyweb,

In an effort to improve the performance of nbd-server, I wrote a patch to make it use some common sendfile() implementations (specifically, Linux- and FreeBSD-style sendfile calls). Unfortunately, however, when I test the Linux version (I haven't done tests with the FreeBSD version yet), the server outputs some garbage in fron of the actual data that it needs to send; as a result, obviously the client can't make heads or tails of it, and the connection is dropped. However, when I run it inside gdb, everything is fine. When I call strace over the server, I don't see any obvious errors. I tried using the DODBG version of the server (see the code for details), but that didn't help me. At this point, I'm pretty clueless as to what is going on. If anyone were to give me some hints or pointers, I would be eternally grateful.

23 March 2008

Julien Blache: TomTom: Internet standards do not apply

In June last year, I bought a TomTom GPS device. Their use of Linux on the device was a clear plus in their favour, but it was only that, given that overall they’re the best devices available. Unfortunately, the TomTom HOME software that is needed to manage the device is not as good as the device itself. An account on their website is needed for updates and the online shop, and as I usually do, I used an email address in the form jb+something@jblache.org. That’s a trick most of us use to trace back the origin of spam, usually revealing that some company sold its customer database. I’ve been doing that for years. I was quite happy that the website did not reject the address as being invalid; that’s something that happens everytime the random web developer maintaining the site decides to start “validating” email addresses, for some value of email addresses. For the following 8 months I’ve been using this address as the account login (don’t really have the choice, anyway) with the TomTom HOME software. Last month, the v2 of the said software was finally made available for Mac OS X. Where the v1 used to accept my email address, the v2 would now reject it. You guessed it, Joe Random developer decided to start validating email addresses in TomTom HOME. I reported the regression (and here, something must be said about their infamous support website), with pointers to the relevant RFCs. In the following email ping-pong, they managed to: Last but not least, their last reply was: “we found that the standard does not apply to us. Please change your email address for a valid one.” Now, I’m left wondering: does the GPS standard apply to TomTom devices? I truly hope so.

Christian Perrier: [unrant] About uncoordinated debconf templates introduction

This morning, I ranted about uncoordinated introduction of debconf templates. It happens that part of my rant went on citadel maintainers, at least one of which (Michael Meskes) being someone I have good respect for his work in Debian...and who's generally translators-aware. He bringed me an interesting argument to explain why the maintenance team did not call for translations and templates review before uploading the new package: NEW processing. They weren't apparently so sure about the package being accepted and, thus, did not want to add extra work for nothing. So, they first wanted to get the package in the archive before working on other stuff. This is indeed a valid objection to my rant and I very happily post apologies for this rant as Michael promised me he would call for review/translations just now. I still think that new packages with debconf templates should ask for a review in debian-l10n-english, though..:-)

Neil Williams: Porting a C package from libgnomevfs to GIO and GVfs.

(Note: this is a long post)
Package: deb-gview
Use of GnomeVFS: "Individual package files or packages referenced in a changes file can be viewed from local or remote filesystems using GNOME VFS."
Main changes: src/dvarchive.c but also src/main.c.
Port Status: Complete and tested.
Prerequisites
Do not run any code before completing this step
You must ensure that gvfs, gvfs-bin and gvfs-backends are all installed and operational before running any of your modified code. Thereby hangs another tale. The application itself probably needs to depend on both gvfs and gvfs-backends. gvfs-bin provides test binaries like gvfs-info.
You need to ensure that the following command operates correctly:
$ gvfs-info http://www.google.com
display name: /
edit name: /
type: unknown
size: 0
attributes:
standard::display-name: /
standard::edit-name: /
standard::content-type: text/html
id::filesystem: type='http',uri='http://www.google.com',mount_prefix='/'

Note that this is run as the normal user, not under sudo and not as root. - that just complicates things. If you find that this works with sudo but not without, read the bug report against gvfsd.
If you get this output:
$ gvfs-info http://www.google.com
Error getting info: The specified location is not supported

read the bug report, find and kill the borked gvfsd process and ensure that gvfs-backends is installed before attempting any other gvfs* commands (including via your modified source code).
Starting
  1. Online copy of the GIO docs. online copies of the GVfs docs. I mainly use Anjuta where both sets of the docs are available via libglib2.0-doc >= 2.16.1 and devhelp or via your localhost using dwww.

  2. #include <gio/gio.h> to replace #include <libgnomevfs/gnome-vfs.h>.
    (May sound obvious now but examples are not that frequent in the GIO docs as part of libglib2.0-0.)

  3. The GIO docs do give some info on porting variables:

    • GnomeVFSHandle * vfshandle; became GFile * ghandle; GInputStream * stream; in deb-gview

    • Extra variables needed for deb-gview: GVfs * vfs; GError * result; GFile * gfile; GFileInfo * ginfo;. GError itself is not new but it can catch you out in the port because so many GIO/GVfs functions can use it and you find yourself using g_clear_error(&error) a lot or GLib will complain about trying to replace data in a GError.


  4. Separate path and URI handling - GIO and GVfs have separate filename/path handling for paths on a local filesystem and paths on remote filesystems and the two cannot be mixed. This was a big source of bugs during the port (it may be a UTF-8 issue) and in the end I went for a gboolean flag in the context that this particular viewer was handling a file from a remote filesystem (e.g. http://localhost/incoming/deb-gview_0.2.0_amd64.changes, http://ftp.debian.org/debian/pool/main/e/emdebian-tools/emdebian-rootfs_0.9.1_all.deb or http://incoming.debian.org/foo_version.changes) and not from a local path (e.g. /opt/debian/deb-gview/deb-gview_0.2.0_amd64.changes or ../../debian/deb-gview/deb-gview_0.2.0_amd64.deb). Personally, I found g_file_is_native to be unsuitable for this purpose and as I had a "user-entered" path available, I simply use if ((g_str_has_prefix (path, "..")) (g_str_has_prefix (path, "/"))) but YMMV, depending on how you obtain the path itself.
    Keep track of the type of input file when handling GFile - g_file_get_path will fail if passed a GFile that needs g_file_get_uri and vice-versa. These failures output messages to the console so they are relatively easy to track but not only will the call fail but the GFile itself is likely to get corrupted, leading to other bugs and messages to the console. g_vfs_get_file_for_path(vfs, path) and g_vfs_get_file_for_uri(vfs, path) (which obtain the GFile from GVfs in the first place) also fail if passed the wrong type of path.
    In some situations, g_file_get_parse_name can be used to get a "normal" char* representation of the path to the GFile but I was only able to use this in specific circumstances and only when the path and URI handling flag was implemented.
    This all complicates the port because gnome_vfs_make_uri_from_input did not have this separation issue.

  5. Checking if a file exists - if (!g_file_query_exists (gfile, NULL)) may seem easy but unless issues with the URI and path are handled cleanly, this simple check will fail even though the file exists. The problem arises because GFile appears to mangle a URI with a path function and vice-versa. The GFile ends up with an invalid path and hence there is no valid file to check so the query fails - but without indicating that it's actually an internal error in GFile rather than a valid path that simply does not exist.

  6. Reading files in one go - vfsresult = gnome_vfs_read_entire_file (vfstext, &changes_size, &contents); gets replaced with g_file_load_contents (cfile, NULL, &contents, &changes_size, NULL, &result); (note the order swap between the size and the buffer to use). Once read, the buffer can be handled as before. This is one of the easier changes in the port, once the above issues are all cleared up. On the other hand, GIO and GVfs do appear to handle relative paths more easily than GnomeVFS.

  7. Checking VFS is active -
    vfs = g_vfs_get_default ();
    if (g_vfs_is_active(vfs))

  8. Reading files as a stream - result = gnome_vfs_read (vfshandle, readbuffer, skip, &bytesread); becomes bytesread = g_input_stream_read (stream, readbuffer, skip, NULL, &result);. Fairly straightforward as long as you use:
    if (result)  
    g_warning("Error: %s", result->message);
    g_clear_error (&result);
    (or something equivalent to get the error message to the user), every time you use &result.
    vfs_uri = gnome_vfs_uri_new (gnome_vfs_make_uri_from_shell_arg (filename)); becomes filestream = g_file_read (deb->ghandle, NULL, &result); (there's that &result again).

  9. Checking the stream remains open.
    stream = (GInputStream*)filestream;
    if (g_input_stream_is_closed (stream))
    return FALSE;

  10. Seeking inside the stream - YMMV but seek never appeared to work well for me in VFS so I had to read into a dump instead.
    gpointer dump; 	        
    dump = g_new0(gchar, seek);
    result = gnome_vfs_read (deb->vfshandle, dump, seek, &bytesread);
    g_free (dump);

    In GIO, seek is much easier: g_input_stream_skip (stream, seek, NULL, &result); - just handle that &result again. :-)

  11. Closing the stream - gnome_vfs_close (vfshandle); becomes g_input_stream_close (stream, NULL, &result);.

  12. Getting information on files - if ((vfsinfo->type != GNOME_VFS_FILE_TYPE_REGULAR) (vfsinfo->size == 0)) becomes
    ginfo = g_file_query_info (ghandle, G_FILE_ATTRIBUTE_STANDARD_SIZE, G_FILE_QUERY_INFO_NONE, NULL, &result);
    if (0 == g_file_info_get_attribute_uint64 (ginfo, G_FILE_ATTRIBUTE_STANDARD_SIZE))

    dv_show_error (DV_ERR_NO_FILE, parent);
    return;

    (dv_show_error is a user-facing error report func) and, yes, there is a g_clear_error(&result); later.


Summary
This took me quite a bit of time and the bug in gvfsd was a significant hindrance so ensure that you test with gvfs-info before thinking there is a bug in your code. (Also remember that if you are reading files from http://incoming.debian.org/ then those files will disappear once each day when the cron job moves them into the pool. :-) ) I recommend developing and testing against http://localhost/ during the port.
The GIO docs are relatively thin (especially for GVfs) and that is not just because GIO is still new. Starting a new application using GIO and having a working GIO/GVfs setup in place already would be much easier so new applications will work. As ever, the problems really show up when trying to port an application that has already worked around the various GnomeVFS bugs and now has to both remove those workarounds and implement one or two other changes for GIO.
Ensure your application has Depends: gvfs-backends - until the bug in gvfsd is fixed, it would be unwise to put gvfs-backends in Recommends: because that will almost inevitably result in any user without Recommends: enabled passing a call to GVfs at least once without an available backend, resulting in a broken gvfsd process and a completely broken application until the user either kills the process or logs out and logs back in. Even identifying that issue in a bug report is not straightforward - hopefully the bug report and this post will help. (Yes, depending on how you configure the ported application, it is entirely possible for this broken gvfsd process to break all file operations in your application, even local ones.) Unfortunately, there is no call (currently) to take down GVfs - you can only test to see if it is already active and that check is not sufficiently intelligent to detect the broken gvfsd process.
Subjectively, GIO does appear smoother than GnomeVFS and maybe faster. Now I need to get on and try to port other applications to GIO.....

Christian Perrier: [rant] Uncoordinated debconf templates introduction

That time of the release process now came where I will rant about uncoordinated introduction of debconf templates. Given the release timeframe, I started the very same work I did for etch: try to get as many debconf translations as possible in place. Of course, in the same time, these efforts are balanced by maintainers of packages who introduced new debconf templates without coordinating with debian-i18n for their localization and without sending calls for translations first. The answer is easy: use podebconf-report-po! This nice utility comes along with po-debconf and should indeed be marked Essential..:-) The bad guys of the day: citadel and ttf-mathematica4.1. Both combined add 18 strings without any effort to get translatons in. The bad guys of last days: bgoffice-dict-download, movabletype-opensource. As expected, most languages statistics will go down by tomorrow despite the simultaneous efforts of maintainers and /me to complete most other packages. Please, fellow Debian developers: it is now time to stop changing the bloody debconf templates.

21 March 2008

Gintautas Miliauskas: Launchpad translations revisited

I am trying to add some order to the mess that is the Launchpad translation repository. Problem is, strings translated just once through Launchpad stick around forever, even if you change them in upstream later. In effect, a lot of translation bugfixes were not reaching Ubuntu users. I thought I had that covered. Unfortunately it's not the case. I just noticed that in the Launchpad package list sorting by changed strings only sorts the first page! Initially I had noticed random package names and mistakenly thought that the whole package list was sorted. The whole list (~1500 packages, shown in 75 package chunks) is sorted by "importance", so it's basically random. Good luck finding modified packages in that haystack. Seeking computer-literate monkeys.
Earn up to five bananas per hour!
Must be able to use mouse. Unless... how about increasing the batch size? Turns out that in Launchpad the batch size is not capped, so by changing a URL parameter you can just set it to a high number, wait a few short moments, and get the complete list of packages. Sort that by changed strings and we're done, right? We're done finding the local translations, but not fixing (reverting) them. The new, larger list reveals that there are more than a few of those with quite more than a few strings that should in 99% of the cases be reverted to packaged versions. Here's how that works: Monkey operator instruction manual
  1. Click on 'Packaged' radio button for all 10 entries on page (no batch size modifications allowed here...)
  2. Click 'save'
  3. Repeat until the page says 'No more translations'
  4. Done. Not! When you click the 'Save button', the starting offset is changed for the next page. However, the translations you just marked are removed from the list at the same time. So, if you were looking at translations 1-10, after pressing 'Save & Continue' you will actually be looking at translations 21-30, not 11-20! To get to the 'lost' translations, you have to retrieve the list from the start again. So, load the initial page and go to step #1 to fix the remaining half of translations. Next time you reach this step, half of those will be left. Next time, half of half of those. Isn't that fun!
Where's that monkey ad again? A brute force solution could be to write a script. That could save some bananas. Not that we could run out of them as this whole thing is pretty much bananas. That does not look like a clean solution though. Does anyone know if there there is a better way?

20 March 2008

Neil Williams: Death of the HP laptop

OK, the misery of the HP laptop continues.
In hibernated mode, picked up the laptop, open the lid, tap the power button and the lights come on then the lights go off. Followed by the fan and the screen. Try the power button again - nothing.
Power is still getting into the machine - the power indicator works.
Power does not appear to be getting any further. Bugger.
(That's a nice present on my birthday isn't it!) :-(
Only option now is to remove the hard drive and take the disasterous road labelled "Customer Service" as it's under warranty. (That way I can avoid having to revoke my laptop key - it's not my main key but it's got a lot of signatures that I'd rather not loose.)
Damn and double damn. Waste of money, feeling miserable and $%^@& annoyed. I'm almost tempted not to bother getting the useless thing repaired.
So, I'm back on my iBook laptop which will probably now have to go back to running unstable.

19 March 2008

Stefano Zacchiroli: git-buildpackage from debian-only to debian+upstream

Moving a git layout from debian-only to debian+upstream ... and live happily with git-buildpackage Let's say you have a git repository you have used thus far to maintain only the Debian part of some package (i.e. no upstream sources on sight). OK, you're right, that would be quite an uncommon scenario for a git repository. In fact the truth is that you are in such a situation because the git repo was obtained converting from a subversion repo which was using the mergeWithUpstream stuff of svn-buildpackage. Now that you have git's space efficiency you want to change this, import upstream sources, and possibly adhere to a branch layout which is compatible with git-buildpackage (which is very simple in its minimal requirements: an upstream branch containing just upstream sources and a master branch containing a debianized source tree). Out of the box git-import-orig won't work since don't have the upstream branch. Creating it branching from master (or somewhere else) won't work either unfortunately. Indeed after branching you will need to remove the debian/ dir from upstream and when you will merge upstream with master you will be merging the removal as well, bad idea. By myself I've found some horrifying solutions involving using git-filter-branch on the upstream branch merged from master and then squashing all the history of that branch with git-rebase, but they are so horrible that I won't mention them here more than this. The nice solution came from a hint by madduck on the creation of branches without ancestry. Here is the complete recipe (assumed to be run from the master branch of the repo, before creating any upstream branch):
$ git-symbolic-ref HEAD refs/heads/upstream
$ git rm --cached -r .
$ git commit --allow-empty -m 'initial upstream branch'
$ git checkout -f master
$ git merge upstream
$ git-import-orig --no-dch ../foo_1.2.3.orig.tar.gz

In short: you should create an upstream branch without any ancestry, in it you should create an empty commit, then merge it (vacuously) in master, and now you're ready to call git-import-orig to the rescue. Feature request on git-buildpackage to support this out of the box is on the go: bug #471560.

Russell Coker: The Inevitability of Victory

I just read an interesting blog post about Montenegro [1]. Apparently a key to the process of becoming a country was acting like it was inevitable. It seems that this method can be applied to many areas, one of which is the contest between Linux and some proprietary OSs. For many years monopolists have convinced people that it was inevitable that they would monopolise all areas of software development. Why use any other software (even if it is more reliable, faster, has more features, and is cheaper) if a monopolist is about to dominate the market? The monopolist changes sometimes, the monopolist from ~1990 to now is different from the monopolist of the 1970’s, but the tactics of a computer monopolist remain the same. The way to beat this is largely to just ignore them. There is an ongoing debate in some circles about when Linux will be “ready for the desktop“. I’ve been running Linux as my primary desktop environment since about July 1998, it’s almost 10 years of having Linux as my primary desktop environment. It seems inevitable that the Linux will take over the desktop - it’s far better for desktop use than it was 10 years ago when I switched. Some people claim that Linux lacks driver support. Every piece of hardware that I’ve wanted to use over the last 10 years has had adequate support. Often second-hand hardware works best with Linux, hardware vendors have no reason to continue to support their old products on newer operating systems (they make more money if you buy new hardware to run the new OS). Not only is hardware support for Linux adequate, but long-term support is far superior (and I often get to use cheap second-hand hardware). Now that an increasing number of hardware vendors are supporting Linux for their new hardware (Intel, AMD, and most laptop vendors are doing some good work in this regard). It seems that everyone who has tried both says that writing drivers for Linux is easier than writing drivers for proprietary OSs, so it seems inevitable that Linux will end up with better driver support by all metrics. Linux is designed for users. DRM (Digital Restrictions Management) is not something that interests Linux developers. Run Linux and your computer will obey you and give full quality audio and video. It seems inevitable that Linux will dominate the AV section of the market (it already dominates the computer work involved with creating movies). Free software (of which Linux is merely the most famous and popular example) is based on the principles of open design and open standards. When you use a free software program to save a file then you can be reasonably sure that you will be able to read it back again in a few decades. Most free software uses file formats that are well documented and standardised. Sometimes there are bugs in programs and new versions will use files in a different way, this is sometimes a case when you rely on a bug in an old version. Using the older version of the software is sometimes required to properly access old data. Fortunately when you have the source to the older programs they can be compiled on new systems (so different types of CPU won’t matter). Also the lack of DRM means that an OS image can be virtualised. One thing that is on my todo list is to create a set of virtual machine images of some of the most commonly used distributions of Linux so I can easily compare distributions of 10 years ago with modern distributions - it’s not technically challenging and there is no particular technical or legal obstacle to doing this. This would also mean that if someone gave me a file in some strange format from 10 years ago I would have a better chance of reading it. It seems inevitable that as the value of data increases the desire to avoid OSs that prevent people from accessing their own data will also increase, and that will eventually squeeze out most closed software from the market. This doesn’t mean the end of proprietary software, merely the end of software that holds user’s data hostage. The majority of the world’s population does not use computers. The computers that they end up using will be cheap because they can’t afford to waste so much money on new hardware. To make cheap machines means that there will be limited resources in terms of RAM, mass storage, and CPU power which require more efficient software. Also to properly take advantage of machines with small screens and other limitations changes to the design of the software will be required. It seems inevitable that the most open software will be adapted to such environments more readily than proprietary software. Now this doesn’t mean that we can take a break from development. In the free software community there are usually many different programs to perform a particular task with competition between the developers of the various projects. The fact that a monopolist is inevitably going to lose it’s position is of little relevance to the competition between the various free alternatives.

Next.

Previous.