Category Archives: Tech Notes

Personal VOIP/PBX using Asterisk, part 1


Voice over IP is simply placing phone calls over the Internet instead of  traditional phone lines. This means the calls are usually cheaper, but not free in many cases since often the telco lines have to get involved at some point to either originate or terminate a call. However, true voip calls are almost always free, no matter where in the world they are.

There are many commercial products out there already that makes this easy for a user, like Vonage and Comcast’s voice, but they have fairly hefty monthly fees. They do usually offer unlimited domestic (U.S.) calls.   But they also have drawbacks, like, ah not working if the power or cable goes out.

The next few posts will document my experience in rolling my own voip service.

Part 1 is compiling the support drivers on my “Linode” for Asterisk.

Click through for the details…

Continue reading Personal VOIP/PBX using Asterisk, part 1

WordPress migration to new host

I purchased a new VPS (virtual private server) host and have been moving many blogs I host for myself and others to the new host (Linode — which I’m very satisfied with and recommend highly). There’s multiple ways to do this, including just saving the mysql table as a backup, and reimporting, but since I’ve already created blogs on the new host, using the wordpress export, then import, features sounded like a good idea.

And it was, except for a few potential show stoppers that I hit, and I later cleaned up.

One blog was being split into two. All topics about Second Life were to go into the new blog and everything else carried over with the same blog name.  So theory was to import the data twice into each blog on the new host, then delete unwanted data.

Two issues hit me. In the examples below the old site is named and the new one is

1) Even though I swore I told it to also import thumbnails, it imported the pictures from the old site, but the thumbnails were still IMG SRC’ed to the old site.  ie, the HTML on the new site had the URL of the old site for the thumbnail and the main pic linked on the new site as expected. This required two steps to solve. One was to copy over from the downloads directory manually all files that weren’t imported. The second was a scary find/replace in the database of all links to the old site URL and replace with the new one. Fortunately, it was fairly easy using SQL.

update lc_posts SET post_content = replace(post_content,"","");

Basically find all references two and change to  

2) The harder one was I couldn’t log onto the blog, at all. Got a permission denied. I had to change the db prefix to get two new sites out of the old one, and doing so caused logon problems. To fix that required a few more edits on the wordpress db tables.

update `lc_usermeta` SET `meta_key` = REPLACE( `meta_key` , 'voices_', 'lc_');
update `lc_options` SET `option_name` = 'lc_user_roles' WHERE `option_name` = 'voices_user_roles' AND 'blog_id' = 0;

Not bad. Of course, back up everything before going into DB surgery like this, cause you could always kill the patient, and that’s not good!

Another minor complication from moving a blog this way is that the blogroll and other lists of links don’t come over. In order to do that, must use OPML data to do so.

I got these steps from googling, but unfortunately lost my browser history and can’t find  now what sites I used to dig this up to give them credit, so feel free to return the favor and don’t give me credit if you blog about this either!

Update: 11 Jan 09

