coding

New after effects script to create render comps

I currently do some compositing work for the short film Bordercrossing. I took over from another compositor who did a couple of shots that the director and editor now want me to make some changes to. Some of those shots are very long compositions and I was asked to make changes to only some fragments of them and render those out. Since I found myself repeatedly creating new compositions that contained the big master comp as it's only layer but only the working area time fragment of it, I decided to write a small script to do this. You can find it attached or on aenhancers.com

Boo!

A while ago I stumbled across a new programming language: Boo. It combines the nice syntax of the python programming language with the well designed .NET Framework class library / IL Language system. This means it is not compatible with python software, but with every .NET component out there. It exists for MS .NET and MONO, IDE Support is available through #Develop et al. . Among the best features: static typing (but with type inference, which spares you a lot of typing) & duck typing, a lot of neat features from python and a few nice bits from ruby/perl (built in syntax for regex), compile time macros (think compile-time VS.NET code snippets) and lots more. I can't wait to use it in a real project! If you're into programming, definitly check it out!

Script to automate drupal mulitisite instance setup

I just finished a first version of a script to automate the somewhat tedious task of setting up a drupal instance. The script is work in progress so please be carefull. I am not very used to the python scripting language, so there may be some things that are awkward at least. Neither do I know about the internals of drupal, so it is quite likely that some of the things I do in this script are not optimal or maybe even dangerous from a security point of view. If you encounter errors or have suggestions on what to improve, please tell me so (either by adding a comment to this post or by writing me directly). The script is released under the GPL V2 or later.

Here is the description of the script as printed when called without arguments:

 

 

Usage: muybridge_install_drupal /path/to/webdir domain
This script will setup a shared drupal instance into
a directory of your choice. This directory should be one
that you just created, and contain nothing important.
The script will create a database, a database user and 
the necessary files.
      
WARNING: This script is work in progress. You may shoot yourself in the
foot with it. Please only use it when you understand what it does.    
When an error occurs at some stage, changes made until that point are NOT reverted.

 

 

Before you use the script, check the settings section in it and adapt it to your needs. The script has to be run as a user that has write access to the directory you want to install the shared instance into, as well as the sites dir of the shared drupal directory and /etc/cron.hourly/ . You will be asked for the mysql root password so that a new database and user can be created (adapting this to use another mysql user who has sufficient privileges would be trivial tough). Ok, I hope I remembered everything important - more info will be added to this post when found.

Blessed be darcs

During the last days I started to install some long-overdue updates to some webservers I manage. The problem was this: a long time ago I installed some webapps written mostly in php. People started to use them and demanded modifications. Nothing big really, but enough to make updates a pain - which led to no security updates in a long time. I started to use the brilliant version control software darcs along with the very convenient script darcs_load_dirs to install the updates. To get them on debian do apt-get install darcs darcs_load_dirs. I really recomend darcs for this (as opposed to e.g. subversion which I use at work) because it's very easy to setup/use from commandline and has a very powerfull automated merging mechanism.

Disclaimer: Although I use version management in one form or another for quite some time now, I am very new to darcs so some of the things I did could be cumbersome or wrong - read it at your own risk :). 

The process is basically this: create a new darcs dir somewhere that will receive the upstream updates of the software. I called it current.

mkdir current
cd current
darcs init

Now copy the base version (the version you started with originally) into the darcs managed dir. To find out which version you used, checkout changelog or some such file.

cp ~/base-version . -r
darcs add * -r
darcs record -am "Imported base version"

This adds the base version to the repository and creates the first revision. Now we will create a branch (a copy of the repository in darcs) to hold our modifications.

cd ..
mkdir currentWithLocalChanges
cd currentWithLocalChanges
darcs get ../current

Now copy all the relevant files from your modified install into the currentWithLocalChanges dir. You will probably have to add the new files, then you might want to review the changes and record them.

cd current
cp ~/installedVersion . -r
darcs add * -r
darcs whatsnew
darcs record -am "imported local changes"

Now apply all the new versions. For this, I simply downloaded every subsequent release (just to be sure, you can also do this directly with the new upstream version as shown in the example below) new source packages that contain the whole new source and unzipped them into
its own folder. Use darcs_load_dirs to check for differences and record them.

cd ../current
darcs_load_dirs ../newVersion

This automatically records the changes. You can take a look with darcs changes [-s]. Now you simply pull them over to your locally changed version:

cd ../currentWithLocalChanges/current
darcs pull ../../current

Bad packages (like phpbb, which really sucks) will have quite a few merge-conflicts that you have to resolve by hand now (altough darcs is really superb when it comes to automated merging). Good packages (like drupal) will work automatically because they can be extended with new pluginfiles, and not with changes to the original files.

When you need to make changes again, just do a

darcs add * -r
darcs record

again. BTW: fabian started to put the entire etc dir of the servers he administers under darcs control!

System.Random(int seed) changed between .NET 1.1 and 2.0

Using the brilliant tool Reflector I found out that there is a breaking change in the constructor of System.Random between .NET Framework 1.1 and 2.0 - the random numbers generated by the same seed in both versions are different. Since this is not documented anywhere I thought I'd post it here. (Of course this is usually not a problem, but I relied on a certain sequence with a given seed for Unittesting).

Design by Daniel Bachler - created with drupal - set in Melbourne by Marco Müller