Archive for the 'open source software' Category

Convert PAL DVD to NTSC DVD in Linux

My instructions are derived from the following guide. The only changes are as follows:

  1. I need to copy my VOB files off the DVD into one giant file by doing a vobcopy -l -t myvideo to copy the files from the DVD to the present directory. The DVD will already have to be decrypted
  2. I’m ripping from a PAL DVD to an NTSC DVD, not from an AVI or MPEG file. Therefore, I need to point to my .vob file like as follows:

    mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:480,harddup -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=18:aspect=16/9 -ofps 30000/1001 -o myvideo.mpg myvideo.vob

  3. If you are ripping TV episodes, you will probably want to separate each episode into chapters, so note the times in which each episode begins and ends and enter this into your dvd.xml file
Published in: open source software | on January 6th, 2008 | No Comments »

Run OS X Leopard iCal today!

Okay, this subject is sort of false advertising, but…

Mozilla Sunbird used to be pretty rough and ragged, but I’ve been impressed with their recent 0.5 release which came out earlier this summer. It seems to work just fine under OS X.

One of the features in 0.5 is iCal support. I was able to subscribe to my existing iCal calendars no problem, as well as import iCal calendar files. It seems to work fine.

The main, compelling reason to use either iCal in Leopard or Mozilla Sunbird today is for its CalDAV support. CalDAV will allow multiple users to read and write to the same calendar. In other words, you could publish a calendar you created at home and write to it at work.

In order to do this, you will need a Calendar server to do this. Apple’s own Darwin Calendar Server is open source, and the developers say it is pretty much done. I’ve been running it without incident for quite some time now.

Like Apple’s other open source projects, setting it up is very easy to do. There is an included script that will install Calendar Server for you, and you can do this on any Unix-based machine. It obviously works out-of-the-box on Tiger Server or Cilent, but people have also gotten it running under Linux, and I had little difficulty installing it under FreeBSD using the Linux install instructions.

If you have access to any old spare computer with an internet connection, you could set yourself up a calendar server pretty easily. Apple includes a template configuration file, all you have to do is change the path to the calendar storage directory on the server, if you want, as well as setup your authentication to this machine. The default authentication is simply XML file based auth, all you have to do is type in a user/pass into the XML file for your realm.

Published in: OS X, open source software | on August 6th, 2007 | No Comments »

Use Request Tracker (RT) for logging time and tracking projects

I have had great success and have really benefited from using the open source software RT (Request Tracker) as a trouble ticketing system for use with my clients, and also as a means to log time spent on projects and provide clients with access to the self-serve interface for providing read-only access their tickets so they can see exactly how their billable time was accounted for.

Since a number of organizations are using RT, I won’t go into detail as to how to set it up and use it for basic operation (unless you might find this guide written for my graphic designers detailing how to log time in RT of use). However, I will share some enhancements that have been quite useful.

One enhancement is creating a shared mailbox where RT ticket information is sent via its AdminCC function. I have configured myself as an AdminCC for each RT queue, and have setup mailfilter rules (to work with Courier IMAP, if you are using the Cyrus mail server you can create sieve rules) to file these messages into this shared mailbox based on whether the sender address includes the text “Firstname Lastname via RT”.

I have provided my designers with read access to these shared mailboxes so that all our correspondence on these projects is logged into this folder. As a bonus, we can append to these tickets simply by responding to them within our email out of this shared mailbox.

If you want to take this a step further, you can install the “CommandByMail” RT plug, which will allow you to resolve tickets and perform a number of other functions via email as well.

Published in: open source software | on May 18th, 2007 | No Comments »

Editing htaccess mod_rewrite commands through a web interface

I really like the way that WordPress will write changes to its .htaccess file in order to generate nicer, mod_rewrite driven permalinks. I wanted a means for my customers to be able to create their own URLs that would correspond to WordPress generated Pages. This this feature doesn’t exist at time of writing, this is something I’ve been looking into writing myself and including within the Webkit.

Preface: I haven’t actually developed this solution yet, but I’m confident it will work. I will report back later with my findings…

My plan here is to read from the .htaccess file, and use pattern matching to filter out htaccess data unrelated to this task. This data will be dumped into an array line by line, and displayed within a form with a simple interface that would resemble something along the lines of:

Display WordPress page ID #: [ID] via URL: [URL]

where “ID” is a form field accepting input corresponding WordPress ID, and the URL is for typing in a URL such as “mypage.html”.

In addition, the array output will be sent along with form input as hidden form variables so that the form processor is able to do a search and replace of the old rewrite rule with the new one, using its own logic to generate the specific required pattern matching syntax. This output will be written back to the site’s .htaccess file, as long as the file is set with writable permissions.

For reference purposes, here is an example of an htaccess rewrite command that this Webkit component would manipulate:

RewriteRule ^mynewcd.html$ /wordpress/?page_id=34

Published in: Webkit, open source software | on May 18th, 2007 | No Comments »

Creating an alternate AJAX Mailman web interface

Edit: the following instructions no longer seem to work. I have replaced these by writing to a file, picking up the contents of this file via a cron job, and using the included Mailman “add_members” binary to pick up the contents of this file.

