Plugins en Python

— [ edit | raw ]

Siempre me ha gustado escribir aplicaciones extensibles, pero picarme todo un sistema de plugins me ha parecido tedioso.

Por eso he intentado buscar librerías que me ayuden a crear plugins, aunque siempre he tenido problemas para la distribución de éstos, como me ha pasado con Yapsy.

La verdad es que me he sentido como un auténtico estúpido al descubrir que Python tiene un sistema para escribir plugins muy sencillo de usar. Vamos a ver cómo.

Puedes encontrar el artículo original en: MagMax Blog.

How to annotate/tag stdout and stderr outputs with bash

Lets create a test script test-std.sh:

#!/bin/bash --

echo info
echo error >&2

We will use sed to prepend some text to each output line. To perform redirection we use a less known feature called process substitution.

$ ./test-std.sh 2> >(sed 's/^/err: /g') > >(sed 's/^/out: /g')
out: info
err: error

And… it’s possible to use a different color to each of them too

How to revoke a GPG key

Generate revocation certificate:

gpg -o revocation.asc --gen-revoke F8025C91

Import the certificate to revoke the corresponding key:

gpg --import revocation.asc

Public the revoked key to servers:

gpg --keyserver pgp.mit.edu --send-keys F8025C91

ELK (Elastic + logstash + Kibana) para dummies

Enlazo un tutorial del colega Magmax para montar un entorno básico ELK (ElasticSearch + logstash + Kibana) como sistema de monitorización. Probablemente el que llega más lejos con menos rollo, y con screencast y todo.

Monitorización con ElasticSearch, Kibana y TopBeat

Creating VDI virtual disks for Virtualbox machines (with Vagrant)

When vagrant create Virtualbox machines, disks are created with VMDK format. Therefore, the VDI format has some interesting advantages. This recipe shows a setup to create VDI disks instead VMDK.

Using an actual partition as «virtual» disk for Virtualbox with Vagrant

Virtualbox can use actual partitios for its disks. This task may be simple using the virtual GUI, but in this case, we want automatize the process with Vagrant.

Installing the Ice-3.6.2 packages from ZeroC on Debian

ZeroC provides their own (non-official) Ubuntu packages for the version 3.6. This recipe includes all steps for a successful installation on Debian jessie.

passwd/shadow inconsistencies

If your system issues messages of this type:

su: Authentication failure
(Ignored)
Authentication service cannot retrieve authentication info

Also in /var/log/syslog:

CRON[12591]: Authentication failure

and su and sudo continue working but cron fails, probably you have a /etc/passwd inconsistency respect to /etc/shadow.

Just execute:

$ pwconv
$ grpconv

..to fix them.

apt-mirror: the debian mirror that just works

Have a local debian package mirror may be helpful when you frequently perform recurring instalations: virtual machines, continuous integration, isolated integration testing, docker containers and so on. apt-mirror is a program that can make a perfect mirror clon in a very easy way.

schroot: snapshot chroots

According to its manual page “schroot allows the user to run a command or a login shell in a chroot environment”. As many others (chroot, lxc, docker, vserver) it is a OS virtualizer. Often, these “chroot environments” are known as “jails”. A jail is much faster that a full virtualizer as vmware, virtualbox, etc.

In that recipe we explore a interesting feature: jail snapshoting