|
|
|
||||||||||||||||||
| Thursday, 2 July 2009 | Dereel | |
| Top of page | ||
| next day | ||
| last day |
More work on gphoto2. One of the issues was running gphoto2 as setuid root. Discovered some documentation which suggested setting the permissions for the device instead, including information on how to set the permissions for FreeBSD that I hadn't seen before—more below. Unfortunately, the program doesn't do what I want: I can't look at the files, compare them with what's already on disk, and only load the new ones. That's not quite as simple as it seems, since I put each file in a directory related to its date, so I first need to extract the date from the file. And that's not the way gphoto2 works: I don't have the standard file access primitives. It seems that they're working on it, but it's not there yet.
Took a look at the source with a view to implementing a function to do what I want. After a lot of chasing around, found the calls to the underlying libgphoto2 library. Went looking for the documentation, which proves to be empty.
Round about here I gave up. I'll put up with reading in the entire memory card and then throwing away the files I don't need. But why is all this stuff so difficult? It's an interface to files on the camera, and interfacing to file systems has been known for decades.
I've already grumbled about gphoto2's use of the word “folder” for “directory”. Maybe I was too harsh: it doesn't do it all the time. From the man page:
-L, --list-filesAnd then it occurs to me that the word “folder” is part of the dichotomy between operating system and GUI. To the best of my knowledge, on UNIX, Apple and Microsoft, both the command and the underlying system call to create a “folder” is mkdir. No wonder people get confused.
I've been playing around with USB device permissions for some time, and I still didn't have it right. You can put an entry into /etc/devfs.conf, but that only applies to existing devices, and doesn't work for hot pluggable devices. Then I found the instructions in the gphoto2 documentation:
Add the following to the file /etc/devfs.rules, which you'll probably have to create:
[usb_devices=10]From the man page, the first line is a label for a rule set, and the value 10 is a “number”, the purpose of which isn't described, but which needs to be different for each rule. Possibly it's a priority.
Add the following line to /etc/rc.conf:
# Set the default devfs ruleset.Restart devd. This will happen automatically at boot time, but to do it without a reboot, do:
# /etc/rc.d/devfs startThen connect the camera.
Received one of these horrible letters with tear-off ends in the mail today. It's not clear why it needed to be so complicated, since it was only advertising material from the Liberal Party of Australia, represented by Senator Michael Ronaldson. And what material! They've spent the last few weeks slating the Labor [sic]Party for alleged misconduct, including the claim of a mail message which I mentioned last month, and which proved to be fake. Not surprisingly, the opinion polls show the Liberals in general and their leader in particular to be very much out of favour: instead of coming up with any useful suggestions, they just try to denigrate the current government.
What do you do when you're in a hole? If you're Liberal, it seems the answer is “keep digging”. This letter was fully in keeping with their recent behaviour, and although I don't have much respect for either party, it greatly annoyed me, not least because of the trouble I had to go to to open it:
What I can read from this message is:
It offers no solution. It just complains.
It ignores the current global financial situation. Every country in the world is currently going into debt to keep the economy running, and in all probability the Liberal/National coalition would have done so too. The real situation is that Australia is riding the global downturn better than most western countries. But they couldn't say that now, could they?
It uses stupid arithmetic to make the repayment time look worse than it is. The only promise this document makes is that if they come to power, they will take 30 years to fix things. So why should anybody vote Liberal?
Sent a letter to Senator Ronaldson asking for an explanation, and even attached a http://tinyurl.com/senator-ronaldson tag to it. I strongly doubt I'll get a reply, but in principle a representative (even a senator, I suspect) is expected to reply to letters from constituents. We'll see, but I'm not holding my breath.
A couple of days ago, somebody offered some encyclopaedias on our local Freecycle web site, and I thought we might be able to use another one. Today Yvonne went in and picked them up. I wasn't quite expecting the quantity:
That's five complete encyclopaedias and also a couple of dictionaries. Somehow it's sad to see that these books, all in excellent condition, are of no use to people any more. I think I'll keep one of them; what do I do with the other four?
| Friday, 3 July 2009 | Dereel | Images for 3 July 2009 |
| Top of page | ||
| previous day |
I made a mistake with my mail message to Senator Ronaldson yesterday: I addressed it to senator.rolandson@aph.gov.au instead of senator.ronaldson@aph.gov.au. That seems to be a common typo; just by chance today I was discussing a Debbie Ronald with somebody, and he spelt her name Debbie Roland.
People make mistakes, and that's why MTAs bounce these messages. But did it? No. There's a possibility, of course, that this misspelling is so prevalent that they've put in an alias pointing to the correct address. But there's a way to find out: I sent a message to greg.lehey@aph.gov.au, and it didn't bounce either.
Why? Is this just another broken MTA? Quite possibly, but I've heard opinions that this is to avoid reverse spamming people whose names have been used in spam messages. That sounds to me like throwing the baby out with the bath water.
The test photos I took a couple of days ago are still waiting for classification. It's a real pain just identifying each photo. What I need is a better way to name the files, so I can recognize them from the name. And clearly the naming should be related to the EXIF information.
So how do I do it? I already have a function that extracts information from EXIF texts, but it's in PHP. So how do I use it? There's a php “shell”, but every time I've tried to use it, it does nothing until I exit, and then echos my input. It took me some time to discover that, for reasons I don't understand, I need to enter <?php at the start; otherwise it just echos the input.
With that, was able to make good progress and output commands like:
=== grog@dereel (/dev/ttyp8) ~/Photos/20090703 211 -> php ../getexif.php *.exif
That should make things simpler.
I really should be doing something in the garden, but it's pretty miserable outside. Did some much-needed weeding and returned with frozen fingers.
This page contains (roughly) yesterday's and today's entries. I have a horror of reverse chronological documents, so all my diary entries are chronological. I try to leave the pages here for two days; you'll find them all in the archive, so if I fall behind a day or two, you may find more here. Note that I often update a diary entry a day or two after I write it.
Do you have a comment about something I have written? This is a diary, not a “blog”, and there is deliberately no provision for directly adding comments. But I welcome feedback and try to reply to all messages I receive. See the diary overview for more details. If you do send me a message relating to something I have written, please indicate whether you'd prefer me not to mention your name. Otherwise I'll assume that it's OK to do so.
| Previous month | Greg's home page | This month | Greg's photos | Greg's links |
| RSS 2.0 |