// SkatchUp Ruby API

Load an extension

Window => Preferences => Extensions => Install Extension ... and upload a ''.rbz'' file (zip file with a tree of ''.rb'' files.

Reload an extesion while SkatchUp is running

Open the ruby console and run

load '<name of the file to be reloaded>.rb'

// Dynamic debian/control and launchpad recipes

Problem

Avoid build of a specific package (remmina-plugin-spice) for a specific ubuntu serie (trusty) and for a specific hardware architecture (armhf) remaining compatible with launchpad recipe building system.

14.04 (Trusty) 15.04 (Wily) 16.04 (Xenial) 16.10 (Yakkety)
amd64 (Ok) (Ok) (Ok) (Ok)
i386 (Ok) (Ok) (Ok) (Ok)
armhf (Ko) (Ok) (Ok) (Ok)

(non) bash script solution

The most natural way to solve the problem was create a debian/control template where put placeholders and set them with a script accordingly with the ubuntu serie and the hardware architecture where the build was made.

Few minutes and the solution was working but … the launchpad recipes building system not allow to run scripts so it wasn't a viable solution.

debian/rules script solution

No on-line documentation handle the argument so I scratched my head for a while looking possible solutions.

Looking around I found some debian/control.in files in already downloaded ubuntu package sources and in particular libgtk-3-0 has this kind of solution.

build system

Launchpad recipes are based on a bazaar plugin named bzr-builder with the limitation that the run command is disabled (that could have saved us).

The sistem architecture is, for each ubuntu serie a package source is created and uploaded on different hardware architectures of the same serie to be built.

debian/rules solution

Luckily we can customize the debian/rules makefile to create a different debian/control during the source package creation of each ubuntu serie.

implementation

identify the ubuntu serie

the too comfortable lsb-release is not available in the reduced building system so you must manipulate the /etc/os-version file to extract the ubuntu serie:

UBUNTU_SERIE=$(shell grep '^VERSION=' /etc/os-release | sed 's/^[^"]*"//g;s/".*//g;s/^[^,]*, *//g;s/ .*//g;s/\(.*\)/\L\1/g')

Now you can use the UBUNTU_SERIE variable to assign conditionally other variables:

ifeq ($(UBUNTU_SERIE),trusty)
        REMMINA_PLUGIN_SPICE_ARCHITECTURES=amd64 i386
        REMMINA_PLUGIN_SPICE_BUILDDEPS_ARCHS=[!armhf]
else
        REMMINA_PLUGIN_SPICE_ARCHITECTURES=amd64 i386 armhf
        REMMINA_PLUGIN_SPICE_BUILDDEPS_ARCHS=
endif

create different debian/control

During the source package preparation the clean target of debian/rules is required, attaching to it a dependency to debian/control file in the proper way guarantees that code associate to it in the makefile script will be called before source packaging; to do it the target clean is defined with the special the special double column suffix :: syntax.

Double column allow to define rules that are always called also if other target matches the target.

    . . .
debian/control::
        dh_testdir
        sed \
                -e "s#@REMMINA_PLUGIN_SPICE_BUILDDEPS_ARCHS@#$(REMMINA_PLUGIN_SPICE_BUILDDEPS_ARCHS)#g" \
                -e "s#@REMMINA_PLUGIN_SPICE_ARCHITECTURES@#$(REMMINA_PLUGIN_SPICE_ARCHITECTURES)#g" \
                $@.in > $@

%:
        dh $@ --dbg-package=remmina-dbg

clean:: debian/control
        # gross kludge to force control generation with the %.in target
        touch debian/control.in
    . . .

The complete example could be found in this branch of my remmina fork.

The working recipe could be found on lounchpad, here.

// Tardigrad (тардиград): tardigrade terrarium with robotic tracking cam system

Muraveygrad (муравьиград/ants-city): ant terrarium with robotic tracking cam system

First phase of Tardigrad project that use ant as track subject instead of tardigrade (no microscope required).

Tardigrades real scale

Components

2D moving plane

  • Linear actuator with stepper motor (< 10€ each)
    Specs:
    • 63 mm excursion
    • DC 4-5v

// SpeedNotes

insieme ad un desmo-amico ci è venuta in mente l'idea di aggiungere infografiche sui video fatti dalla GoPro che ha montato sulla moto integrando i dati rilevati dai sensori del cellulare, questo è il risultato:

Siccome l'appetito vien mangiando abbiamo aggiunto anche un cronografo:

// La balistica delle armi di rappresaglia

Voglio condividere uno strano percorso di scoperta che segue su doppio binario la parabola delle Vergeltungswaffe, delle “armi di rappresaglia” naziste e degli ingegneri che in un modo o nell'altro presero parte ai loro progetti.

Ripercorro in ordine cronologico da cosa ero partito e a cosa sono arrivato.

  • avevo bisogno di scrivere correttamente il nome del padre della missilistica Von Braun e, sapendo che aveva progettato la V2 vado su wikipedia alla voce V2, trovandolo, ma scopro che quello che avevo in mente come V2 non era quello che è in realtà,
    visto che mi aspettavo questo:
    e invece mi sono imbattuto in questo:
  • ci vogliono pochi secondi seguendo qualche link in fondo alla pagina di wikipedia per scoprire che quello che avevo sempre pensato essere una V2 in realtà era una V1, poco male sbagliavo solo di un unità in fin dei conti ma in fondo alla pagina scopro che oltre alle V1 e V2 esisteva anche una V3 (di cui ignoravo l'esistenza)