Search Results: "agi"

26 December 2008

John Goerzen: ID3 tags

For Christmas, I got Terah a Sandisk Sansa m240 MP3 player off Woot. A very basic and small device, but just what she needs. There s a catch. It appears to only recognize ID3 tags in v1 format. (Some online sources claims it also recognizes v2.3, but not v2.4, but my testing shows it doesn t.) It turns out that very few, if any, modern media management tools support ID3v1. I tried Rhythmbox, Listen, Banshee, Amarok, and several others. Not one of them even had an option for ID3 version. A couple had an option for what to use when encoding from CD if I knew the magic undocumented gstreamer incantation. But they promptly deleted the ID3v1 tag whenever the information for the track was modified. I eventually wound up writing a script for Terah to run that calls eyeD3 to convert the tags to v1. But with all the devices out there that grok v1 only, I am really rather shocked at the lack of software support for it these days.

David Bremner: Prolegomenon to any future tg-buildpackage

So I have been getting used to madduck's workflow for topgit and debian packaging, and one thing that bugged me a bit was all the steps required to to build. I tend to build quite a lot when debugging, so I wrote up a quick and dirty script to I don't claim this is anywhere ready production quality, but maybe it helps someone. Assumptions (that I remember) Here is the actual script:
#!/bin/sh
set -x
if [ x$1 = x-k ]; then
    keep=1
else
    keep=0
