Monday, January 26, 2009

Whole Foods: Mixed Experience

I vaguely recall having been to Whole Foods once many years ago. Today I went back only to stock up on organic quinua for a decent $3/lbs in bulk, better than Trader Joe's $4 for a box with less than one lbs, if it's even in stock.

But I also noticed various items that were significantly (up to 50%) more than the exact same items at TJ.
  • Driscoll organic raspberries, WF $5.99, TJ $3.99
  • Laughing Cow Babybel cheese, WF $4.99, TJ $3.29
WTF? I'm not planning to go back until I run out of quinua...

Friday, January 16, 2009

Excellent Linksys/Sipura SPA-3102 Experience

As a result of my migration from a noisy, overheating mid-tower server to a near-silent Mac mini Core Duo with a DAT Optic 4-bay FireWire enclosure, I could no longer use the Digium X100P clone FXO internal PCI card. Therefore, I needed an external device with an FXO port to which to connect the incoming phone line from the building lobby (please see this earlier article for more context).

I was also hoping to replace or at least complement the Digium S101i IAXy analog telephone adapter (ATA), which is not reliable enough for everyday residential use because it frequently goes into an inconsistent state and gives a busy signal instead of a dial tone.

Fortunately, the Linksys/Sipura SPA-3102 is exactly what I needed. It is a SIP-based ATA with both an FXS port, which provides a dial tone to my existing apartment phones, and an FXO port, which receives calls from the building lobby. Surprisingly, at about $75, it is cheaper than the IAXy. As long as you don't need support for the IAX protocol, you're probably much better off with this rock-solid device. It also has a web interface and supports numerous features that I am actually using, such as distinctive ring.

I connected mine to my existing Asterisk server following some of these instructions and the device's manual. I configured the following dial plan for the PSTN line to transfer incoming calls immediately to the given extension:

S0<:sipura-fxo-incoming>

In Asterisk, I can then receive calls on this extension like so,

[sipura-fxo]
exten => sipura-fxo-incoming,1,Goto(intercom,s,1)

using the context I specified in the ATA's SIP registration shown here. (The authentication settings in the ATA configuration has to be consistent with Asterisk's SIP configuration.)

[sipura-fxo]
context=sipura-fxo
type=friend
host=dynamic
username=sipura-fxo
secret=******
disallow=all
allow=ulaw
canreinvite=no
qualify=yes
insecure=port,invite
nat=no

[sipura-fxs]
context=sipura-fxs
type=friend
host=dynamic
username=sipura-fxs
secret=******
disallow=all
allow=ulaw
canreinvite=no
qualify=yes
insecure=port,invite
nat=no

Wednesday, December 10, 2008

Solved: weird problem with special characters in filenames

After moving my iTunes library from my Mac to a directory on an Ubuntu Linux server mounted via CIFS, iTunes could no longer find a good number of songs. All of the problematic songs had special characters such as accents in their filenames.

After trying a few different things over the course of several weeks, I finally noticed that the problematic names had the plain characters followed by so-called combining accents.

For example, instead of instead of a simple Ñ they had an N followed by a combining tilde. CIFS clients, including OS X Finder and smbclient could not handle these combined versions, and the files were inaccessible.

Fortunately, the convmv utility can fix this problem in bulk for a whole directory tree:

convmv -r -f utf8 -t utf8 --nfc .

It appears that the key was to convert the filenames into NFC Unicode normalization form (--nfc argument), typically used on Linux. It does not seem to work with NFD, typically used on Mac OS.

Update on Monday, August 17, 2009, 20:36

This problem just came back to haunt me when trying to synchronize the recently modified version of the iTunes library on OS X (NFD encoding) with the one on the Linux server (NFC encoding) using the Unison file synchronizer via ssh (not via CIFS, for better reliability). It turns out that the released and beta versions of Unison do not yet solve this problem. After I found this discussion, I downloaded and built the most recent revision from the repository and am running it with the unicode=true option, which makes it handle this situation correctly. The non-GUI version built out of the box without problems on OS X and Ubuntu with the most recent OCaml. That's one more loose end tied up...

Thursday, October 23, 2008

Hauppauge Win-TV-HVR-950Q Works With Ubuntu Hardy on Mac Mini G4

I have had a very robust MythTV setup since spring 2005 using a Hauppauge WinTV-PVR-150 Media Center edition. Given the impending conversion to ATSC digital TV in February 2009, I ordered a Hauppauge WinTV-HVR-950Q external USB digital TV capture device.

Meanwhile, to reduce noise, heat, and power consumption, I am also switching from an i386-based workstation/server to an almost silent Mac Mini PowerPC G4 1.25 GHz running Ubuntu Hardy server with the lightweight Xubuntu desktop.

Today, I received the 950Q and was able to install it on the Mini without any trouble following Scott Bronson's detailed instructions to the letter. Thanks, Scott, for providing these wonderful, accurate instructions!

The Mini is too slow to play live video without mplayer's -framedrop option, but it is mostly a server anyway. The next step is to configure MythTV to record from the 950Q...no problem.

