Skip to content

Instantly share code, notes, and snippets.

while true
do
tput clear
date
/usr/local/icinga/bin/icinga -v /etc/nagios3/icinga.cfg | grep -B 10 'Total Errors:'
sleep 30
done
task :synctopbuilder do
tmp_freedhcp_index="tmp/freedhcp-server-index"
rm_rf freedhcpsrc + '/' + tmp_freedhcp_index
sh "git --work-tree=#{freedhcpsrc} --git-dir=#{freedhcpsrc}/.git " +
"checkout-index -a -f --prefix=#{tmp_freedhcp_index}/"
sh "rsync --delete -r #{freedhcpsrc}/#{tmp_freedhcp_index} #{srcforpbuilder}"
end
cfg_parser() {
IFS=$'\n' && ini=( $(<$1) ) # convert to line-array
ini=( ${ini[*]//;*/} ) # remove comments ;
ini=( ${ini[*]//\#*/} ) # remove comments #
ini=( ${ini[*]/#[/\}$'\n'cfg.section.} ) # set section prefix
ini=( ${ini[*]/%]/ \(} ) # convert text2function (1)
ini=( ${ini[*]/=/=\( } ) # convert item to array
ini=( ${ini[*]/%/ \)} ) # close array parenthesis
ini=( ${ini[*]/%\( \)/\(\) \{} ) # convert text2function (2)
ini=( ${ini[*]/%\} \)/\}} ) # remove extra parenthesis
@skiold
skiold / gist:783065
Created January 17, 2011 16:39
Gemset install
scyldinga@Tarena-3 ls ~/.rvm/gems/ruby-1.8.7-p330\@test-gemset/
/Users/scyldinga
scyldinga@Tarena-3 rvm info
ruby-1.8.7-p330@test-gemset:
system:
uname: "Darwin Tarena-3.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:57:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_PPC Power Macintosh"
bash: "/bin/bash => GNU bash, version 3.2.17(1)-release (powerpc-apple-darwin9.0)"
zsh: "/bin/zsh => zsh 4.3.4 (i386-apple-darwin9.0)"
@skiold
skiold / ipv6script
Created June 3, 2011 10:46
hurricane electric ipv6 tunneling script for macosx
#!/bin/bash
#######################################################################
# Update the HE (Hurricane Electric) ipv6-tunnel
#######################################################################
# original at: http://pugio.net/2009/01/enable-ipv6-on-mac-os-x-the-tu.html
# Interfaces to try, in order: en1 = Airport, en0 = Ethernet
MYIFS="en0 en1"
# leave as is
IPCACHE="/Library/Caches/ipv6scriptIP"
@skiold
skiold / scripts-checkbashisms.pl
Created December 27, 2011 14:29
check for posix compliancy
#! /usr/bin/perl -w
# This script is essentially copied from /usr/share/lintian/checks/scripts,
# which is:
# Copyright (C) 1998 Richard Braakman
# Copyright (C) 2002 Josip Rodin
# This version is
# Copyright (C) 2003 Julian Gilbey
#
# This program is free software; you can redistribute it and/or modify
@skiold
skiold / knife_ssh_config.rb
Created July 26, 2012 08:02
knife plugin to generate ssh config
## Knife plugin to generate an OpenSSH config file from a Chef search
# From Harvest. www.getharvest.com
# Modified for EC2 usage by Scott Likens
#
# Source: https://github.com/harvesthq/knife-plugins
#
# See http://wiki.opscode.com/display/chef/Knife+Plugins
# See http://www.openbsd.org/cgi-bin/man.cgi?query=ssh_config&sektion=5
#
## Install
@skiold
skiold / ssh-agent.bash
Created August 5, 2012 16:25
ssh-agent initialization
function sshagent_findsockets {
find /tmp -uid $(id -u) -type s -name agent.\* 2>/dev/null
}
function sshagent_testsocket {
if [ ! -x "$(which ssh-add)" ] ; then
echo "ssh-add is not available; agent testing aborted"
return 1
fi
@skiold
skiold / Coordinador Sistemas
Created September 11, 2012 09:05
Grupo Taric busca coordinador Dpto de sistemas
Grupo Taric busca una persona para ayudar en la modernización de su infraestructura.
Una organizacion con un énfasis real en 'personas' y 'cultura', aun a
costa de eficiencia (-eficiencia, +resiliencia).
El pequeño equipo de sistemas se encarga de mantener los sistemas y procesos históricos
del grupo así como de dar soporte a las nuevas necesidades de infraestructura.
Buscamos una persona que ayude en la comunicación del equipo con el resto de la
organización.
@skiold
skiold / minimum boto py3 fail.py
Last active December 14, 2015 01:29
Trying boto.ec2 with python 3.3
import boto.ec2
boto.ec2.regions()