As is the case with a number of web applications, one of the ongoing problems includes negotiating using a web interface as a bridge and functional interface into making system modifications securely, while acknowledging the fact that in most installs the Apache user will be different than the user(s) with the appropriate permissions to execute your Unix scripts and binaries over an SSH session. For commands and scripts that may affect a number of users on your system, typically only the root user may have executable permissions.

One such instance in which these restraints and challenges comes to the fore is in developing a more user-friendly, alternate Mailman web interface for users. Mailman is a superb mailing list with a robust plethora of features, but if you wish to make this available to a novice user simply to, say, subscribe users in bulk to an opt-in mailing, there are a lot of extraneous features the user will be forced to wade through. Additionally, I always thought that the unsubscribe process was a little unwieldy for a list configured to send out “one-way” mailings (i.e. a musician who wants to send out information to fans, but doesn’t want to invite responses to the entire list). I had envisioned it to be a simple form, preferably styled to match the look of the site. The subscriber in this instance does not need to be concerned with digest options and such, so there is no need for these options to even be displayed.

It seems like the two ways to go about customizing the web interface is to actually patch and markup the Mailman code base to your liking, or else simply piggyback upon the forms and binaries provided by Mailman, replacing the interface with your own.

Preface: I haven’t actually developed this solution yet, but I’m confident it will work. I will report back later with my findings…

I’ve developed my own subscribe and unsubscribe forms that mimic the ones provided by Mailman, setting up identical form fields that direct form output to the same Mailman pages. An example of my subscribe page can be found here. To enhance this, I setup a root cronjob to use the included Mailman list_members binary to generate a listing of members subscribed to the list, and save this output to a file that is inaccessible from the web. I then setup the subscribe email address field to trigger an AJAX request to grep for the email address in this list. If it is found, a “you are already subscribed to this list” message will be generated even before the form is submitted. You can use Javascript to hide the form submit button when the address provided has already been subscribed to the list.

Mailman’s normal form interface is designed to generate these errors, but I found them a little ugly and wanted to replace them with my own. I also wanted embed these feedback within my own site template. Mailman provides the means to modify the subscribe/unsubscribe feedback templates within its web interface, but I wanted to include PHP code in this template, and go beyond simple HTML. So, I decided to not rely on Mailman to generate this feedback, and simply replaced the Mailman subscribe feedback template with a meta redirect to a page of my own.

So, to summarize, I’ve basically replaced the logic behind examining an incoming subscription address with an AJAX call, and replaced the feedback that Mailman provides with pages of my own. The unsubscribe form can be designed in a very similar fashion.

What about providing mass subscription type functionality?

This is the part I’m still working on. I’ll need to find a script (or write one of my own) to convert vcard data to a list of addresses I can feed to Mailman, and I’ll need to design this web interface.

I intend for the web interface to work in a similar way as described above, where addresses are read from a flat file generated by the cronjob. Using this data, I can provide an AJAXey interface for manipulating the addresses in this list, and create another root cronjob to read this file an execute a remove_members and add_members to replace the list addresses with those in this file whenever this file is changed.

The one weakness of this approach is that there will always be a time delay and a lack of immediacy while the user waits around for the cronjob to run. This can be made a little more user-friendly by providing feedback that “your changes will take effect in 3 minutes”, or whatever, and having feedback emailed to that user’s email address.

Once the Webkit is released as an open source product, I may include this module for those that wish this functionality, in addition to my “Mailman HTML mailer” module.

Published in: Webkit, open source software | on May 18th, 2007 | No Comments »

Password protect your Mediawiki wikis

I found the following guide explaining how Mediawiki wikis can be password protected with basic http/htaccess authentication. The Apache directives listed in step 5 of this guide will need to be wrapped in a <Directory> or <Location> tag, as warranted.

Unfortunately, there doesn’t seem to be a way at time of writing to password protect individual wiki pages, but you can use these instructions in conjunction with my “Managing multiple Mediawiki wikis from a single install” post instructions to separate out your wiki content into public and private areas.

Published in: open source software | on May 18th, 2007 | No Comments »

Multiple multiple Mediawiki wikis from a single install

Since I prefer to use the FreeBSD ports tree to install and update software on my server, it is a pain having multiple installs of different versions of the same software scattered across different directories. My goal has been to run all web-based software from a single code base, yet I want the data maintained by these multiple wikis to be separated.