Meanwhile, I have upgraded all my systems to Jaunty, where the device is supported out of the box once you copy the firmware to /lib/firmware. Please see my recent comment for more details.

Saturday, October 11, 2008

Simplified Gizmo5 Backdoor Dialing Asterisk Gateway Interface Script

Using Gizmo5 backdoor dialing, one can make free VoIP calls to a growing double-digit percentage of domestic US phones. This article shows how to integrate this mechanism into FreePBX.

In an earlier article, I described a DYI VoIP setup that uses plain Asterisk for routing calls among various VoIP providers, analog phone adapters (ATAs), and the building door phone. Since I wrote that article, I have moved this Asterisk installation to a Linksys NSLU2 ("slug") and want to keep it as minimal as possible.

Starting with an updated version of the Monetra callerID lookup script, which performs some very basic screen scraping to look up callerID information from several web sites, I wrote a similar script that checks whether a given phone number can be called for free using Gizmo5 backdoor dialing and caches the result. Gizmo5 has a very simple web service for this purpose that powers its lookup form.

The script can be used in extensions.conf as follows, assuming your Gizmo5 account is set up correctly in sip.conf.
[macro-gizmo5backdoor]
exten => s,1,AGI(gizmo5backdoor_shell.agi|${MACRO_EXTEN})
exten => s,n,GotoIf($[ "${foundroute}" = "yes" ]?backdoor:pstn)
exten => s,n(backdoor),Goto(backdoor,010${MACRO_EXTEN},1)
exten => s,n(pstn),Dial(SIP/other-provider/${MACRO_EXTEN})

[domestic]
exten => _1NXXNXXXXXX,1,Macro(gizmo5backdoor,${EXTEN})

[backdoor]
exten => _0101NXXNXXXXXX,1,Dial(SIP/gizmo5/${EXTEN})
Both scripts are available from the Asterizmo project site.

Thursday, September 25, 2008

Exporting Contacts from Plaxo to Nokia 6100

Instead of using up my equipment credit from T-Mobile for signing a new contract, I am using a Nokia 6100 my friend from Germany had given to me. This is a nice and small mid-range phone.

The challenge was to prepopulate the new phone with a selection and projection of my contacts stored on Plaxo. I was not even looking for bidirectional synchronization because I don't mind making incremental changes on both Plaxo and the phone, as long as I have the ability to back up the phone data reliably.

Based on information available on the Nokia support site, I ordered an original Nokia CA-42 true USB cable (among other accessories) for US$22 instead of a cheap DKU-5 clone that merely emulates a serial connection over USB.

The situation:
  • This phone is not supported by Apple iSync.
  • It is supported by the Nokia PC Suite. Because I don't run Windows natively on any machine (not a safe practice in my opinion), I installed the Nokia PC Suite on a VirtualBox VM running Windows XP. On a Mac host, I couldn't connect because the Mac grabs the USB device so Windows thinks its already in use. On a Linux host (I use Ubuntu Hardy 8.04), I could connect the phone just fine, but the phone book component of the suite kept crashing miserably and repeatedly and I decided to abandon this route.
  • It is also supported by a shareware program for the Mac called MegaCellX. Although this is a nice program that supports a number of phone models and integrates with Address Book, on certain Nokia phones it does not support multi-number contacts, so you get multiple entries on the phone for people with more than one number.
I eventually got the job done this morning around 3 as follows:
  1. Plaxo itself does not support selective export, but Address Book does (synchronized via Plaxo for Mac, and Plaxo's user-defined categories show up very nicely as groups in Address Book. I exported a selection of about 150 contacts in the (text-based) vCard 2.1 format.
  2. Using a combination of grep and Emacs, I manually fixed the following kinks that cause problems with the next step:
    • illegal characters in phone numbers (anything other than digits, *, +, or p) (everything up to this point does get imported, but you need to switch to SIM contacts and back to memory contacts to refresh the view)
    • use of FN: instead of the expected N:
    • strings in non-quoted-printable UTF-8 (I cannot believe this is still broken in Address Book) show up as empty fields but don't disrupt the import
    • unnecessary fields (this is the projection part)
  3. Using Wammu on my Linux box, I transfered these contacts to my phone! I had to cycle a few times between the preceding step and this one until all contacts got imported cleanly. I still had to do some editing in Wammu to add special characters in names etc.
  4. For some multi-number contacts, I changed the default number on the phone.

Finally Switching from Verizon Wireless to T-Mobile

I finally threw off the shackles of Verizon Wireless last Wednesday. I chose T-Mobile instead for the following reasons:
  • I sometimes travel internationally and am much better off with a pure GSM provider.
  • Verizon is very slow to establish agreements with countries that do have CDMA networks.
  • There are countries where dual-mode phones from Verizon will not work at all. This is generally the case for GSM countries with American frequencies (850/1900 MHz) such as Bolivia and Paraguay.
  • T-Mobile doesn't lock down its devices the way Verizon does. I can install my own apps much more easily.
It also turns out that myFaves is a real winner. If you have a provider with a non-800 access number, you get close to unlimited outbound calling.

See also: