Finally getting this posted a week late. I'm looking forward to returning to Chiang Mai for awhile next year, staying longer and taking some time off from work. There's a lot more to see than the comforts of boutique hotels :-)
Today I cooked breakfast as the Bangkok sunrise bathed my condo in its glow. Gathering my things for two weeks' wandering and a visa run, I took to the property management office an assortment of fruit that I was gifted with and had to leave behind, and set off to catch my flight to Chiang Mai.
Arriving around lunchtime, I had a pleasant conversation over coffee with some European travelers who gathered as strangers around the available table at an airport shop. Already the different vibe here was apparent -- a maturity and calm contentedness without the posturing often seen in foreigners and Thais alike in cosmopolitan Bangkok. As we all fanned out from our fleeting encounter, I hailed a cab to reach my fine accommodations. Rubbing my eyes from too little sleep or perhaps a distrust for the immediate sensation of comfort I felt as I stepped inside, I was graciously welcomed by the staff of U Chiang Mai and shown to my room.
Wearily I stepped into a shower that seemed to wash away hours. I donned a robe and cracked open my laptop to check in on the afternoon of work ahead. Seizing the "anytime, anywhere" breakfast as opportunity for a convenient meal, I received a delectable spread of eggs benedict, sauteed mushrooms, a croissant and toast, yogurt, fresh fruits and orange juice. Best Western breakfast I've been served in Thailand hands down.
Eventually I dressed, in order to move outside and round out the day's work from the spacious daybed on my balcony. Opening a beer as the evening sun's last rays glinted upon the surface of the slate-black pool below, I closed the laptop, opened a guidebook, and waited for my friend to arrive with the night's plans.
Adventurous first day in Northern Thailand? No. Rejuvenating to pamper oneself with a boutique hotel once in awhile? Oh, yes.
Bitbucket is a new social code hosting site for Mercurial (Hg) users, allowing them to view and interact with one another’s distributed revision control repositories. It’s no stretch to say that it’s inspired by the excellent GitHub site for the Git SCM. Being a fan of the simplicity and elegance of Hg, I’ve been waiting for someone to do this for awhile.
Bitbucket is quite young and still in public beta, and they’re working rapidly to make improvements and squash bugs, but they already have plenty of novel features working. One of the coolest ones that caught my eye is support for patch queues a lá Mercurial Queues. I had a little trouble figuring out how Bitbucket handles patch queues at first, at it’s not documented in their help yet, but with the help of developer Jesper Noehr I was able to work it out. So until those official docs are published, I hope this guide can help some folks.
So I’m using Mercurial for version control on a Ruby on Rails project, along with Capistrano for automating deployment and running remote tasks. These are great tools and I’m finding that they work well together with the Mercurial SCM module by Matthew Elder introduced in Cap 2.0.
I came across one problem though: my repository is hosted over HTTP because I don’t want to give everyone access to a shell account for SSH, and the hg SCM module didn’t support prompting for passwords (whether you’re using HTTP authentication or SSH without a public key). This effectively meant that if you wanted Cap to deploy from a repo served in either of these ways, you’d need to put your password in plain text in your Cap recipes.
I don’t like the idea of that, so I created a patch to fix it, along with another minor point or two that I found, and added some unit tests. You can get more details and take a look at the patch on the ticket I submitted. It’s been committed, so if you’re using Capistrano from SVN, you’re set, just svn up.
If you’ve installed Cap from a gem and want a quick fix, you can replace mercurial.rb in your installation with the one attached to this post. On my system, it lives at this directory path:
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/scm/
This will probably work with Cap 2.0, though I’ve only tried with 2.1. The Mercurial module hasn’t changed much.
I should note that on my systems I’ve had to set the option for requesting pseudo-ttys in my recipes, or else Mercurial tries to run non-interactively and password prompting won’t work. If you have that problem, use this:
default_run_options[:pty] = true
If anyone comes up with a nice way to load the new stuff as a monkeypatch in a project, I’d love to hear about it. I’ve been unsuccessful at trying to hook it in through recipes or the Capfile, and it’d be nice to have some way of doing that while waiting for the next gem release. I’d rather not ask my team to check out Capistrano from SVN or run around modifying their installation if I can avoid it.
Update:
And, in short order, Cap 2.2.0 has been released. The fix below is rolled in, so just gem install capistrano and you can forget about the rest!
I’m a little late in posting this here, but I’m giving a talk on Pylons, a rapid-development web applications framework, for the local Python users group this Wednesday evening.
The talk will primarily be comprised of an overview of the framework and the components that it brings together. Pylons’ use of existing libraries is great for code reuse, flexibility, and simply using the best tools out there, but it can make the initial learning curve a bit steep.
So, if you’re curious about Pylons or are looking for a MVC framework for building web apps and services in Python, come check it out.
You can find a full description and RSVP at the official Meetup page, or on Upcoming if you’re into that sort of thing:
http://python.meetup.com/181/
http://upcoming.yahoo.com/event/407810
The slides for the presentation, as well as an HTML export of the outline (with lots of reference links) are attached to this post. I’ve now embedded the presentation from Slideshare behind the cut. You can download the complete Keynote file with presentation notes there.
Apologies for taking so long to post Part II. I had hoped that the templates for the Tags Plugin would be ported to Genshi, or that I’d have time to do so myself, before finishing. Unfortunately neither of those things has happened, and in fact the entirety of trac-hacks.org was down for several weeks. That would have been rather annoying when trying to work through this article…
In Part I, we covered the installation of Trac on a shared host at TextDrive by setting up a user-local Python environment. That, along with PEAK‘s setuptools, made it trivial to install a spanking new version of Trac and its prerequisites (along with a few optional niceties). We also saw a simple authentication set-up, and how to make sure tracd and its HTTP server get restarted if a system reboot is necessary.
Now in Part II we’re going to look at administering and extending Trac with some plug-ins, ranging from small and simple to large, complex tools. Some serve utility functions such as providing attractive web-based frontends for various aspects of Trac configuration, while others add wholly new capabilities to the system. Fortunately, thanks to our preparations in the last article, installing plug-ins is quite easy.
The TextDrive theme continues! Trac-hacks.org has been down for a couple of weeks — apparently the maintainer went out of town shortly before the server tanked — so I’m stalling on Part II of my Trac on TextDrive article. Sorry! Plug-in installation is the focus of the article, so it would be rather frustrating to try to follow along when most of the resources are unavailable…
In the mean time, I’ve been trying out Mercurial and really digging it. Mercurial is a distributed version control system, and we’ll talk a little about why you may want such a thing. Also, it’s written (mostly) in Python, and has a very functional Trac plug-in (that incidentally is not hosted on Trac-hacks currently!), so it seems to fit pretty well into our current theme.
Bill de hOra has written a couple of useful articles on Mercurial set-up that are specific to TextDrive, but they’re “terse” by his own words, and the user-local Python environment that we set up earlier affords us a more straightforward procedure. I’ll also try to pick up where Bill left off by briefly covering Mercurial set-up and use with SSH.
But what is this all about, really? There’s been a lot of chatter recently on the rise of distributed VCSes like Bazaar, git, darcs, etc., and I’m not going to go into detail about opting for one tool over another (Wikipedia has a big comparison matrix if you’re looking for a place to start your own research). Rather than sweating the minutiae that separate these tools, readers here would probably be better served by some discussion of why one may want a distributed SCM in the first place. While I haven’t explicitly covered the use of a VCS in the past, the depth of my Trac articles probably appeals more to the beginner than the seasoned (read: impatient) version control user, and someone just starting with Subversion may wonder why he or she should think about throwing it out and starting over. Read on for more, or you can just jump ahead to the set-up details if you like.
I’m working on a new blog that I’ll actually attempt to publicize, but here’s something to get me moving in the mean time.
In this article, I’m going to present a comprehensive primer for installing and configuring Trac on a TextDrive account, though a lot of the information could be useful to anyone getting started with Trac, or running Python applications on a shared host. In Part II, we’ll extend Trac’s capabilities with some useful plug-ins.
Trac is a web-based tool for simplifying software project management — it’s grown to be rather popular these days, and even if you’re not familiar with it already, chances are pretty good that you’ve surfed across a Trac site at some point. If you use a version control system like Subversion for software or web development projects, Trac can provide you (or a team) with syntax-highlighted browsing of the code in your repository, diff file comparisons between arbitrary revisions, a flexible bug-tracking system, and an integrated wiki to document your project. It’s also highly extensible.
Trac is built with Python, and really, much of the set up in this article centers around setting up your own Python environment. Python is a dynamic, interpreted programming language a lot like Ruby in its elegance and efficiency, but with rather different philosophies. This setup will also set you on your way if you’re interested in web development with Python, with frameworks like Pylons, Django or Turbogears. Python is the bee’s knees, and I’ll be covering a lot more of it in the future.
The site has been upgraded to Drupal 5.1 and modules have been brought up to date. In theory, this is part of a movement to stop neglecting my blog.
I’m also working on setting up some new modules, including integration of video functionality into the site, so that I can share some recently completed projects. I hope to write how-tos for some of those module configurations, as well as a spam-proofing article I’ve had in mind for awhile now. And I’ll continue updating the audio module tutorial, which I’ve amended with some info for Drupal 5.1.
In other not-so-late-breaking news, Jesse is about to get married.
Yes, we are actually working on our own company site. Slowly. As we flesh out some copy, we're looking into an identity package so that we can style the site when the content is ready, plus get business cards and all that.
I've implemented a quick-and-dirty issue tracking system for ACS as a proof-of-concept, because I think it's badly needed there. It's built on the drupal casetracker module and is being tested on a current customer project. We're (patiently) waiting on an official sign-off to commence full-on development for them. In the meantime, we've implemented CCK and Views on the staging site, to unlock some of the real meat and potatoes of what Drupal can do.
Jesse has completed work for the launch of paidContent.org, which looks great. He wishes to express his joy to all of you about the migration of their 27,000+ existing entries ;-) He also recently contributed a patch to the Radiant CMS, which powers the new official Ruby site. I think the jury's still out on that patch making it into HEAD...
I had a pretty successful yard sale. Let me know if you need a grill or a dining table. Since then I've been fighting off illness, edumacatin' myself on Ruby over at why's (poignant) guide, and familiarizing myself with the Rails API, in addition to the daily grind. Stay tuned for more... I know you're thrilled.
Opera Mini is pretty awesome.
I found out about it when searching the Salling Clicker forums to see if I could get that app working with my mediocre Motorola V551 mobile phone (more on that another day). I think I'm about to be paying more for my data plan...
The Subversion Applescripts included with Growl are a great little timesaver. For that matter, browsing the other included scripts inspired me to consider some repetitive tasks that I should script myself.
Jesse turned me on to VirtueDesktops, a long-needed replacement for DesktopManager, which I've been using I think since Jaguar. Sadly the graphics card in my ancient Powerbook isn't Core Image capable and I don't get the spiffy animations when switching desktops. Until we have Spaces, though (and/or I get a new Powerbook), it's an indispensable app.
Last but not least, Google Browser Sync allows me to pick up where I left off between home and work. Firefox bookmarks and session info are synced through your Google account (with encryption) so you can get right back to those 16 tabs spread across 5 windows...
Now I just wish the Adium plug-in for Quicksilver would work again...