Skip to content

Instantly share code, notes, and snippets.

View riccardomurri's full-sized avatar

Riccardo Murri riccardomurri

View GitHub Profile
anonymous
anonymous / cmk-add-host
Created October 16, 2013 14:12
Check MK add host script in bash
#!/bin/bash
site=$1; shift
hostname=$1; shift
mk_file="/opt/omd/sites/$site/etc/check_mk/conf.d/wato/hosts.mk"
wato_file="$(dirname $mk_file)/.wato"
## exit with code 1 if host exists
(
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active April 17, 2024 10:51
Backend Architectures Keywords and References
@riccardomurri
riccardomurri / concurrent_bitset.hpp
Created December 30, 2011 18:51
Implementation of a concurrent `std::bitset` using Intel TBB.
/**
* @file concurrent_bitset.hpp
*
* Implementation of a concurrent @c std::bitset using Intel TBB.
*
* @author riccardo.murri@gmail.com
* @version $Revision$
*/
/*
* Copyright (c) 2011 Riccardo Murri <riccardo.murri@gmail.com>. All rights reserved.
@riccardomurri
riccardomurri / gist:1157664
Created August 19, 2011 18:51
Emacs commands to wrap a block of text into start/end tags, or insert them. Similar to what AUC-TeX' font commands do, but generic.
(defun wrap-region-in (start-text end-text)
"Insert START-TEXT at the beginning of the currently active
region, and END-TEXT at the end of it."
(let ((start (min (point) (mark)))
(end (max (point) (mark))))
(save-excursion
(goto-char end)
(insert end-text)
(goto-char start)
(insert start-text))))
@riccardomurri
riccardomurri / LaTeX-transpose-table.el
Created August 19, 2011 18:44
Emacs command to transpose the contents of a (La)TeX table.
(defun LaTeX-transpose-table (start end)
(interactive "r")
(goto-char start)
(let ((last start)
(rows (list ()))
(nrows 0)
(ncols 0)
(maxcols 0))
(while (re-search-forward "&\\|\\\\\\\\" end t)
(setf (car rows)