Project List

written by edavis on June 30th, 2007 @ 05:35 PM

I also maintain my portfolio of client work over at Little Stream Software

Maintainer of

Contributed to

Powered by Mephisto

written by edavis on May 23rd, 2007 @ 10:46 PM

theAdmin.org is now powered by Mephisto. I just felt disconnected with Typo and have been watching Mephisto for a little while now.

So far all of the content was migrated properly, the old permalinks should be working due to the mod_rewrite configuration below.

# Redirect for Typo permalinks 
# RewriteRule ^/articles/(.*) $1 [R=301,L]   # Only needed if you use the default permalink structure in mephisto
RewriteRule ^/category/(.*) tags/$1 [R=301,L]
RewriteRule ^/xml/(.*) http://feeds.feedburner.com/theadmin [R=301,L]

Needless to say, some things will be out of place for a while as I cleanup and watch the 404s come in.

Eric Davis

gs_phone - Ruby program to remotely configure Grandstream Voip phone

written by edavis on March 23rd, 2007 @ 01:30 PM

I have just released version 0.0.2 of my gs_phone Ruby program but I have not yet written about it yet so think of this as your introduction to my program.

What is it?

It is a set of Ruby scripts that can be used from the command line to administer a group of Grandstream Voip phones. It started as a small project at my work, which I was later allowed to Open Source. Currently it is just a pretty wrapper for a Perl program gsutil written by Charles Howes. Later on I hope to replace his utility with a pure Ruby implementation.

Why not just use the Perl one?

One, it is in Perl and I can’t hack Perl that good. Two, gsutil is good for one phone or a few phones but if you need to manage more phones than that, it becomes a chore. So gs_phone uses gsutil to communicate with the phone but gs_phone has it’s own features outside that gsutil does not.

What Features?

  • YAML database that stores the ip address, extension, username, and MAC address of the phone.
  • Group commands, like rebooting all of the phones at once.
  • Simple command syntax, modeled after Subversion

The TODO.txt and ROADMAP.txt offer a more detailed list of upcoming features.

How do I get it?

There are three ways to get gs_phone.

  1. (Recommended) Grab the gem from Rubyforge. It is packaged like many other Ruby libraries and this will let you keep up to date and any changes to the program.

    gem install gs_phone
  2. Grab the archive file from Rubyforge.

  3. Get the latest Subversion copy. The repository is public for reading so a quick checkout should work.

    svn checkout https://svn.theadmin.org/public/gs_phone/trunk/ gs_phone

    You can also get the release code in the tags folders

     svn checkout https://svn.theadmin.org/public/gs_phone/tags/release-0.0.2/ gs_phone-0.0.2

In order to use gs_phone you will also need to download gsutil from Charles Howes. The main file we are looking for is called gsutil

How do I use it?

  1. First you will need to run gs_phone to have it setup a folder and some files for you. Currenly they are hardcoded to HOME/.gs_phone but they could change soon. Just run gs_phone and it should notice you need the files and create them for you.
  2. Next you need to point gs_phone to your gsutil program. You can either copy gsutil into HOME/.gs_phone or modify the config.yml for gs_phone to point to the correct location.
  3. gs_phone should now work. Run the help command to get an idea of some of the functions. You can also run help on a command to see what a specific command does.

Examples:

$ gs_phone help
Usage: COMMAND [options]

COMMANDS       DESCRIPTION
new            Add new user and setup their phone 
add            Adds a user to the phone database
make           Generates a config file from the template
update         Uploads the configuration file to the phone
reboot         Reboots a phone 
find           Find the ip address in the configuration file

$ gs_phone help update
Usage: update IP_ADDRESS [CURRENT_ADDRESS] [ADMIN_PASSWORD]

Sends the updated configuration file for IP_ADDRESS to the phone.

Optionally, a phone configuration can be sent to a phone that currently has
a different ip address by using CURRENT_ADDRESS

The admin password from the configuration file can also be overridden

Ex:
  update 192.168.1.200
  update 192.168.1.200 192.168.1.10  <= Send '200's update to the phone at '10'
  update 192.168.1.200 192.168.1.10 admin <= Also uses the factory password

Eric Davis

Binding special keys in emacs

written by edavis on March 13th, 2007 @ 05:00 PM

Like any Emacs user I have some custom keybindings for the common actions I do everyday. Some of the bindings are easy to find but today I specificity wanted a new keybinding to use the “up” arrow.

After some trial and error, I found this works perfectly:

(global-set-key (kbd "<f9> <up>") 'planner-move-up)
(global-set-key (kbd "<f9> <down>") 'planner-move-up)

Don’t forgot the quote before the Emacs function name. You want to bind the function, not the result of the function to the keybinding.

Eric Davis

Quick guide to setting up a Debian apt repository

written by edavis on March 12th, 2007 @ 04:21 PM

This is my quick guide to setting up a Debian apt repository:

  1. Install the needed software

    apt-get install apt-utils

  2. Create the directory structure under the webroot

    mkdir -p /var/www/apt/sarge

  3. Add the created .deb files to the archive

    cp mypackage-1.0.deb /var/www/apt/sarge

  4. Update the package list to reflect the new package.

    cd /var/www/apt
    apt-ftparchive packages sarge > sarge/Packages
    
  5. Gzip the package list to save space and bandwidth

    gzip -f sarge/Packages

  6. Update the Release file to reflect the new package

    apt-ftparchive release sarge > sarge/Release

Now you can add the apt line on your client’s /etc/apt/sources.list and apt-get update to see your freshly minted package.

## Maps to http://apt.theadmin.org/debian/sarge/Packages.gz
deb http://apt.theadmin.org/debian/ sarge/

Eric Davis