Sometimes it’s a real pain to add JAR’s to Maven, especially when the project doesn’t use Maven as the build system or provide scripts for this purpose. This is even more painful when we have to deal with the dependencies that a particular framework needs.
One solution to avoid this (at least temporarily) is to use Maven’s system scope and systemPath feature:
|
<dependency> |
<groupId>org.apache.zookeeper</groupId> |
<artifactId>zookeeper</artifactId> |
<version>3.3.0</version> |
<scope>system</scope> |
<systemPath>${basedir}/lib/zookeeper-3.3.0.jar</systemPath> |
</dependency> |
|
This will reference a dependency from the local filesystem, which means you do not have to install the JAR into the repository in order to use it. This is particularly useful when you’re doing some prototyping or research into a new technology.
By the way Zookeeper does provide support for Maven, see https://issues.apache.org/jira/browse/ZOOKEEPER-224
For more information see: http://maven.apache.org/general.html#tools-jar-dependency
I recently had to setup Fabric (http://docs.fabfile.org/0.9.0/) for doing deployment from my Windows machine at home.
Setting it up under Linux is very very easy but for some reasons there are a number of
issues you have to overcome when installing on Windows. I followed this page to start:
http://docs.fabfile.org/0.9.0/installation.html
First up a standard Python install (I used 2.6.2) and setup tools 0.6c11:
http://pypi.python.org/pypi/setuptools
and create a simple fabric script (fabfile.py)
from fabric.api import local, env, put |
env.hosts = ["elephant@babar.net:40"] |
env.show = ['debug'] |
def deploy(): |
print "Deploying..."; |
put("fabtest.txt", "/tmp/fabtest.txt"); |
print "All Done..."; |
From there:
will result in:
... |
Installed f:\python26\lib\site-packages\fabric-0.9.0-py2.6.egg |
Processing dependencies for fabric |
Searching for pycrypto>=1.9 |
Reading http://pypi.python.org/simple/pycrypto/ |
Reading http://pycrypto.sourceforge.net |
Reading http://www.amk.ca/python/code/crypto |
Best match: pycrypto 2.0.1 |
Downloading http://www.amk.ca/files/python/crypto/pycrypto-2.0.1.tar.gz |
Processing pycrypto-2.0.1.tar.gz |
Running pycrypto-2.0.1\setup.py -q bdist_egg --dist-dir f:\docume~1\admini~1\loc |
als~1\temp\easy_install-clrpu1\pycrypto-2.0.1\egg-dist-tmp-1wszmf |
error: Setup script exited with error: Unable to find vcvarsall.bat |
You can solve this in a number of ways, the easiest of which is to install the binary for pycrypto manually from here:
http://www.voidspace.org.uk/downloads/pycrypto-2.0.1.win32-py2.6.exe
Next, try running fabric using: fab -f fabfile.py deploy. This results in:
Traceback (most recent call last): |
File "F:\Python26\Scripts\fab-script.py", line 8, in <module> |
load_entry_point('fabric==0.9.0', 'console_scripts', 'fab')() |
File "f:\python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.p |
y", line 277, in load_entry_point |
File "f:\python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.p |
y", line 2180, in load_entry_point |
File "f:\python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.p |
y", line 1913, in load |
File "build\bdist.win32\egg\fabric\main.py", line 17, in <module> |
File "build\bdist.win32\egg\fabric\api.py", line 9, in <module> |
File "build\bdist.win32\egg\fabric\context_managers.py", line 12, in <module> |
File "build\bdist.win32\egg\fabric\state.py", line 125, in <module> |
File "build\bdist.win32\egg\fabric\state.py", line 74, in _get_system_username |
|
ImportError: No module named win32api |
Install the pywin32 extensions from here:
http://sourceforge.net/projects/pywin32/files/
and finally run fabric again (fab -f fabfile.py deploy), the script should run fine this time…
All Done... |
Done. |
Disconnecting from babar.net:40... done. |
Had a bit of a snag installing MySQLdb tonight, which is required when installing Django. I ran into the following error when trying to install the MySQLdb egg under Debian Lenny.
EnvironmentError: mysql_config not found
When trying to install MySQL-python
It was fixed by installing the libmysqlclient15-dev package and the installing the egg again:
|
sudo apt-get install libmysqlclient15-dev |
easy_install MySQL_python-1.2.3c1-py2.5-linux-i686.egg |
|
Package details here:
http://packages.debian.org/search?searchon=contents&keywords=mysql_config&mode=path&suite=stable&arch=any
It is always exciting to have your work noticed, and respected, by other designers…so today Oogly are happy to say we are featured on David Pache’s article “100 Brands of Interest“.

As David comments, “It can be the easiest thing to create a logo for a client but when it comes to assessing what style of identity can best represent yourself or your business, this is a different matter altogether. It is tempting to use your own brand as a showcase of all your best techniques and ideas but this must be balanced with modesty and professionalism to gain the correct tone for your business image.”
Check out the full article (including our logo) here: http://www.dache.ch/dache/comments/100_Brands_of_Interest_II/
I’ve revamped the pastebin website (http://pbin.oogly.co.uk) – which is based on CakePHP (a model view controller PHP framework) and SyntaxHighlighter (http://alexgorbatchev.com/wiki/SyntaxHighlighter). I also created an Eclipse plugin to interface with the website.

A pastebin allows you to share a patch/code selection/text selection with other people without having to resort to email/instant messenger. You can either interact with pastebin via the URL or above or install the Eclipse plugin. If you’ve installed the Eclispe plugin you then right click on the code/text you want to share and select Pastebin->Create Pastebin from the menu. More instructions and screenshots are available on the website.
The Eclipse architecture is a little strange to start with, the support it provides via the extensions framework is easy enough to understand, although I’m a little confused now that they’ve announced declarative services and their bizarre use of OSGi. The plugin uses the org.eclipse.ui.popupmenus extension. Dependency wise, I used the Eclipse UI and runtime along with the JFace Textfield components to provide the URL for the created pastebin. The main plugin itself is made up of an Activator class along with a NewPastebinAction class which implements IObjectActionDelegate which provides a run(IAction action) method. This obtains the current selection and checks to see whether it is a TextSelection (editor content selection) or a StructuredSelection (a package explorer/navigator file selection).
The selection is then wrapped in a simple domain object and passed to a web client facade that uses the Apache HttpClient (http://hc.apache.org/httpclient-3.x/) framework to provide connectivity with the pastebin website.
Finally, it uses a custom OkInputDialog to present the pastebin URL back to the user.
It’s not perfect at present (I need to unpick the dependency on the JDT plugin for the StructuredSelection), but it serves as a first attempt at creating a Eclipse plugin and understanding the internals of the Eclipse API. Also, it unfortunately does not autodetect the file type and convert it into the internal pastebin format.
Packaging the plugin was very straightforward. It involved using the File->Export function provided by Eclipse to package it into an appropriate JAR file. Alternatively, you can publish an update site, I did this by creating a new feature project (and adding the plugin to it) then exporting the the update site using Eclipse.
I’m going to take the pastebin as a starting point for more collaborative features.
Generating a contact form for a website can be a rather tedious job. To make things easier there are a number of WordPress plugins available, one in particular which is rather good is Contact Form 7. This allows you to create a form and generate a number of tags for display on that form, e.g. email address, name, comments…

You can then include this on your WordPress site via a new post or page using the following syntax:
[contact-form 1 "ContactForm"] |
It supports CAPTCHA, simple quizzes, various different components for generating surveys, contact forms etc… It also supports localization of messages so that you can customize the error messages and text displayed.
One issue I did find with it however was that I wanted to embed the contact form in a template. At first this doesn’t seem to be possible unless you use another plugin. I used Improved include page which allows you to include a wordpress page in a template. By creating a new page with a contact form embedded it’s very easy to include this page in your template:
And you have a contact form which can be embedded in the footer of your page or wherever you choose to put it.
I’ve been using a terminal called Terminator for the last few months instead of the terminal that’s bundled with Ubuntu. The main reason for this was to take advantage of easy split window creation to enable multiple terminals on the same screen. This is provided along with tabbed windows, but there also a number of other notable features. I struggled to find a set of shortcut keys for Terminator initially, so there are a few below along with some explanation of the feature:
– Split terminal horizontally
- Split terminal vertically
– Open a new tab
– Switch terminals
– Close currently selected terminal window
– Close all terminals
– Maximize currently selected terminal window
– Move split (dragbar) to the left
– Move split (dragbar) to the right
– Move split (dragbar) up
– Move split (dragbar) down
– Increase text size in the terminal
– Decrease text size in the terminal
– Restore text size in the terminal
– moves a window, release the CTRL key to finalise the window position.
– Fullscreen view
You can also get these using to look at all possible options for terminator. Overall it’s a good replacement for the bog standard terminal with some added features.
Just a quite post on a simple Postfix installation and some steps that tripped me up a little recently.
I installed a basic version of Postfix on Debian and didn’t want to go through the hassles of configuring a MySQL database for managing users etc… I decided to just use the simple aliases file to manage users. To do this I needed to specify the following in my main.cf file:
|
myhostname = example.co.uk |
mydomain = example.co.uk |
myorigin = example.co.uk |
alias_maps = hash:/etc/aliases |
alias_database = hash:/etc/aliases |
mydestination = $myhostname, $mydomain, localhost.$mydomain, mail.example.co.uk |
|
and this in my /etc/aliases file:
|
postmaster: root |
root: example@gmail.com |
example: example@gmail.com |
|
I also ran into two more issues with the aliases file:
1. Dictionary issue with /etc/aliases
postfix/smtpd[19065]: fatal: open dictionary: expecting "type:name" form instead of... |
The issue here was that Postfix couldn’t read the aliases file. It just needed to convert the /etc/aliases file into the /etc/aliases.db file. The question was how, the answer, like this:
sudo newaliases; sudo postfix reload |
2. Aliases database out of sync
database /etc/aliases.db is older than source file /etc/aliases |
The aliases database was not up to date with the aliases file. To fix this I ran the commands above.
So this is an initial post from WordPress using the twitter-tools plugin which allows you to integrate WordPress and Twitter (and vice versa)…
http://wordpress.org/extend/plugins/twitter-tools/
so this new post should result in a new tweet being created in Twitter : )
Just a quick write up here on persistent cookies and lynx. I was having an issue where lynx was prompting me to accept cookies from Google, Gmail etc… all of the time. I solved this by enabling persistent cookies for lynx 1.8.5.
To do this, you can put the following in lynx.cfg file which resides in your user home directory:
|
SET_COOKIES:TRUE |
ACCEPT_ALL_COOKIES:TRUE |
PERSISTENT_COOKIES:TRUE |
COOKIE_FILE:~/.lynx_cookies |
COOKIE_SAVE_FILE:~/.lynx_cookies |
|
This will store cookies in the .lynx_cookies file. It will also accept all cookies (you may want to omit this and enable cookies for specific domains which is also possible). For more information on the lynx configuration file and the various options see the link below:
One more note, this doesn’t have to go in the lynx.cfg file, you can also put it in a .lynxrc file, but you then may have to alias lynx to read from that file, possibly in .bashrc or .bash_profile, up to you:
|
alias lynx="lynx -cfg=$HOME/.lynxrc" |
|
And that’s about it.