Wednesday, August 31, 2011

Dynamic subversion repositories with WebSVN

I am a careful man. For every development project, I have a corresponding Subversion repository that stores all assets relating to the project. For browsing (and blaming diffs), I use WebSVN to provide a friendly interface. I currently use DreamHost to host my repositories.

However, I got tired of updating the WebSVN configuration every time I added a repository. Therefore, I developed a short, dynamic method of just listing them all without need for reconfiguration. Add the following snippet to your config.php:

$repository_root = '/CHANGE/TO/YOUR/PATH/svn/';

foreach(glob($repository_root . '*', GLOB_ONLYDIR) as $repository_dir) {
  $repository = basename($repository_dir);
  $config->addRepository($repository, 'file://' . $repository_root . $repository);
  $config->useAuthenticationFile($repository_root . $repository . '.access', $repository, $repository);
}

Friday, July 8, 2011

Google Music - first impressions of the cloud-based music streaming service

I enjoy listening to music, and keeping my collection synchronized across computers and devices can be arduous. I am fastidious about tagging, using tools like TagScanner to author and normalize the tags, file names and folders. My playback and library needs are minimal; foobar2000 has served my needs nicely for close to a decade.

I wasn't impressed by Amazon Cloud Drive and Cloud Player; their overtly commercial approach (understandable in context), the clunky interface, and limitations of the service turned me off. Amazon has since offered unlimited storage for music if you subscribe at the $20/year level or higher.

Recently, I was invited to try the Google Music Beta, their new streaming music service. Given my previous experience, I was hesitant, but willing to give a competitor a try.

Client

The desktop client download and installation was fairly smooth, except you needed an application specific password. The client linked to the help page that contained in the middle of the content a link to generate that password, which was obtuse. Once I was beyond that, I used the wizard to select a folder to sync, and walked away for the night. The next morning, about 2/3 of the ~5GB folder I had selected had been uploaded.

The next step was to try the android app, which I downloaded from the Android Market. Overall, the interface is nicer than the stock app. I have not tried Bluetooth playback yet.

Android App

Music that had been uploaded was available to be streamed; I picked the first track of an album, and hit play. It churned for somewhere between five and ten seconds, then started playing. Sounded fine. Once you start playing a track, the player will download sequential tracks in the background to avoid this delay. Playback sounded fine.

I tagged and transferred music manually to my android device for a long time before I started using Google Music. When I installed Google Music on my desktop, it uploaded my collection. I installed the app on my device, which correctly listed all the local music along with all the music available to stream.

However, music that was already physically on my device was also listed as available to stream, resulting in two entries for every album and track. This is undesirable, and I shared my feedback with the Music Beta Team.

What happens to your music?

As an experiment, I removed one of the local albums, then downloaded it ("make it available offline") using the app. I used the Wi-Fi connection, and a ~75 MB album only took a couple minutes to transfer.

The music transferred to Android\data\com.google.android.music\cache\music with a numeric file name (ex: 534.mp3), a rewritten track number, and missing the embedded artwork, Album Artist, Total Tracks, Disc Number, Total Discs, and Publisher. The tag type was rewritten from id3v2.3|id3v1 to id3v1. The content looks untouched; same number of samples, bitrate, and so on, The artwork is stored separately, in cache\artwork. The file size was nearly identical, in proportion to the missing artwork and tags.

Both the cache and artwork folder have a .nomedia file (tells default apps like Gallery and Music to not index it).

I understand why they are normalizing tag data (save space - especially with album art, and excludes non-standard or unsupported fields), but it's irritating to have two different file versions.

It's not impossible to copy out the music from your android device once it's in there (if you want to copy an album from your device to another computer, for example). You cannot download the music from their web interface. They want you to use their application to listen to it, and they're avoiding the slippery slope of making it easy to duplicate your collection.

I have a guess about why they chose 20,000 songs as the limit; FAT32 directories can contain up to 65,536 entries, and each file/directory uses between 1 and 13 entries (depending on the length of the name), so that arbitrary song limit is well within the technical specification.