fi
WORKROOT=/tmp
WORKDIR= mktemp -d $WORKROOT/tg-debuild-XXXX 
# yes, this could be nicer
SOURCEPKG= dpkg-parsechangelog   grep ^Source:   sed 's/^Source:\s*//' 
UPSTREAM= dpkg-parsechangelog   grep ^Version:   sed -e 's/^Version:\s*//' -e s/-[^-]*// 
ORIG=$WORKDIR/$ SOURCEPKG _$ UPSTREAM .orig.tar.gz
pristine-tar checkout $ORIG
WORKTREE=$WORKDIR/$SOURCEPKG-$UPSTREAM
CDUP= git rev-parse --show-cdup 
GDPATH=$PWD/$CDUP/.git
DEST=$PWD/$CDUP/../build-area
git archive --prefix=$WORKTREE/ --format=tar master   tar xfP -
GIT_DIR=$GDPATH make -C $WORKTREE -f debian/rules tg-export
cd $WORKTREE && GIT_DIR=$GDPATH debuild 
if [ $?==0 -a -d $DEST ]; then
    cp $WORKDIR/*.deb $WORKDIR/*.dsc $WORKDIR/*.diff.gz $WORKDIR/*.changes $DEST
fi
if [ $keep = 0 ]; then
    rm -fr $WORKDIR
fi

25 December 2008

Jose Carlos Garcia Sogo: git tips

Git is becoming my main utility for Debian packaging, as I am using it to keep my work on packages I maintain alone or in a team by using git.debian.org facilities. I am not still using tools like TopGit to keep patches, by I also intend to do so in a near future.
What does git give me over svn? Basically two things: branches and having the whole source code at hand. The first is obvious, I can easily create branches to experiment without having to change anything in the way the package is, so if a new upstream release occurs in the time it takes me to implement some change (and that usually happens) I can upload it straight, not affecting my undergoing changes.
Also I appreciate having the whole source code. This could have been also done using svn, but we preferred not to do so, and most packages only have debian dir in their svn repositories. This makes harder work with upstream sources, where they need to be patched. Git provides me the way to have always an upstream source code copy at hand, and the branch power can also be applied to it.
But I wanted to write about a couple of git tips that I found. Seems that they have already appeared on Planet Debian before, but I think that is not a bad idea to remember them (from damog s blog):

1. Changing into a directory that contains a repo and shows you on PS1 what branch you are standing on:

On .bashrc I have:

GITPS1='$(__git_ps1 ":%s ")'
export PS1="$ GREEN \w$ RS $ YELLOW $ GITPS1 $ RS \\$ "

But what I didn t want to lose was the code that was posted to paste.bin after in a comment someone pointed out that this trick was a bit annying if your home dir were also a git repo. This is one solution:

__maybe_git_ps1 ()
local BRANCH="$(__git_ps1 '%s')"
case "$BRANCH" in
master)
# silent
;;
'')
# not a git repo? -> silent
;;
*)
if [ -n "$1" ]; then
printf $1 $BRANCH
else
printf (%s) $BRANCH
fi
;;
esac

2. An alias I like to use on repos that are personal for quick tracking:

[alias]

log1 = log pretty=oneline abbrev-commit
Thanks damog for these tips!

24 December 2008

Ana Beatriz Guerrero Lopez: Little kchristmas present

David Palacio has made a live CD with the current snapshot packaging of KDE 4.2. The distribution is being made only using the BitTorrent protocol, using the tracker services of LinuxTracker. And do not worry, it is being well seeded! And remember this is only made with the purpose of take a look to current status of upcoming KDE 4.2. Enjoy!

23 December 2008

Emilio Pozuelo Monfort: Collaborative maintenance

The Debian Python Modules Team is discussing which DVCS to switch to from SVN. Ondrej Certik asked how to generate a list of commiters to the team s repository, so I looked at it and got this:
emilio@saturno:~/deb/python-modules$ svn log egrep "^r[0-9]+ cut -f2 -d sed s/-guest// sort uniq -c sort -n -r
865 piotr
609 morph
598 kov
532 bzed
388 pox
302 arnau
253 certik
216 shlomme
212 malex
175 hertzog
140 nslater
130 kobold
123 nijel
121 kitterma
106 bernat
99 kibi
87 varun
83 stratus
81 nobse
81 netzwurm
78 azatoth
76 mca
73 dottedmag
70 jluebbe
68 zack
68 cgalisteo
61 speijnik
61 odd_bloke
60 rganesan
55 kumanna
52 werner
50 haas
48 mejo
45 ucko
43 pabs
42 stew
42 luciano
41 mithrandi
40 wardi
36 gudjon
35 jandd
34 smcv
34 brettp
32 jenner
31 davidvilla
31 aurel32
30 rousseau
30 mtaylor
28 thomasbl
26 lool
25 gaspa
25 ffm
24 adn
22 jmalonzo
21 santiago
21 appaji
18 goedson
17 toadstool
17 sto
17 awen
16 mlizaur
16 akumar
15 nacho
14 smr
14 hanska
13 tviehmann
13 norsetto
13 mbaldessari
12 stone
12 sharky
11 rainct
11 fabrizio
10 lash
9 rodrigogc
9 pcc
9 miriam
9 madduck
9 ftlerror
8 pere
8 crschmidt
7 ncommander
7 myon
7 abuss
6 jwilk
6 bdrung
6 atehwa
5 kcoyner
5 catlee
5 andyp
4 vt
4 ross
4 osrevolution
4 lamby
4 baby
3 sez
3 joss
3 geole
2 rustybear
2 edmonds
2 astraw
2 ana
1 twerner
1 tincho
1 pochu
1 danderson
As it s likely that the Python Applications Packaging Team will switch too to the same DVCS at the same time, here are the numbers for its repo:

emilio@saturno:~/deb/python-apps$ svn log egrep "^r[0-9]+ cut -f2 -d sed s/-guest// sort uniq -c sort -n -r
401 nijel
288 piotr
235 gothicx
159 pochu
76 nslater
69 kumanna
68 rainct
66 gilir
63 certik
52 vdanjean
52 bzed
46 dottedmag
41 stani
39 varun
37 kitterma
36 morph
35 odd_bloke
29 pcc
29 gudjon
28 appaji
25 thomasbl
24 arnau
20 sc
20 andyp
18 jalet
15 gerardo
14 eike
14 ana
13 dfiloni
11 tklauser
10 ryanakca
10 nxvl
10 akumar
8 sez
8 baby
6 catlee
4 osrevolution
4 cody-somerville
2 mithrandi
2 cjsmo
1 nenolod
1 ffm
Here I m the 4th most committer :D And while I was on it, I thought I could do the same for the GNOME and GStreamer teams:
emilio@saturno:~/deb/pkg-gnome$ svn log egrep "^r[0-9]+ cut -f2 -d sed s/-guest// sort uniq -c sort -n -r
5357 lool
2701 joss
1633 slomo
1164 kov
825 seb128
622 jordi
621 jdassen
574 manphiz
335 sjoerd
298 mlang
296 netsnipe
291 grm
255 ross
236 ari
203 pochu
198 ondrej
190 he
180 kilian
176 alanbach
170 ftlerror
148 nobse
112 marco
87 jak
84 samm
78 rfrancoise
75 oysteigi
73 jsogo
65 svena
65 otavio
55 duck
54 jcurbo
53 zorglub
53 rtp
49 wasabi
49 giskard
42 tagoh
42 kartikm
40 gpastore
34 brad
32 robtaylor
31 xaiki
30 stratus
30 daf
26 johannes
24 sander-m
21 kk
19 bubulle
16 arnau
15 dodji
12 mbanck
11 ruoso
11 fpeters
11 dedu
11 christine
10 cpm
7 ember
7 drew
7 debotux
6 tico
6 emil
6 bradsmith
5 robster
5 carlosliu
4 rotty
4 diegoe
3 biebl
2 thibaut
2 ejad
1 naoliv
1 huats
1 gilir

emilio@saturno:~/deb/pkg-gstreamer$ svn log egrep "^r[0-9]+ cut -f2 -d sed s/-guest// sort uniq -c sort -n -r
891 lool
840 slomo
99 pnormand
69 sjoerd
27 seb128
21 manphiz
8 he
7 aquette
4 elmarco
1 fabian
Conclusions:
- Why do I have the full python-modules and pkg-gstreamer trees, if I have just one commit to DPMT, and don t even have commit access to the GStreamer team?
- If you don t want to seem like you have done less commits than you have actually done, don t change your alioth name when you become a DD ;) (hint: pox-guest and piotr in python-modules are the same person)
- If the switch to a new VCS was based on a vote where you have one vote per commit, the top 3 commiters in pkg-gnome could win the vote if they chosed the same! For python-apps it s the 4 top commiters, and the 7 ones for python-modules. pkg-gstreamer is a bit special :)

Biella Coleman: The Prosaics of Micro-writing

Recently much ink has been spilled on the forms of micro-writing (Twitter, Facebook status updates, micro-blogging) that have captivated the hearts, minds, and especially keyboards of those, like me, who spend a lot of time in front of the blue screen (whether a computer or a phone). Lately, perhaps in part because I was home bound for days, I went on a status-update frenzy, updating my Facebook feed like there was no tomorrow and checking in as often to read the short nuggets left by friends. Despite this recent bonanza, I don t admit to all my friends of this addiction as some of them seem to really dislike no the more accurate term is detest this linguistic genre. Generally, it seems to me, there are those that love these messages, and then there are those who disparage them for being inane, short blasts of egotistical information that reflect and worse, reinforce the rampant, raw, unfiltered American love with self, performing the individual, and all that related jazz. I am sympathetic with the haters and at times, I admit I feel nothing but the hate (and perhaps this is why I have yet to Twit) but after thinking about it I have decided I am not really in their camp. Why? Well, something I do when I am thinking through phenomenon is ask: What Would Bakhtin Think (WWBT) as he is a theorist that I adore for he avoids so many of the traps, mostly of binary thinking, that befall most academic theorists. The answer to WWBT, at least from the way I read him, would be that he would dig and find something quite significant about these linguistic ephemera. Bakhtin, who was a Russian literary critic and thinker , thought highly of the novel as a genre for, unlike poetry, it provides a window into everyday life, into the depths and heights of the prosaic, which, however prosaic, is actually where all the extraordinary stuff of life resides. For in the humdrum of life is where he locates wonder, magic, suffering, laughter, mystery, love, oppression, and joy even if its significance often slips right on by our awareness, our perceptual world, until it is unearthed by such genres as the novel (and I would add film). You really can t get more mundane than these micro-statements, though albeit they can be fantastically funny, frustratingly opaque, devilishly satiric, and in rare occasions, poetic; and it is for all these reasons that I find them personally enjoyable and analytically valuable. So much of our life is seeped and steeped in the mundane and yet it is whizzes by us without much reflection. We certainly don t have much of a window into the mundane lives of others, especially in any real time sense. These updates are short pauses, like a temporal parenthesis (which any reader of this blog can I tell I am fond of) or a pleasant hiccup. While many say that they are egotistical blasts, I experience them otherwise, especially when I find myself smiling, laughing, wondering not at what I say but what others throw out there. For with the short update, I am transported, however ephemerally and momentarily, to your mundane world and share in the pleasures of life as is. And for those that remain unconvinced, at least take my word that Bakhtin is worth paying attention to (that is, if you pay attention to academic theory), here is a review essay that might convince you (subscription required but I will try to post a full copy later)

Patrick Schoenfeld: How to NOT improve relationships to your peer projects

I don't know if Aaron is an Ubuntu Developer. I hope not. And I hope that no one of the commenters is one. But this post and especially the comments to it (because the article may have some justification) is certainly not a way to improve the relationship between projects like Ubuntu and the projects its based on.

Yes, it is true, that we have a rough tone in our mailing lists and yes it is sad that every now and then topics pop up that need to be discussed till somebody is hurt and leaves (the project). I certainly hope that this can be improved over the time, but most likely this is not something which breaks the project. Who knows what its worth. We have a large community, very much different opinions and therefore conflicts. Possibly it enhances the quality of our distribution, because things that certainly would make our product worse (e.g. lowering quality standards) won't get done, because they'll get a strong opposition.

But whats the point with the innovations, Aaron? Is it the job of a distribution to serve with innovations? A distribution that serves as a base for more then 10 other distributions? A distribution that is known to care a lot about freedom and is known (and appreciated) for a high quality standard. I don't think we need to serve innovations. We served innovations back in a time where it was needed. Where things were missing. Like a good package management, like conf.d directories. Apart from this I think there were enough innovations in the past years. Possibly not that user-visible and trendy as a graphical virtualization frontend. What about xen-tools for example?
Now its all about reinventing the wheel or developing frontends. Launchpad for example is just reinventing the wheel. Savannah exists, GForge exists. Bazaar is just reinventing the wheel. Git exists. So does Mercurial.

But whats most sad about your posts and the comments is that you (and your commentors) seem to share the opinion that all Debian does is packaging software and nothing more. According to you Debian developers do not fix bugs, forward patches, file (important) wishlist bugs, encourage upstreams to remove horribly broken licensed software, improve their own software and tools (dpkg, aptitude, apt-get, the devscripts, ....), do integration work (alternatives, $EDITOR usage, ...), documentation work (writing manpages). The reality is that there are many small and greater things driven by Debian Developers that serve the whole community. Additional to the ground work that your favorite operating system is based on and without which it could not exist.
Its just not beeing doped like it is done by companies with their marketing departments that actually earn money with what they do. Take the projects you named. They all have one. They all have paid developers.

In any way such a ranting (with no real
constructiveness) will not serve the relationships between other projects and Debian.

22 December 2008

David Bremner: A topgit testimonial

I wanted to report a success story with topgit which is a rather new patch queue managment extension for git. If that sounds like gibberish to you, this is probably not the blog entry you are looking for. Some time ago I decided to migrate the debian packaging of bibutils to topgit. This is not a very complicated package, with 7 quilt patches applied to upstream source. Since I don't have any experience to go on, I decided to follow Martin 'madduck' Krafft's suggestion for workflow. It all looks a bit complicated (madduck will be the first to agree), but it forced me to think about which patches were intended to go upstream and which were not. At the end of the conversion I had 4 patches that were cleanly based on upstream, and (perhaps most importantly for lazy people like me), I could send them upstream with tg mail. I did that, and a few days later, Chris Putnam sent me a new upstream release incorporating all of those patches. Of course, now I have to package this new upstream release :-). The astute reader might complain that this is more about me developing half-decent workflow, and Chris being a great guy, than about any specific tool. That may be true, but one thing I have discovered since I started using git is that tools that encourage good workflow are very nice. Actually, before I started using git, I didn't even use the word workflow. So I just wanted to give a public thank you to pasky for writing topgit and to madduck for pushing it into debian, and thinking about debian packaging with topgit.

21 December 2008

Christian Perrier: Samba "backports" to lenny

Samba in unstable is 3.2.5 currently, while upstream published 3.2.6 a few days ago. This is mostly because 3.2.6 has too many changes that make it unsuitable for lenny, which will have 3.2.5. As we want to keep the "update through unstable" path, we can't upload 3.2.6 to unstable. Simultaneously, we are using experimental for 3.3.* releases. Upstream recently published 3.3.0-rc2 which I uploaded yesterday to experimental. So, we don't have any easy way to make post-3.2.5 releases available to our users. I briefly imagined using backports.org for this, but: Finally, I opened http://pkg-samba.alioth.debian.org/packages/ as a private repository to hold these packages. You can use the following in sources.list:
deb http://pkg-samba.alioth.debian.org/packages/ ./
deb-src http://pkg-samba.alioth.debian.org/packages/ ./
The packages are signed with my own GPG key, which you need to add to "trusted" keys for APT" (be sure to read http://wiki.debian.org/SecureApt first). They are numbered the same way they would be if they were on backports.org. These packages are maintained in the Samba packaging team SVN. Please take this as a commitment to try providing up-to-date packages for lenny during its release cycle. Of course, the security support will be done on a best effort basis but should at least not be worse than upstream's (which is known to be good and very reactive). I hope that samba users will enjoy....and if some of you could join the team and help triaging bugs, that would be appreciated..:-)

20 December 2008

Jeff Bailey: "I'm Linux"

Just saw the LF announcement:

http://video.linuxfoundation.org/category/video-category/-linux-foundation-video-contest

I love the effort, and I'm sure people will do great work, but there's a problem here. There needs to be *two* contests. The first, with the award that they propose, should be the serious one - The one that might get rolled out to suits and businesses everywhere, that we'd be proud to show off on our corporate web sites.

Then there's the second category. The "too honest" ones that get made for the equivalent "I'm a Mac" / "I'm a PC" ads and wind up on YouTube and email attachments. Not so much fan fiction as fan honesty. =)

I'm thinking start with a focus on a keyboard, crusted with Doritos and possibly an ashtray beside it, zoom out to a couple people playing Quake or Tetrinet or something that clearly haven't washed in days, zoom out, show that this is a dorm room. The room next to it (with cutaway walls and what not) has someone composing an email saying that either Gnome or KDE sux0rs. Further out, two floors, more rooms: Some people lit just by the glow of a CRT, decorated by Debian and Gentoo logos, maybe a vague outline of some porn on a monitor. The zoom out picks up to show ESR writing another book, maybe another ELER comic being written, someone "upgrading" their home wiring, various people arguing, one shower in the building total, and finish the zoom out and fade in the facade to the building: All shiny, glass and steel with a front door with a business person leading a tour past it saying "These are the Linux Development Labs, where all the magic happens. It's closed to visitors right now (points to goth in the back with a laptop who's probably running kismet), except you - you're welcome in." And then fade in the letters "We are Linux"

The soundtrack to this should be a background hum, just at the edge of what a TV speaker will play for volume. Queue in fifths and octaves during the zoom out, fade in some drum and base, some Simcity type of background talking and open up the chord as the words fade onto the screen.

(This is fiction, people. Noone expects another ELER)

19 December 2008

Christian Perrier: Samba "backports" to lenny

Samba in unstable is 3.2.5 currently, while upstream published 3.2.6 a few days ago. This is mostly because 3.2.6 has too many changes that make it unsuitable for lenny, which will have 3.2.5. As we want to keep the "update through unstable" path, we can't upload 3.2.6 to unstable. Simultaneously, we are using experimental for 3.3.* releases. Upstream recently published 3.3.0-rc2 which I uploaded yesterday to experimental. So, we don't have any easy way to make post-3.2.5 releases available to our users. I briefly imagined using backports.org for this, but: Finally, I opened http://pkg-samba.alioth.debian.org/packages/ as a private repository to hold these packages. You can use the following in sources.list:
deb http://pkg-samba.alioth.debian.org/packages/ ./
deb-src http://pkg-samba.alioth.debian.org/packages/ ./
The packages are signed with my own GPG key, which you need to add to "trusted" keys for APT" (be sure to read http://wiki.debian.org/SecureApt first). They are numbered the same way they would be if they were on backports.org. These packages are maintained in the Samba packaging team SVN. Please take this as a commitment to try providing up-to-date packages for lenny during its release cycle. Of course, the security support will be done on a best effort basis but should at least not be worse than upstream's (which is known to be good and very reactive). I hope that samba users will enjoy....and if some of you could join the team and help triaging bugs, that would be appreciated..:-)

16 December 2008

John Goerzen: Administering Dozens of Debian Servers

At work, we have quite a few Debian servers. We have a few physical machines, then a number of virtual machines running under Xen. These servers are split up mainly along task-oriented lines: DNS server, LDAP server, file server, print server, mail server, several web app servers, ERP system, and the like. In the past, we had fewer virtual instances and combined more services into a single OS install. This led to some difficulties, especially with upgrades. If we wanted to upgrade the OS for, say, the file server, we d have to upgrade the web apps and test them along with it at the same time. This was not a terribly sustainable approach, hence the heavier reliance on smaller virtual environments. All these virtual environments have led to their own issues. One of them is getting security patches installed. At present, that s a mainly manual task. In the past, I used cron-apt a bit, but it seemed to be rather fragile. I m wondering what people are using to get security updates onto servers in an automated fashion these days. The other issue is managing the configuration of these things. We have some bits of configuration that are pretty similar between servers the mail system setup, for instance. Most of them are just simple SMTP clients that need to be able to send out cron reports and the like. We had tried using cfengine2 for this, but it didn t work out well. I don t know if it was our approach or not, but we found that hacking cfengine2 after making changes on systems was too time-consuming, and so that task slipped and eventually cfengine2 wasn t doing what it should anymore. And that even with taking advantage of it being able to do things like put the local hostname in the right places. I ve thought a bit about perhaps providing some locally-built packages that establish these config files, or load them up with our defaults. That approach has worked out well for me before, though it also means that pushing out changes isn t a simple hack of a config file somewhere anymore. It seems like a lot of the cfengine2/bcfg tools are designed for environments where servers are more homogenous than ours. bcfg2, in particular, goes down that road; it makes it difficult to be able to log on to a web server, apt-get install a few PHP modules that we need for a random app, and just proceed. Any suggestions?

15 December 2008

Jonathan McDowell: Debian: King of procrastination

Once again Debian is close to release. And once again we're trying to find ways to avoid doing so. Using a technique we've employed before; firmware.
Social Contract #4 states that "Our priorities are our users and free software". The hard liners believe that it's in our users' best interests that we ensure Debian is 100% Free, whether that be regarding software, documentation or firmware. In the long run I think they're right. Access to firmware source (assuming that there's also access to
suitable tools for building it and producing an image the hardware will accept, which is a fairly big assumption) enables us to continue supporting and improving hardware support long after a manufacturer has discontinued a device. It enables us to understand the behaviour of a new device better (allowing better support which makes it a more attractive purchase). It potentially lets us appropriate a device for new and exciting purposes the manufacturer never imagined (which may again increase the sales of the device). Access to firmware source is a good thing in the long term, for the consumer, the driver author and the manufacturer.
In the short term we I think we need to be pragmatic. We can say that we won't release until all non-free firmware is purged, but who knows how long that will take, and once we've done so how much hardware will we actually be able to support out of the box? What benefit is it to our users if we ship them a distribution that doesn't support their hardware and is already out of date because we spent so long removing that support? Wouldn't we be better to say "We're aware of some firmware issues. We're going to keep working on spliting such blobs out to their own easily installable packages that live outside main. We promise to continue improving the situation for each release (as we have already done since etch), but in the interests of our users we will not hold up a release at this stage of the process." Obviously plenty of people disagree with that, but I don't believe that pragmatism is against the Social Contract and I'd like to think that even our users who are fervently against firmware blobs would accept that there's a tradeoff to be had against release dates.
Anyway. I doubt I've changed anyones mind with the above, so I'm going to go and destack the dishwasher and reply to the latest mail from my NM.

Tollef Fog Heen: Ruby/Gems packaging (it's java all over again)

It is sad to see how people complain about how packaging Ruby gems is painful. It seems like it is the Java packaging game all over again where any application ships its dependencies in a lib/ directory (or in the case of Rails, vendor/). Mac OS X applications seem to do some of the same thing by shipping lots of libraries in their application bundle, which is really just a directory with some magic files in it. This is of course just like static linking, which we made away with for most software many years ago, mostly due to the pain associated with any kind of security updates. Update: What I find sad is that people keep making the same mistakes we made and corrected years ago, not that people are complaining about those mistakes.

14 December 2008

Andrew Pollock: [tech] Asterisk call notification

My home Asterisk configuration has been pretty static for a while. It works well, and so I haven't had a need to mess around with it. There's a couple of outstanding features I've wanted to implement for a while though, and I've now got one of them out of the way. All calls that come in from the local PSTN line, the Vonage ATA, and the SIP connection to Engin, hit a menu, where the caller selects whether they want to speak to Sarah or myself. The sole purpose of this is to determine what to do with the call if no one answers (which voicemail box or cell phone to send the call to). A convenient side-effect of this is that it defeats most telemarketers. Ages ago, I set up caller ID announcement to my MythTV setup, so if we happened to be watching TV or a recording when a call came in, it briefly popped up on the TV. Fortunately, we're not huge square-eyes, and spend more time goofing off on our laptops, so I wanted a way to display notifications on our laptops when calls came in as well. I had this crazy design in my head of having a server process on my Asterisk box, and then clients on our laptops could connect to it, and be informed of new calls. Before I went on a coding frenzy, and did something with the Observer pattern and more socket programming than I really wanted to, I thought I'd check if this was solved problem. Turns out, it kind of is. I found the Notify application for Asterisk (which I've made a package for Debian Etch), which blats a UDP message to particular host as part of a dialplan. It's more intended to go in person-specific extensions, but as the majority of calls go into the main menu and never come out before hitting a person-specific extension, and I still wanted to know about them for my own perverse pleasure, I added multiple calls to the Notify application in the main menu dialplan. The site for the application also mentioned some third-party clients for Linux and MacOS, but I've been looking for an excuse to try and write something that used Growl, so I wrote my own Python application, initially on Linux, and then I essentially swapped out the pynotify code for the equivalent Growl code, and it worked just as well on Sarah's Mac. So it's not quite the solution that I had in mind, because it doesn't really scale, but for our two-user home setup, it's adequate. I might still try and write some middleware between a client for this application and an infinite number of observers, but there's no urgency. The dialplan for our main menu now looks something like this:
exten => s,1,Background(for)
exten => s,n,AGI(mythtv-cid.agi)
exten => s,n,Notify($ CALLERID(num) $ CALLERID(name) $ EXTEN /icarus)
exten => s,n,Notify($ CALLERID(num) $ CALLERID(name) $ EXTEN /iapyx)
exten => s,n,Set(TIMEOUT(digit)=5)      ; Set Digit Timeout to 5 seconds
exten => s,n,Set(TIMEOUT(response)=10)  ; Set Response Timeout to 10 seconds
exten => s,n,Background(names/sarah)
exten => s,n,Background(press-1)
exten => s,n,Background(for)
exten => s,n,Background(names/andrew)
exten => s,n,Background(press-2)
exten => s,n,WaitExten
A call comes in, hits the menu, and the caller ID info is displayed on MythTV (if something's being watched) and our two laptops (if they're awake). Unfortunately my Git-fu is atrocious, so I can't figure out how to link to a web-browseable repository that contains the source for my client, but if I figure that out, I'll update this with a link later. Update I managed to summon enough Git-fu to put the repository online. It's available at http://git.andrew.net.au/?p=asterisk-notify-client.git;a=summary Now I just have to use it properly.

Wouter Verhelst: -lgnodbify-gtk

A while back, I wrote about this GObject-based Object/Relational mapper that I wrote, which is called 'GNoDbify'. It isn't complete yet, but parts of the library work; I use it for a project that I'm supposed to commercially support. For those who don't know what that is: an O/R mapper builds objects out of database tuples; so I can run a 'lookup' function on the object class and get one (or more) objects representing data from the database, then perform some modifications on that object, and store it back in the database; my O/R mapper does all the SQL magic. Last week, I've been working on another object that takes an array of GNoDbify objects, and presents them using the GtkTreeModel interface, for easy viewing in a GtkTreeView:
my @customers = Vpbs::Db::Customer->get_all();
my $model = GNoDbify::ListStore->new_from_array(@customers);
my $view = Gtk2::TreeView->new_with_model($model);
my $renderer = Gtk2::CellRendererText->new();
my $column = Gtk2::TreeViewColumn->new_with_attributes("Name", $renderer, "text", $model->get_column("name"));
$view->append_column($column);
And there you have it: a treeview showing all the names of all the customers in the database. On the classical approach, one would have to use DBI or some such to fetch data from the database, create a GtkListStore or something similar, and then append the data one row at a time to that. Of course that still happens here, in a manner of speaking, but it all happens behind the scenes. It also means that in an application which wants to show a load of data, I don't have to do the same thing all the time. The magic happens in the second line, and in the second-to-last line. GNoDbify::ListStore->new_from_array is pretty much self-explanatory, really. It takes an array of GNoDbify objects, and returns a GNoDbify::ListStore. The second-to-last line shows how to add a column to a GtkTreeView. With GtkListStore and GtkTreeStore you basically define yourself what column gets what number; however, with GNoDbify, that isn't as easy (it depends on the implementation of the GNoDbify subclass), so the ->get_column returns the number of a column as represented by the model, and wants the name of the field that you want the column of. Everything else is really the same. It won't stop here, though. The original plan for GNoDbify was that it could detect changes in the database, and update the tree model accordingly. Most of that has already been implemented in GNoDbify (though not yet in the ListStore thing), but just needs some debugging. The fun thing is, the above six lines of code would not have to change at all for that. Of course all this juicyness comes at a price. In order to generalize this much, I had to do a lot of extra stuff; so there's some performance loss. Especially in perl; most of GNoDbify is written in C, and converting perl arrays to and from C arrays is a process that can only be done by looping over the perl array (or the C array) and creating the other side of the equation. Obviously, that's a costly approach, performance-wise; an obvious optimization of the above example could be to have a subroutine that returns Customer objects already in a GtkTreeView in one API call. We'll see.

12 December 2008

Chris Lawrence: Corollary of the day

King Politics thinks the GOP anti-bailout faction has the politics of the day wrong:
The time for pragmatism is now, but Senate Republicans don t recognize that. Senate Republicans have yet to realize that the GOP lost so many seats in 2006 and 2008 because the American public has a greater desire for pragmatism than ideology.
I think that s true to a point but I suspect it has more to do with post-Katrina George W. Bush than any coherent definition of ideology. As much as the Democrats would like to pretend otherwise, ideological is not a term I d readily apply to the bumbling nature of Bush s second term. Nor am I really convinced that the average voter is doing much more than engaging in post-hoc rationalized-as-something-else economic voting, which doubtless makes me no fun at parties when I play a public opinion scholar. ( Yes, all this crap matters at the margins, and occasionally elections are won at the margins, but most of the time it doesn t matter. ) But I digress. There is a broader lesson, though, in that to the extent the Democrats believe that their recent success is due to their ideology it is at their long-term peril, particularly if they bypass pragmatism in favor of catering to the cobbled-together collection of rent-seekers that passes for the Democratic coalition. To the extent bailing out Detroit is seen as a Democatic handout to its paymasters particularly with the emerging frame of the greedy unions are standing in the way trumping any sort of concept that any deal that tells the UAW to can their contract is essentially an impairment of the obligation of contract (which, believe it or not, is unconstitutional) the auto bailout won t go over well in the 48 or so states that don t host significant Big Three production. On a related note, Steven Taylor notes the defining-down of the filibuster by the media to mean failure to win a cloture vote. While I accept the point graciously, I think this may be more a failure of us as a profession than the media per se; modern congressional procedures (not just filibusters and holds, but also esoterica such as the Rules Committee and UCAs), even superficially treated, aren t a strong point of most American government textbooks, and more often than not that s the only real government orientation budding journalists will get. I make a point of assigning Barbara Sinclair s Unorthodox Lawmaking in my Congress classes, but I doubt the average journalist gets that in-depth in their undergrad days. So here at least I think the blame falls somewhat closer to home than we might want to admit.

Chris Lawrence: Corollary of the day

King Politics thinks the GOP anti-bailout faction has the politics of the day wrong:
The time for pragmatism is now, but Senate Republicans don t recognize that. Senate Republicans have yet to realize that the GOP lost so many seats in 2006 and 2008 because the American public has a greater desire for pragmatism than ideology.
I think that s true to a point but I suspect it has more to do with post-Katrina George W. Bush than any coherent definition of ideology. As much as the Democrats would like to pretend otherwise, ideological is not a term I d readily apply to the bumbling nature of Bush s second term. Nor am I really convinced that the average voter is doing much more than engaging in post-hoc rationalized-as-something-else economic voting, which doubtless makes me no fun at parties when I play a public opinion scholar. ( Yes, all this crap matters at the margins, and occasionally elections are won at the margins, but most of the time it doesn t matter. ) But I digress. There is a broader lesson, though, in that to the extent the Democrats believe that their recent success is due to their ideology it is at their long-term peril, particularly if they bypass pragmatism in favor of catering to the cobbled-together collection of rent-seekers that passes for the Democratic coalition. To the extent bailing out Detroit is seen as a Democatic handout to its paymasters particularly with the emerging frame of the greedy unions are standing in the way trumping any sort of concept that any deal that tells the UAW to can their contract is essentially an impairment of the obligation of contract (which, believe it or not, is unconstitutional) the auto bailout won t go over well in the 48 or so states that don t host significant Big Three production. On a related note, Steven Taylor notes the defining-down of the filibuster by the media to mean failure to win a cloture vote. While I accept the point graciously, I think this may be more a failure of us as a profession than the media per se; modern congressional procedures (not just filibusters and holds, but also esoterica such as the Rules Committee and UCAs), even superficially treated, aren t a strong point of most American government textbooks, and more often than not that s the only real government orientation budding journalists will get. I make a point of assigning Barbara Sinclair s Unorthodox Lawmaking in my Congress classes, but I doubt the average journalist gets that in-depth in their undergrad days. So here at least I think the blame falls somewhat closer to home than we might want to admit.

Romain Beauxis: VPN using SSH

There seems to be indeed a meme on the various use of SSH. So far I ve not seem mine, so here it is ! If you use the -w option when connecting using SSH, and if you have the correct configuration, then two virtual network interfaces will be created on both the client and the server. Using these interfaces with a bit of routing and resolving magic, you can establish a full connection tunneled through an SSH connection !

Adrian von Bidder: Adult content?

The best way to get me to read a blog entry you've made is to apologize about it in the next one ... So I've gone and clicked on the link to Amaya's previous entry. Getting a warning that I'm about to be presented with a page that may contain material only suitable for adults. What the hell, Amaya is an adult and so am I, so let's just confirm this. I was truly shocked to see her entry that indeed did contain the extremely dangerous word “love” in it (can't imagine what else may have triggered the filter.) Together with Youtube's apparent tightening of their filtering (I'd not have noticed except that Illiad commented on it) it seems the Intarwebs are now being converted to a happy teletubby-land. So I'm forced append this disclaimer now: Attention please, the text you've just read may have contained strong words, opinions, sentences, punctuation characters and all kinds of dangerous information only suitable for inhabitants of a small planet somewhere in the vicinity of Betelgeuse.

Next.

Previous.