I found a far better way is to simply export and import the mysql data. NOT THE ENTIRE DATABASE (unless you are moving over all your blogs) but just the tables associated with the blog being moved.  This requires access to the database the blog lives in on both hosts.  Since I use MySQL it was as simple as (assuming the db name is wordpress and the table prefix is example_:

mysqldump wordpress  > /tmp/blogs.sql

Then edit the blogs.sql file using a text editor and remove any lines referencing tables that do not begin with your prefix_ and save. Note some lines can be horribly long so use an editor that supports very long lines. I used emacs. 

After editing, transfer file to new host and then simply run “mysql wordpress < blogs.sql” where blogs.sql is the edited and copied file from above. 

Note: You may have to specify -u and -p options to the mysql commands above if they are not specified in a cnf file somewhere.

Finally, after doing that copy your entire wordpress directory tree from source host to destination, checking the wp-config.php file to ensure it all is still set up correctly for the new host.

For those who don’t have access to their databases or doing this makes you nervous, I still think the export/import procedure is the best.

Defining multiple cell modems in Leopard

I have two cellular data services that allow me to “tether” to them to provide Internet to my Mac.  No, I’m not mad. One is provided by my work for work purposes only, the other is personal.  The problem I had for a while was not knowing how to configure OS X to have both modems defined and usable. I would delete the settings for the old one and recreate the new one.  

But there is a way to do this using multiple bluetooth serial ports. This guide will show you how.

The phones in question and the connections are:

  • Motorola V3M using Verizon’s Broadband Connect Service via USB cable
  • Motorola V3M using Verizon’s Broadband Connect Service via Bluetooth
  • Nokia N95 using T-Mobile’s Total Internet service via Bluetooth

Using a USB cable is easiest to configure and at least allows the phone to not lose battery while being used (using Bluetooth drains the phone’s battery fast).   However it is a hassle at times when you just need a quick connection. It’s nice keeping it in the pocket for those purposes.

While this guide is specific to these model phones and services, the ideas presented should work for similar situations with some minor modifications. 

Continue reading Defining multiple cell modems in Leopard

GoDaddy SSL certs and Symbian phones

I recently got a cool Nokia N90 smart phone but it throws up SSL certificate warnings when used with GoDaddy issued SSL certificates. These certs are nice because they are only $30/year instead of several hundred for Verisign. Allegedly they work with all modern browsers. Sigh, not with the latest Symbian devices.

Not only does it barf on websites that use GoDaddy, but also with my imap and smtp ssl certs used for my email. A pain when reading or sending on the N90.

I ensured the intermediate certificate was installed in the server correctly but that didn’t work.

Then I found a posting on Nokia support forum that said to install the root certificate in the phone using its native browser (not Opera). Which I did, by browsing to GoDaddy’s SSL certificate page and downloading the “Valicert Root — DER Format” root certificate. Once clicked, the phone’s browser prompts to install the cert and that root cert works for email as well!

Now I’m happy again!

Rescaning SCSI bus for SAN disk adds

This should not have been as difficult to do as it was. Simple concept, add disks and hence LUNs to the scan, and you want to use them on your host without having to umount all disks and reload the scsi driver.

There’s a script to rescan the scsi bus from a website that automates the process, but it didn’t work on one host I tried it.

I found that since we use qlogic drivers there’s a command that has to be run first to let the driver know that a rescan is coming (I guess).

echo "scsi-qlascan" > /proc/scsi/driver-name/adapter-id

After running it, I got this goodness in fdisk for the new device! 🙂

Disk /dev/sdd: 2000.4 GB, 2000414572544 bytes

Firefox popups

Just so I don’t forget, here’s how to stop Flash popups from Firefox.

  1. Type about:config into the Firefox location bar.
  2. Right-click on the page and select New and then Integer.
  3. Name it privacy.popups.disable_from_plugins
  4. Set the value to 2.

Moving data with mirrors

The main data volume on the system at work ran out of PEs due to the old default PE size of 4 MB and 64k of PEs being in the volume group. There’s no way to change that without recreating the volume group, and blowing away everything. So I have to move the 250 gigs of crap to somewhere else, then delete the old volume group, recreate it, then move everything back. Since moving that much data requires several hours and hence downtime to users, that’s not good.

So, the idea is to move the data around live. This requires making a RAID 1 mirror on top of lvm — not usually done this way. It also requires learning enough about mdadm to be able to create a mirror without destroying the good data (ouch). The process of intially creating the mirror will require the regular lvm device be unmounted and the RAID (md) device mounted. But after that is done, the syncing of the mirror can happen live. Hence downtime is kept to an absolute minimum.

Continue reading Moving data with mirrors

Evaluating Groupware

The quest has been given, to determine a good groupware package for where I work. The main component needed is a shared calendar interface. We currently use sendmail on a linux box as an MTA, uw-imap as an imap server, and mailboxes are stored in “mbx” format. For mail clients, we allow any imap client and provide a webmail client from the fine folks at

The current version of horde we use has a calendar that is private only. The new version provides many groupware features including shared calendars, however, we are going to look at other groupware products as well.

It’s been basically narrowed down to either Microsoft Exchange or the latest set of Horde apps. One of my techs has set up a test exchange environment and to say it’s bloated is an understatement. Now granted it does a lot, but everything I hear is that most organizations hardly use all of Exchange features. There’s also a huge hardware cost. We do 40,000 email accounts on one dual-xeon 3 ghz box runnign Linux. Apparently we need a farm of several exchange servers to handle that kind of a load. Even only giving 10% of our users exchange would require at least four servers (two front-end and two back-end). Ouch.

Regardless, I have no religion about either platform, as long as the resources are provided to adequately support the chosen platform.

So this blog entry is mainly a place holder to jot down notes and experiences and is not going to be complete. So don’t consider this a formal case study or implementation guide. It will also focus primarily on horde since another tech has done Exchange. Hence it may seem biased towards that product.

NOTE: This is all done on Redhat Enterprise Linux (RHEL) 4