July 29th, 2010 | Categories: CLI, Database, LDAP, Mobile, Voip | Tags: , ,

Remember this? For those too young to remember, it is a rotary dial phone, and I assume many young people wouldn't even know how to use it. To dial a number, you looked up the phone number in a telephone directory (or your little black book), picked up the handset, pushed your finger into the hole corresponding to the digit you wanted to dial, and moved said finger clockwise until it bumped against the metal thingy. After pulling out your finger, the spring-loaded rotary dialer moved back to its original position, and you then proceeded to dial the next digit until you'd done them all. Simple.

To place a call you needed a telephone number, of course, just like you need today. Nothing has changed in that respect. I remember knowing most of my friends numbers by heart. Those I didn't know, I had in my little black book, or they were scribbled on a piece of paper somewhere. My friends had one telephone — the apparatus in their (parents') homes — and thus exactly one phone number.

Thirty years later the situation is quite different. Nobody I know has only one number. Everybody and his uncle has at least an additional mobile phone. And an office number. And perhaps a SIP number. And the greatest problem of all is that I cannot for the life of me remember any of these phone numbers any more, which is due mainly to the fact that numbers change when people change mobile operators (some don't care to retain their existing cell phone number), and numbers change when people relocate. (There are vanity numbers in Germany, but these are quite expensive.)

What has also changed, at least for me, is the little black book. Aside from the printout I keep in case of disaster, I store my phone numbers electronically. In Apple's Addressbook app which syncs over nicely to iPhones and devices which have iSync support.

And what about other phones in the house? If I look around me, I find we have quite a few phones in this household. One PBX with three DECT phones connected to it. An IP phone in my office. Two iPhones. One BlackBerry. (And an innumerable number of older mobile phones in boxes in the cellar, but those don't count because they aren't used any longer.) All these devices also have built-in directories: the DECT models have their own but they can list numbers on the PBX, though a bit cumbersome. The IP phone has a telephone book. And LDAP access. And XML.

If I weren't so stingy, I'd get a cell phone flat rate and just use that. But I am stingy so I tend to use a land line phone to call land lines, so I have to choose the outgoing phone. As such I need my directory on all phones I use.

I've solved the problem by throwing large amounts of software at the hardware. Basically it's a mixture of getting my Addressbook into LDAP (ABxLDAP), massaging that into my Fritz!Box, and sucking some of the directory entries out to create a directory for the IP phone. Does it work? Yes. Is it simple? No. Why is it such a mess? Because there are far too many standards: standards for directory systems (LDAP), standards for SIP phones (XCAP), standards for DECT phones, and so on, and so forth.

Who knows: some day I may revert to the little black book and …

the rotary dialer. On the iPhone.

July 25th, 2010 | Categories: DNS, dnsbook | Tags:

I see Martin still appreciates my book Alternative DNS Servers. He liked dnsmasq and now it is Unbound.

July 24th, 2010 | Categories: Entertainement | Tags:

A female CNN journalist heard about a very old Jewish man who had been going to the Wailing Wall to pray, twice a day, every day, for a long, long time.

So she went to check it out. She went to the Wailing Wall and there he was, walking slowly up to the holy site.

She watched him pray and after about 45 minutes, when he turned to leave, using a cane and moving very slowly, she approached him for an interview.

"Pardon me, sir, I'm Rebecca Smith from CNN. What's your name?"

"Morris Fishbien," he replied.

"Sir, how long have you been coming to the Wailing Wall and praying?"

"For about 60 years."

"60 years! That's amazing! What do you pray for?"

"I pray for peace between the Christians, Jews and the Muslims. I pray for all the wars and all the hatred to stop. I pray for all our children to grow up safely as responsible adults and to love their fellow man."

"How do you feel after doing this for 60 years?"

"Like I'm talking to a f…king brick wall!"

[Thanks, Nic.]

July 23rd, 2010 | Categories: Database, NoSQL | Tags: ,

I had to apply a tiny fix to Net::CouchDB as it was croaking with an error when attempting to submit new documents to a CouchDB 1.0 installation. The error message was

Unknown status code '415' while trying to operate on many documents. POST request to http://127.0.0.1:5984/db/_bulk_docs: Content-Type must be application/json

and the patch is trivial:

*** /tmp/DB.pm     2010-07-23 15:12:50.000000000 +0200
--- /usr/lib/perl5/site_perl/5.8.5/Net/CouchDB/DB.pm    2010-07-23 15:09:07.000000000 +0200
***************
*** 132,137 ****
--- 132,138 ----
      }
      my $res = $self->request( 'POST', '_bulk_docs', {
          description => 'operate on many documents',
+       headers =>  { content_type => 'application/json'}, # JPM
          content     => { docs => \@docs },
          201         => 'ok',
      });

