Skip to content

Instantly share code, notes, and snippets.

View riccardomurri's full-sized avatar

Riccardo Murri riccardomurri

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#! /bin/sh
#
# Install Ansible on a Ubuntu LTS machine.
#
set -ex
export LC_ALL=C
sudo apt-get update
(de qq Args
(if (== Args NIL)
# `() -> NIL
NIL
# else, Args is a single-element list, extract body forms
(setq Body (car Args))
(if (not (lst? Body))
# `atom -> atom
Body
# else Body is a list that we must unpack
@riccardomurri
riccardomurri / restart_services.cf
Last active August 29, 2015 14:16
Restart services based on defined class/context names.
body common control
{
inputs => {
"lib/cfengine_stdlib.cf",
};
bundlesequence => { "test" };
}
bundle agent test
#! /usr/bin/env python
import re
from markdown2 import markdown
link_patterns = [
# issueNNN --> /help/issueNNN
(re.compile(r'\b(issue)\s*(\d+)\b'), r'/help/\g<1>\g<2>'),
@riccardomurri
riccardomurri / TEST.in
Last active August 29, 2015 14:02
preprocess.cf -- Run external preprocessing commands from CFEngine.
Example processing using the `j2pp` preprocessor;
see: http://github.com/uzh/j2pp
Domain name: {{sys.domain}}
L2 addresses (list):
{% for hwaddr in sys.hardware_addresses -%}
* {{ hwaddr }}
{% endfor %}
@riccardomurri
riccardomurri / TEST.cf
Last active August 29, 2015 13:55
CFEngine module for generating contexts and variables based on the output of `ip addr show`.
# Sample CFEngine usage of the `ips` module.
#
# You should get something like the following:
#
# $ cf-agent -I -f ./TEST.cf -K
# 2014-01-31T16:43:01+0100 info: Executing 'no timeout' ... 'ips'
# 2014-01-31T16:43:01+0100 info: Completed execution of 'ips'
# 2014-01-31T16:43:01+0100 notice: R: Running a test
# 2014-01-31T16:43:01+0100 notice: R: Interface `lo` NOT detected, as it's not UP
# 2014-01-31T16:43:01+0100 notice: R: Interface `wlan0` detected UP
(defun check-cfengine-block-length (filename)
(save-excursion
(find-file filename)
(goto-char (point-min))
(while (re-search-forward "\\[%CFEngine +BEGIN *%\\]" nil 'noerror)
(let ((start (match-end 0))
(start-line (what-line)))
(if (re-search-forward "\\[%CFEngine +END *%\\]" nil 'noerror)
(let ((end (match-beginning 0))
(end-line (what-line)))
@riccardomurri
riccardomurri / gist:6763235
Last active December 24, 2015 07:19
Full error trace leading up to Numba's "NotImplementedError: Unable to cast from { i64, i8* }* to { i64, i8* }"
DEBUG -- translate:361:translate
; ModuleID = 'tmp.module.fatghol.simplematrix.__new__.25311b8'
@PyArray_API = linkonce_odr global i8** inttoptr (i64 46912560938432 to i8**)
define { i64, i8* }* @__numba_specialized_0_fatghol_2E_simplematrix_2E___new__({ i64, i8* }* %cls, i32 %rows, i32 %columns) {
entry:
%objtemp3 = alloca { i64, i8* }*
store { i64, i8* }* null, { i64, i8* }** %objtemp3, !tbaa !2
@riccardomurri
riccardomurri / gc3pie-poster-preview.tex
Created August 22, 2013 12:45
Poster preview for the GC3Pie poster @ EuroSciPy 2013
\documentclass[final,english,serif]{beamer}
\usetheme{gc3}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{gc3}