This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -f "/usr/bin/shasum" ]]; then | |
SHASUM='/usr/bin/shasum' | |
else SHASUM='/usr/bin/sha1sum' | |
fi | |
if [[ -n "$XML1" ]] && [[ -n "$XML2" ]] && [[ "$XML1" != "$XML2" ]]; then | |
profiles=$(diff $XML1 $XML2 --brief | grep -v '\.dep' | grep -v '\.json\.gz' | grep -v profiles-info.xml | grep -v "Only in" | awk '{ print $2 }' | sed "s/^.*\///g") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 -u | |
from sys import stdin, stdout | |
from re import compile | |
RE_ERROR = compile(r'\[panc\]([\w\s]+)\[(/.+):(\d+).(\d+)-(\d+).(\d+)\]') | |
RE_INFO = compile(r'\[panc\](.+)') | |
def caretline(pos, pre = 0, post = 0): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import urllib2 | |
# Get org data = http://gtr.rcuk.ac.uk/organisation/2512EF1C-401B-4222-9869-A770D4C5FAC7.json | |
# Get project data = http://gtr.rcuk.ac.uk/search/project.json?term=mouse | |
f = urllib2.urlopen('http://gtr.rcuk.ac.uk/search/project.json?term=mouse') | |
data = json.load(f) | |
f.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ "$#" -eq 2 ]]; then | |
if [[ "$1" == *.dep ]]; then | |
awk '! /ABSENT_SOURCE/ {sub("^[^:]*:", "", $3); print $3$1($2!="TEXT"?"."tolower($2):"")}' $1 | xargs grep $2 | |
else | |
echo "DEP_FILE must be a pan dependency file" | |
fi | |
else | |
echo "Usage: searchprofile DEP_FILE NEEDLE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
"""Gather and submit some operating data about a Quattor server""" | |
import os | |
import platform | |
import urllib | |
import ConfigParser | |
import argparse | |
from datetime import date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $# -eq 1 ]]; then | |
hosts=$(curl -s http://aquilon.example.com:6901/find/host?personality=$1) | |
if [[ $hosts ]]; then | |
cssh -l root $hosts | |
else | |
echo "ERROR: No hosts found with personality $1" | |
fi | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Copyright 2004 by Madhusudan Singh <madhusudan.singh@gmail.com> | |
% Copyright 2014 by James Adams <james.adams@stfc.ac.uk> | |
% | |
% This file may be distributed and/or modified | |
% | |
% 1. under the LaTeX Project Public License and/or | |
% 2. under the GNU Public License. | |
% | |
% See the file doc/licenses/LICENSE for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
file { | |
path => "/var/lib/condor/spool/history" | |
sincedb_path => "/opt/logstash/sincedb" | |
start_position => "beginning" | |
} | |
} | |
filter { | |
multiline { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python2 | |
import cgi | |
import socket | |
import time | |
from os import environ | |
KNC_SOCKET_PATH = '/var/quattor/run/sockets/kncsock' | |
def recv_timeout(the_socket,timeout=2): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gen(d, pfx=()): | |
return ( | |
x for k, v in d.iteritems() | |
for x in ( | |
gen(v, pfx+(k,)) if isinstance(v, dict) else ((pfx+(k,), v),) | |
) | |
) | |
def flattendict(tree): | |
paths = [] |
OlderNewer