Works nicely now.

July 22nd, 2010 | Categories: DNS, Voip | Tags: , , ,

Snom make a range of very good IP telephones that can be provisioned in a variety of ways. The method I prefer is DHCP with an HTTP server, shown here to provision a range of Snom 370 phones.

Snom describes how to use dhcpd to provision its phones, but I need to do the same with the excellent dnsmasq, so here goes:

First I ensure dnsmasq sets a tag ("snom") for devices with the Ethernet prefix reserved for Snom (Ethernet prefix 00-04-13), and I set option 66 (tftp server) for that tag to the specified URL. (Yes, this is the address of an HTTP server and not a TFTP server — Snom phones understand the URI and will connect via HTTP.) The reason I prefer HTTP here instead of TFTP is that I'm then able to dynamically assign specific settings to a phone based on its Ethernet address, which is passed to the URL in the mac variable.

dhcp-mac=snom,00:04:13:*:*:*
dhcp-option=snom,option:tftp-server,"http://web.mens.de/snomprov.php?mac={mac}"

Additionally, I want specific phones to have reserved IP addresses, so I'll add a dhcp-host option for dnsmasq to do the reservation:

dhcp-host=00:04:13:aa:bb:cc,telo,192.168.1.28,set:snom

The tftp-server option (66) will be sent to the phone when it boots. The phone will then contact its provisioning server via HTTP, and the PHP script can then provide the phone with settings.

There are dozens and dozens of settings described in the mass deployment PDF as well as in the configuration files section of the Snom wiki, so here just a small example using the PHP script the phone invokes from above:

<?
        print '<?xml version="1.0" encoding="utf-8"?>' . "\n";
?>
<settings>
  <phone-settings>
    <web_language perm="RW">English</web_language>
    <vol_ringer perm="">14</vol_ringer>
    <user_ringer idx="1" perm="">Ringer8</user_ringer>
  </phone-settings>

</settings>

Provisioning phones this way (i.e. via DHCP and HTTP) allows for a very flexible setup. Using HTTP instead of TFTP allows me to go a step further and dole out settings dynamically.

July 16th, 2010 | Categories: Spam | Tags:

What cracks me up most, apart from the spelling and stupidity, is that this blog spammer actually typed in the bit about the iPad — this wasn't submitted via e-mail.

July 16th, 2010 | Categories: Entertainement | Tags:

Two Australian businessmen in Brisbane were sitting down for a break in their new store. As yet, the store wasn't ready, with no stock and only a few shelves set up.

One said to the other, 'I bet any minute now some idiot tourist is going to walk by, put his face to the window, and ask what we're selling'.

No sooner were the words out of his mouth when, sure enough, a curious Japanese tourist walked to the window, had a peek, and in a thick Japanese accent asked 'What you sell?' One of the men replied sarcastically, 'We're selling arse-holes.'

Without skipping a beat, the Japanese man said, 'Ah Sooo You doing velly well, only two left'…

[Thanks, Nic.]

July 10th, 2010 | Categories: Hardware | Tags: ,

I've been wanting the Huawei E5 for a bit. O2 sells them in Germany but I refused to give them my passport data for purchasing a bit of hardware online. Instead, I got the rebranded product, which is made by Trekstor.
The Trekstor portable WLAN Hotspot a.k.a. Huawei E5. Add a SIM card, switch it on, point your WiFi devices at it, enter the WPA key, and off you go.

If you want to tweak what's inside it, you can: point your Web browser at 192.168.1.1 (and change the default password!).

Highly recommended.