Here is how this can be done in Mediawiki, allowing for separate wikis reading from separate databases:

  1. Make a copy of a virgin Mediawiki database, perhaps calling the database “wikidb_template” (note, you’ll have to keep the schema stored within this DB up-to-date across Medawiki releases, this is explained below…)
  2. Make a copy of Mediawiki’s LocalSettings.php file. Name it something like “LocalSettings-mywiki.php”, where “mywiki” is the name of your wiki.
  3. Create symbolic links from your Mediawiki codebase to the directories you wish to be served by your Mediawiki wiki
  4. Replace the original LocalSettings.php file with something like the following, matching “mydomain.com” with your domain, and the path names to paths matching your symbolic linked directories:

    if (preg_match('/(www\.)?yourdomain.com/', $_SERVER['SERVER_NAME']) && preg_match(’/^\/mywiki/’, $_SERVER['REQUEST_URI'])) {
    // settings file for wiki in path starting with “/mywiki”
    include ‘LocalSettings-mywiki.php’;
    }
    elseif (preg_match(’/(www\.)?yourdomain.com/’, $_SERVER['SERVER_NAME']) && preg_match(’/^\/anotherwiki/’, $_SERVER['REQUEST_URI'])) {
    // settings file for wiki in path starting with “/anotherwiki”
    include ‘LocalSettings-anotherwiki.php’;
    }

  5. Edit each LocalSettings file to modify the database connection information to match the database credentials you have established for each wiki
  6. Create another LocalSettings file pointing to your wikidb_template database. This way, you’ll be able to update the schema to your virgin database as necessary using the Mediawiki web interface updater
Published in: open source software | on May 18th, 2007 | 1 Comment »

Cool software roundup

Here is a partial list of some of my favorite open source tools at present that I suspect are relative well-kept secrets:

  • Synergy: share a single mouse and keyboard between multiple computers
  • Cacti: generates pretty RRDtool graphs of your snmp data (network traffic, CPU utilization, etc.), and keeps historical records of this data
  • RT (Request Tracker): flexible ticket tracking system that you can use via a web interface and/or via an email gateway. RT includes a robust model for assigning granular permissions, allowing you to provide access to a “self-serve interface” for customers where they do not have permission to do more than simply view the status of tickets they opened, limit users to specific queues, etc.
  • Darwin Calendar Server: CalDAV server for storing calendars published through compatible clients (e.g. Mozilla Sunbird, iCal in OS X 10.5, Chandler, Mulberry, etc.) and allowing multiple users to write to the same calendar. See this post for more information.
  • ClusterSSH: invaluable tool to control multiple computers simultaneously over an SSH session.
  • WordPress: the number one blogging tool, also makes a very slick CMS which many NetMusician customers have used with success.  (Okay, this one is not really a well-kept secret, but its usage as a CMS may be…)
  • TinyMCE: cool Javascript based WYSIWYG toolbar for textareas in forms allowing users to generate HTML.
  • Mediawiki: the Wiki that drives the Wikipedia, makes for a great sketchpad and vehicle for providing documentation to users.
  • Gallery: awesome generator of web-based photo galleries you can use with several Desktop clients, and embed into WordPress driven pages via the WPG2 plug

look for my future post listing tools I’ve found invaluable to running OS X

Published in: open source software | on February 19th, 2007 | No Comments »

Sharing personal calendars, allowing subscribers writable access

Using a CalDAV complaint calendar server such as Apple’s Calendar Server or Cosmo with a CalDAV savvy client such as Mozilla Sunbird, Apple’s iCal (as of 10.5), Chandler, or Mulberry, users can share calendars by publishing them to a CalDAV server such as the ones listed here, and CalDAV complaint clients such as the ones listed here can subscribe to these calendars, and even make changes to password protected calendars.

Prior to the emergence of CalDAV, applications like the current version of iCal allowed users to publish their calendars to a WebDAV complaint server, but subscribers to these calendars were only able to read, and not write to these calendars. The CalDAV protocol provides the foundation necessary to overcome this and other obstacles in bringing these solutions closer to the funcionality offered within Microsoft Exchange.

Each of these respective servers and clients are generally of experimental (i.e. unstable) build quality, but certainly Apple seems committed to releasing their server in at least a semi-finished state, and the next version of iCal is expected to play nicely to this server. However, development in products like Chandler seems fairly constant (a preview release promised in Spring 2007), and Mozilla Sunbird seems like a decent, albeit expectedly buggy product for a 0.3 release at the time of writing.

I’ve been testing running Mozilla Sunbird with Apple’s Calendar Server (which I managed to get running under Gentoo Linux, I’m having problems building it under FreeBSD), and so far, while Sunbird clearly lacks a sense of refinement, the basic mechanism seems to work just fine. Apple’s Calendar Server seems pretty simple in its setup and installation (although it does not yet include an init.d script to run under Linux/Unix), but also seems to work just fine. Its data store requires a xattr partition, I had to include a “user_xattr” flag in my /etc/fstab file in my /usr partition (where I opted to maintain this data store), but in some cases some users may have to make adjustments to their kernels.

Calendar Server will support authentication against a flat XML file, or against a variety of directory services. I have not tested auth against a directory service yet, but in providing this feature it seems that Apple has some enterpriseish markets in mind… very interesting. It does not appear that Calendar Server will allow authentication against a Kerberos server, at least not yet.

Once a user has authenticated successfully to the Calendar Server, all of the necessary files in the user’s data store are created on the fly. I have not tested advanced features such as free/busy and sharing among other Calendar Server users.

I will be sure to post follow up reports regarding Calendar Server as I gain more experience with this software.

Published in: open source software | on February 7th, 2007 | No Comments »