A Little Off Code, Computers, Photography and Guns

30Mar/093

Podcast Downloading on FreeNAS (Followup)

I've been following the referrals to my blog lately and I noticed the FreeNAS Podcast Downloader post was getting a lot of traffic but that the post wasn't descriptive enough in it's actual use. So I've got some instructions how to actually USE the project.

First off this will involve installing a package that isn't default for FreeNAS, if this worries you then skip down a step or two to the link to download all the project files manually. All this involves is installing subversion for checking out the code and all necessary files for the project to run. SSH into your FreeNAS server and execute this command:

1
pkg_add -r subversion

This will take a while to run so don't worry if it looks like it froze. You should reboot your server after this is finished for all the new settings to take effect. This is just so you can download the latest copy of the project.

Next step is to check out the project which can be done using the package you just installed. Choose a folder on your data partition for this to go because in an embedded install any other location would be overwritten on reboot. I made a directory in /mnt/Main/Content/.db/ (This is where I've chosen for all the databases for UPnP and DAAP to be stored along with the scripts for my server that I've written):

1
svn checkout http://svn.xp-dev.com/svn/bemasher-FreeNASPodder/ FreeNASPodder

This will check out the latest copy of the code to a new folder FreeNASPodder in /mnt/Main/Content/.db/

If you're uncomfortable with installing new packages to your server and just want a copy of the project you can simply browse to http://svn.xp-dev.com/svn/bemasher-FreeNASPodder and download each individual file manually. The benefit of using subversion is that getting the latest version of the file requires only browsing to the folder it resides in and executing:

1
svn update

Once this is all done you've checked out a working copy of the code. There are a few minor things you'll need to change in the script and in the configuration file. First in bashpodder.sh you'll need to change podcast_dir to the directory that you'd like your podcasts to be downloaded to, do the same in select_podcasts.sh. Make sure this folder exists as the script won't create it for you, it will only create folders for individual podcast feeds inside this folder. Be sure to escape spaces with a backslash.

The next change you'll need to make is in feeds.list. This will have a list of the url to each podcast feed you'd like to download episodes from. Be sure to keep one blank line at the very end of the file it will skip the last feed if you don't.

If you don't want to download all the current episodes all at once run select_podcasts.sh from the shell using:

1
sh select_podcasts.sh

This will create the basic folder structure that all of your podcasts will go into and compile episode.txt files for each podcast feed in their respective folders wherever you specified podcast_dir to be. To download a particular episode just remove the url for the episode you'd like to download from the episode.txt of the cooresponding podcast. Then simply run:

1
sh bashpodder.sh

If you'd like to execute this using cron in the web interface go to: System -> Advanced -> Cron. Click the add button and use the following command to check for and download new scripts however often you'd like:

1
sh /path/to/FreeNASPodder/bashpodder.sh

Followup:
Good news! I've moved all of my subversion repositories over to GitHub, the latest code for FreeNASPodder can be found at http://github.com/bemasher/FreeNASPodder. And even better news: you no longer have to install svn or download each final manually, GitHub has the option to download an archive in tgz or zip format of the latest source files.

5Mar/091

Free Subversion Hosting

I've been in a very coding-prone mood lately. I've been working on developing a Python ETR (Employee Time Record) script for a friend and his club here at the University of Arizona. The project has grown significantly since I started it and this is one of the first projects in a while that I've developed for someone to use other than myself and I've been wanting a way to manage my code better.

I did some searching for free subversion hosting. I've seen google code hosting before and looked at it's feature set, which is quite complete. In terms of project management google code hosting is probably the best for my needs. Though after reading through more of their help//support section I discovered that there's a maximum project creation limit of 10. Supposedly you can email support at the google code hosting service and work out a deal to get more than 10 projects but that's really a hassle. So I started looking elsewhere. Currently though the PythonETR script is hosted at google code.

I stumbled upon ProjectLocker which looked really promising. It turned out to be a very well put together system you get 300MB of storage and unlimited subversion repositories along with Trac instances for each repository. There's just a big HOWEVER in the middle of what seems to be an awesome service. The however is that there is NO public anonymous subversion access. If you want your projects to be available there's no way for you to allow the public to check out a read-only copy of your project. They also only allow a maximum of 2 user accounts and you count as one of them.

Once I discovered all the limitations of ProjectLocker I kept on searching. The next promising service I found was XP-Dev. XP-Dev pretty much one-up's ProjectLocker on just about everything except a few crucial parts. There's no Trac, they provide their own "project tracking" tools like: stories, blogs, wikis, bugs. There's no real way to associate projects with subversion repositories on this service. You get 1.5GB of storage and as many subversion repositories//projects you want to fill that up with. If all you're looking for is free subversion hosting with no project tracking then this is probably the service for you. Though if you're even the slightest bit paranoid about crypto this service definitely isn't for you. Most of the defaults are for non-SSL connections and the services that allow SSL use a self-signed certificate by XP-Dev. I did discover that they do allow public read-only access to subversion repositories but only if you choose to enable this feature so for private projects you don't have to make them publicly available.

2Mar/090

Python ETR and Google Code Hosting

Earlier tonight I was talking to Nick a friend of mine who I've been working with recently on a ETR script. He's one of the webmasters for the University of Arizona Baja Racing Club.

I had already written my own ETR script for easy entry of time records from my google calendar to the ETR form website at my job. So I figured that i could just as easily modify it to work for him.

The main structure for his particular needs will be a main google account which the script will authenticate with. All of the users that he wants to keep time records for will simply create and share a calendar with that account. Then when the script is run it will simply authenticate with the gdata api and retrieve a list of events and their descriptions for each shared calendar on the account. All of this data is then written to a csv file of the same name of the calendar along with the work week it was done in.

The script is more or less in proof-of-concept stage and still needs a lot of polishing but in the middle of doing this I found myself wanting to have a way to organize changes and revisions. I've briefly used subversion before this and never really made a habit of using it even though I should have. I suddenly remembered that Google Code Hosting provides subversion access to open source projects. So I went ahead and made a project of the name pythonetr.

It took about 15 minutes for me to download and install TortoiseSVN, a windows shell integrated gui for SVN. I then imported the first revision of the project to the subversion repository of the project on google code. After that I sent Nick a link to the page so that if there were any feature requests, bugs anything he wanted me to know about for the project he could just submit them as issues there.

Shortly after that I made some modifications to the code since the gdata api was only returning events between specified dates only if their cooresponding UTC time was within the date range. This breaks things if you expect only events between the date ranges that are returned are within your timezone. So I made all the changes and committed the new revision.

It's really satisfying to have a personal record of all changes made to code and I really should do this more often. I'd upload all my other projects but I believe there's a lifetime limit of 10 projects total for google code hosting.

If you're interested in checking out a copy of the project, you can do so with the following command:

1
svn checkout http://pythonetr.googlecode.com/svn/trunk/ pythonetr-read-only