Overall impression

Google Music is a strong, interesting contender in the streaming music market; while it's certainly not the most open approach, I am liking Google Music more than the other music streaming alternatives that I'm aware of and it's quite mature and usable. That'll do, Pig. That'll do.

Friday, November 23, 2007

Turducken: Slaughter with Laughter

It's been a while. I switched from public education to a private company back in March and haven't had the time to write. I've gone through some life changes recently, and in short I will have more time to write for Free Software Magazine, compose technical articles on PHP development, and much more. I will back-date some content, mostly photography related. Thank you for sticking around, I appreciate it.

Turducken

I made a short, twisted video about what, why and how my family made a Turducken, a turkey stuffed with duck stuffed with chicken. A veritable avian Matryoshka tsunami of culinary urban legend, few have attempted to create this carnage loaf.

Monday, March 19, 2007

Syracuse St. Patrick's Day Photos

Photography

On Saturday, March 17th, I attended the St. Patrick's Day Parade in Syracuse. I was experimenting with the Nikon N70, and I did my best to put it to good use.

You can also view the set of 60 photos as a slideshow.

Consolidation

My apologies for my SAMPP entry; it was way, way too long. I've consolidated it on my web host using the dojo toolkit to make tabs. You can view the amended version at theconfluence.org/projects/sampp .

Thursday, March 8, 2007

Compiled SAMPP build instructions

I was recently asked to do create and document a containerless configuration of a Solaris 10 web server with Apache 2.2.4, MySQL 5.0.33, PHP 5.2.1, and Perl 5.8.7. Apache, MySQL, and PHP have complete compilation instructions. I will include the necessary configuration files (Apache in particular; built from scratch) or modification instructions.

Notes:

  1. This instructions assume that Solaris 10 is already installed and configured.
  2. These instructions assume you're root.
  3. Apache includes a self-signed SSL certificate, user directories, mod_perl, authnz-ldap, server-status and daily log rotation.
  4. I was requested to consolidate everything web related into /web for ease of administration and backup.
  5. This is not a fully optimized build, as there is no universal configuration that will work equally well for everyone. Therefore, read the manual and tweak where necessary (especially Apache).
  6. Additional Applications
    1. AWStats 6.6 with automatic log analysis
    2. phpMyAdmin 2.9.2 for MySQL administration

These instructions are culled and edited from my notes. Please let me know if I got something out of order or left something out.

Notes

LDAP .htaccess files (you'll have to tweak the LDAP URL for your environment)

AuthName "Password"
AuthType Basic
AuthBasicProvider ldap
AuthLDAPURL ldap://ldap:389/ou=people?uid
AuthzLDAPAuthoritative off 
require ldap-user "username"

Link

theconfluence.org - Compiled SAMPP build instructions

Wednesday, March 7, 2007

Jon's best practices for servers

This is a consolidation of general best practices for servers I've learned and developed over the years. Feel free to share some of your own as well!

  1. Never use telnet or ftp - use ssh or sftp instead.
  2. Never use HTTP with anything that could compromise the integrity of your system.
  3. Never login as root.
  4. If you install it, keep it up to date.
  5. If you don't use it, remove it.
  6. Always check the changelog before updating.

Host Naming Conventions

There are different philosophies for hostname conventions. In my experience, using a common theme and context adds logic to a potentially complicated network.

At home, I use spells from old Infocom interactive fiction games as my naming convention. While it may seem silly, my home network is small enough that I can remember the purpose of machines, and I've got a large corpus of potential names. I've also seen others use names of characters from television, movies or books. Use your imagination!

At work or in a shared environment, I use more descriptive names, such as web-dev-01 for a development web server. Security through obscurity causes more headaches than it's worth as it makes it more difficult for others to understand the layout, and the illusion of security that comes from giving a machine a wacky name will not protect you from malicious users.

Either way, once you've developed a schema, stick with it; mixing naming conventions just makes things more difficult.