Jeff's Musings

Sunday, December 6, 2009

It's working!

With the first real snow of the season threatening, I figured I should gas up the snow blower and make sure it starts up. After a few unsuccessful tries, I let the snow blower sit for a while. After I came back after thirty minutes or so it started up on the 2nd pull. Maybe I flooded it the first time or maybe it just took a while for the gas to work it's way though the lines. In either case it looks like I'll avoid the heavy shovelling for another season.

Friday, November 20, 2009

The Asterisk SLN16 Codec

Google failed me, so I figured that I'd memorialize it here... Here's how to convert to/from Asterisk's SLN16 format using GStreamer:

From SLN16:

gst-launch filesrc location=<filename>.sln16 ! audio/x-raw-int,signed=true,rate=16000,channels=1,width=16,depth=16,endianness=1234 ! audioconvert ! vorbisenc ! oggmux ! filesink location=<filename>.ogg

To SLN16:

gst-launch filesrc location=<filename>.ogg ! decodebin ! audioconvert ! audiorate ! audio/x-raw-int,signed=true,rate=16000,channels=1,width=16,depth=16,endianness=1234 ! filesink location=<filename>.sln16

Thursday, November 19, 2009

Generating Random Passwords With Python

Every now and then, I need to generate a password for use with something or other that I won't be typing in very often. For maximum security in these situations I like generating a long randomly generated password. Here's a quick Python snippet for generating them:

$ python
Python 2.6.2 (r262:71600, Aug 21 2009, 12:23:57) 
[GCC 4.4.1 20090818 (Red Hat 4.4.1-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> file('/dev/random', 'rb').read(12).encode('base64')
'XIUhRiMM/kcmsQl8\n'
>>> file('/dev/random', 'rb').read(12).encode('base64')
'BkgURdSXKORS8In/\n'
>>>

It's such a short snippet that I haven't ever bothered putting it in a script file, I just fire up a Python interpreter and type it from memory.

Thursday, November 12, 2009

ADSL Bummer (and Closed Source Object Lesson)

Vyatta announced an alpha release of version 6 of their Linux-based router software. I've been using Vyatta version 5 since it was in beta test because they have integrated support for my Sangoma S518 ADSL Modem Card. Before Vyatta version 5 I was using Fedora and manually installing Sangoma's drivers. However, Sangoma's drivers contain binary blobs and I was never able to keep my router from locking up every few days. Vyatta's engineers were able to figure out how to keep my router stable in spite of the binary blobs, which made me very happy. I had Linux on my router/firewall and I didn't have to switch from ADSL to cable modem. My wife was happy because the router didn't crash every couple of days. About the only downside was the confusion my non-standard setup caused my ISP's tech support the few times that I had to call them.

Unfortunately Vyatta will be removing ADSL support from the free version of their software in version 6. I could get a software subscription from Vyatta and keep the ADSL support, but at $750 even the cheapest subscription is way more than I can justify. For now I'll stick with version 5 and keep my ADSL going, but eventually I'll have to look into a different solution.

As far as I know, there are no solutions for ADSL interfaces that have open-source drivers available in the US. If there is a solution I haven't found it yet. I'd rather not go back to installing the Sangoma drivers on top of a standard Fedora install, although that would mean that my router would be based on Fedora again rather than the Debian base that Vyatta uses. Nothing against Debian, but I'm much more comfortable with Fedora since I use it daily on my laptop and other systems I manage. I'd really rather not go back to a cable modem, as I left our cable company for ADSL because I didn't care for how the local cable company did business.

I suppose it's too much to hope that someone will deliver fiber to my door in the next few months...

Asterisk and Gizmo5

Here's how I got my Gizmo5 account working with Asterisk. Note that I have only tested inbound calls (Gizmo5 charges for outbound calls). 1747XXXXXXX is the SIP number automatically assigned to your account for free, not any of the other DID numbers you may have purchased.

sip.conf

[general]

register => 1747XXXXXXX:<password>@proxy01.sipphone.com/gizmo5

[gizmo5]
context=from-gizmo5
type=friend
disallow=all
allow=ulaw
allow=gsm
dtmfmode=rfc2833
host=proxy01.sipphone.com
fromdomain=proxy01.sipphone.com
insecure=invite,port
qualify=yes
fromuser=1747XXXXXXX
authuser=1747XXXXXXX
username=1747XXXXXXX
secret=<password>
canreinvite=no

extensions.conf

[from-gizmo5]

exten => gizmo5,1,Dial(SIP/line1)

Wednesday, November 11, 2009

Got my Google Wave nominations...

Don't get too excited, I only received 8 and they are already gone...

Tuesday, November 3, 2009

KVM Goodness

KVM seems to be holding up well, and thanks to the generosity of my employer in getting me a dual-CPU laptop I can run one guest and barely notice any slowdown in my normal activities. Having two guests running seems to slow things down a touch, but it's something that I could live with if I had to. Normally I won't be running guests at all but it's nice to have the capability when I need it.

I went all out today and installed Windows 7 64bit Enterprise in a virtual host. Surprisingly it works well although I think I may be missing out on some of the bling due to 3D driver issues - I'm not sure as I've never run Windows 7 on "real" hardware, and I have only minimal experience with Vista. I'm having better luck than a co-worker that tried Windows 7 on a spare PC but gave up on it because the video card appeared to be unsupported.

KSM (Kernel SamePage Merging) seems to be working, this is from when I had two guests running - one running Windows XP (32bit) and one running Windows 7 (64bit).

[root@lt26923 ~]# cat /sys/kernel/mm/ksm/pages_shared
1
[root@lt26923 ~]# cat /sys/kernel/mm/ksm/pages_sharing 
38430
[root@lt26923 ~]# cat /sys/kernel/mm/ksm/pages_unshared 
378

At least I think that's what these numbers mean... I haven't dug too deeply to understand what they really mean.

The one thing that doesn't appear to be working is sound. Windows 7 doesn't appear to have the correct driver for the virtual sound card and in Windows XP the virtual sound card gets matched up with a driver but I don't get any sound out of my speakers. I'm not super concerned as I don't plan on using the guests for anything that would make sound necessary.