Geany From Source on Ubuntu

I like using the Geany IDE, perhaps because it seems more like a nice source code editor than a full-blown IDE. The version of Geany in the repository for Ubuntu 9.10 and 10.04, which I use on a couple machines, doesn’t seem to include the Treebrowser plugin that I wanted to try. Might as well take a shot at building the current version from source.

The following steps assume you’ve started a terminal in your home directory.

Get the required packages.

sudo apt-get install build-essential autoconf intltool libtool libgtk2.0-dev libglib2.0-dev g++

I’m using a directory named src in my home directory to hold the downloaded source archives.

mkdir src && cd src

Download and extract the Geany source (be sure to check the Geany site to see if there is a more recent version than 0.19.1 referenced here).

wget http://download.geany.org/geany-0.19.1.tar.gz

tar xvf geany-0.19.1.tar.gz

Change to the extracted source directory, configure, build, and install.

cd geany-0.19.1

./autogen.sh

make

sudo make install

If these steps completed without errors you should be able to start Geany by typing geany in the terminal.

Next get the source for the geany-plugins package.

cd ~/src

wget http://plugins.geany.org/geany-plugins/geany-plugins-0.19.tar.gz

tar xvf geany-plugins-0.19.tar.gz

cd geany-plugins-0.19

./configure

You can install all of the plugins by running make and sudo make install in the current directory, or you can install plugins individually from subdirectories configured for each one. The following steps install only the Treebrowser plugin.

cd treebrowser

make

sudo make install

This Ubuntu Forums post pointed me in the right direction for figuring this out.

BTW: Geany is my lazy fallback when the quest to master text surgery in Vim hurts my brain.

COHPy Meeting – October 2010

Here are some links from last night’s meeting of the Central Ohio Python Users Group.

Austin Godber talked about virtualenv. Materials from Austin’s presentation are on GitHub.

Eric Floehr, of Intellovations, presented Building a Small Business/Personal Website With Django. He discussed some Pythonic choices for building web sites such as Blogofile for generating sites that are static content, and Plone for enterprise-scale content management. Django falls somewhere in the middle as a good choice for small business or personal blogging sites.

Other links from Eric’s talk:

Also (FWIW), here’s a bit of .bash_history from my following along with part of Eric’s presentation on a VM running Ubuntu 10.10:

sudo apt-get install python-virtualenv python-pip
mkdir dev
cd dev
mkdir oct
cd oct
virtualenv --no-site-packages pyenv
source pyenv/bin/activate
sudo apt-get install mercurial
pip install -e hg+http://bitbucket.org/stephenmcd/mezzanine#egg=mezzanine
mezzanine-project sample
cd sample
python manage.py syncdb
python manage.py runserver
pip install django-debug-toolbar
python manage.py runserver
pip install django-extensions
python manage.py graph_models blog>blog.dot
sudo apt-get install graphviz
dotty blog.dot

I’m not presenting this as a how-to or a tutorial, just some notes. If you don’t know what the above commands will do then I’d recommend not running them.

COHPy Meeting – September 2010

Here are some links from the September 2010 meeting of the Central Ohio Python Users Group:

Scott Scites gave a talk on Pyjamas, a "Python Javascript Compiler, Desktop Widget Set and RIA Web Framework."

The following are among items discussed during Scott’s talk:

PureMVC

JSON-RPC

Flask (A Python Microframework)

Raphaël JavaScript Library

gRaphaël Charting JavaScript Library

Minesweeper written in Python with Pyjamas

357 Guts – One of the guys at the meeting built this online card game using Pyjamas (and if someone tells me his name I’ll update this post, unless he wishes to remain anonymous).

Eric also mentioned GeoDjango.

I thought this was a good meeting and I certainly came away with a list of some pretty cool Pythonic stuff to check out.

Installing Git From Source On Ubuntu

Git is available from the Ubuntu repositories in the git-core, git-doc, and git-gui packages (there are other Git-related packages available but I think those three make up a basic installation). The package maintainer’s version tends to be behind the currently available version of Git. To have the latest features and fixes in Git it is necessary to install it from source. This is the process I use to install Git from source on Ubuntu 9.10 (karmic) and 10.04 (lucid):

