Saltstack: Passing objects to templates

Quick one. When you pass a variable like this to a template through the context/default parameter it is iterpreted as a literal string: server_xml: file: - managed - name: /opt/tomcat/conf/server.xml - template: jinja - source: salt://tomcat/files/server.xml.tmpl - context: deploy_conf: deploy_conf Which means that you end up with errors like this: Unable to manage file: Jinja variable 'unicode object' has no attribute 'control_port To pass the object itself in you need to put it in the braces: ...

May 12, 2014 · Nigel Sim

Projects for the new year

These are some project idea’s I’ve been sitting on all year and have not yet started, but hope to in the new year. 1. Python CMS framework in the vein of Drupal, based on Repoze BFG So Drupal is quite a popular community building framework, with good plugin system, and a data model which seems to work well. But I don’t think PHP is the way of the future, at least for me. I use Python for many other projects, I understand how to debug, unit test, etc. And BFG brings the really nice framework features from Zope and Plone, which makes it an ideal starting point. I’ve got a project plan for this which I’ll reveal when I get around to cutting some code. ...

December 24, 2008 · Nigel Sim

Slashdot | Is Apple Killing Linux on the Desktop?

Slashdot | Is Apple Killing Linux on the Desktop? This is a summary of my experiences walking the path between Linux (Ubuntu/Gnome) and OSX. For background I’ve been using Linux on the desktop for about 7 years, and only in the past 2 months have purchased a MacBook. For years I’ve been using linux on the desktop, first Debian/Gnome and more recently Ubuntu/Gnome. I must say I really appreciated how well configured the Ubuntu desktop was out-of-the-box, and through good things coming together, how well the dynamic monitor configuration worked. As a programmer, web monkey, researcher and academic writer I had no complaints about the Linux desktop per se. I didn’t really miss any applications, and VM ware could certainly facilitate whatever was required. ...

January 6, 2008 · Nigel Sim

Maven-Ant hybrid

Some brief background. Ant is the stock standard Java build system, much as Make is for C/C++. Maven is a newer Java build system which tried to, amongst other things, solver the Jar dependency hell problem, as well as make a standard project directory layout. From the Maven guide: <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.9</version> </dependency> Now when you go to compile with maven it goes and gets all the dependencies, puts them in your local repository (~/.m2/repository) and then into your project’s build class path. This is covered in more detail at the Maven website. ...

July 20, 2007 · Nigel Sim

Four things which would make my Linux wonderful

1. Presentation controller for my bluetooth phone In fact this already exists, in many forms apparently. The trick for me was to get it working. If I was to derive it from scratch I would have made a simple, mappable Java app for the phone, and would have written a Python app for the server. In fact this already exists in Xbtrc. The trick for me however, was to get the phone to find the computer. The phone could find other phones, and using the python rfcomm examples, I found the computers could find each other. The problem, it turns out, was the computer needs to be put into discoverable mode for the phone to be able to find it. ...

January 18, 2007 · Nigel Sim

Retrofitting hybrid car technology

After having driven a hybrid car for the first time I was curious if it would be possible to retrofit this kind of technology to an existing vehicle. Basically an electric drive which connects into the crank, or there abouts, which can assist when the engine is under load. Surprisingly there isn’t that many products on the market, with the exception of this: Electrocharger / Retrofit Hybrid :: Sigma Automotive I’m now searching for some products which are actually in production, or some DIY projects. Any help? ...

July 2, 2006 · Nigel Sim