Download the source archive from http://git-scm.com and extract it (I just extract it where it lands in my Downloads directory). Open a terminal in (or cd to) the extracted Git source directory (~/Downloads/git-1.7.2.1 as of my latest install).

Install required packages:

sudo apt-get install libcurl4-gnutls-dev libexpat1-dev libssl-dev gettext libz-dev asciidoc

Build and install Git and its documentation:

make prefix=/usr/local all doc
sudo make prefix=/usr/local install install-doc

If you don’t include the doc and install-doc tasks in the installation then the Git documentation will not be available via man pages or the git help command. If you don’t want the documentation then you can leave out those tasks and you won’t need to install the asciidoc package either. I prefer to have the documentation.

PyOhio Attendee Wannabe

PyOhio badge

Yeah, the badge says “attendee” but it turns out I have a conflict this year and won’t be attending. It’s a family matter that could not be rescheduled, and it’s important to me, so I will have to miss out on a terrific event around the Python programming language. I made it to one day of the two day event last year and was really hoping to make it for both in 2010.

So if for some reason you are reading this blog, and you have even the slightest interest in Python, and you will be in the Columbus area on July 31st and/or August 1st, you really should check out PyOhio. I would. Alas, maybe next year.

Tweaking the Bash Prompt

A little Saturday morning tweaking.

Based on this post at railstips.org, I decided to adjust my Bash prompt by appending the following to my ~/.bashrc file:

#...

function parse_git_branch {
  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
  echo "("${ref#refs/heads/}")"
}

BLACK="[33[0;30m]"
BLUE="[33[0;34m]"
VIOLET="[33[1;35m]"
CYAN="[33[0;36m]"

PS1="n[$CYANu@h:$BLUEw$VIOLET $(parse_git_branch)$BLACK]n$ "

The prompt will now show the name of the branch I am working in when the current directory is part of a Git repository. The original code used yellow, red, and green to highlight parts of the prompt. That messed with my mind when I ran RSpec and saw yellow and red when I was expecting all green. Rather than get used to it, I changed the colors. I also added some newlines to perhaps keep the command line neater when deep in a directory tree.

Terminal screen shot

 

[Update 2010-07-23]

After running with the above settings for a while I decided I don’t care for the colors in the prompt. Don’t need the square brackets either. I do like seeing the current git branch. That simplifies things a bit.

#...

function parse_git_branch {
  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
  echo "("${ref#refs/heads/}")"
}

PS1="nu@h:w  $(parse_git_branch)n$ "

 

[Update 2010-09-25]

Okay, maybe a little color…

#...

function parse_git_branch {
  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
  echo "("${ref#refs/heads/}")"
}

VIOLET="[33[1;35m]"
NO_COLOR="[33[0;0m]"  

PS1="n$VIOLETu@h:w  $(parse_git_branch)$NO_COLORn$ "

See. I told you it was "tweaking."

Columbus Ruby Brigade – June 2010

The Columbus Ruby Brigade met at Quick Solutions on 21 June, 2010.

Mike Doel who works at VacationView gave a talk on Capybara (a giant rodent that occasionally eats its own poop) and Capybara ("Son of Webrat"). One virtue of Capybara is that it facilitates testing the JavaScript bits on your site which Webrat cannot do.

Alex Moore presented IronRuby. Some IronRuby performance and RubySpec stats are at ironruby.info.

Alex recommended the book IronRuby Unleashed by Shay Friedman and mentioned the not yet released IronRuby in Action by Ivan Porto Carrero and Adam Burmister.

After the meeting we stopped at the nearby Busty Rucket for a pint. I tried Lake Erie Monster from Great Lakes Brewing Co. and I have to say it was indeed a monster. Starts with a malty sweetness and finishes by biting your head off with some powerful hops. Not exactly my cup of tea, which is not surprising since it was a beer.