Skip to content

Instantly share code, notes, and snippets.

@treydock
treydock / main.go
Last active November 11, 2020 15:40
tsm_exporter google/goexpect
package main
import (
"flag"
"fmt"
"log"
"os"
"regexp"
"time"
import logging
import os
from osc.stdlib import exec_cmd
log = logging.getLogger(__name__)
# Needed to support Python 2.6
from osc.logs import logging_null_handler
log.addHandler(logging_null_handler)
class GPFS(object):
#!/usr/bin/env python
import os
import sys
import argparse
import subprocess
import time
import datetime
import pytz
import filelock
@treydock
treydock / job_submit.lua
Created February 1, 2016 17:13
SLURM Lua job submit plugin - 15.08
--[[
SLURM job submit filter for QOS
Some code and ideas pulled from https://github.com/edf-hpc/slurm-llnl-misc-plugins/blob/master/job_submit/job_submit.lua
--]]
--########################################################################--
--
@treydock
treydock / papply
Created October 16, 2014 04:35
Puppet masterless script
#!/bin/bash
readonly ENVIRONMENTPATH="/apps/puppet/environments"
readonly DEF_ENV="production"
readonly PROGNAME=$(basename $0)
usage () {
cat << EOF
usage: ${PROGNAME} [OPTIONS]
@treydock
treydock / 00-extract.sh
Last active August 29, 2015 14:07
Kickstart install PerfSONAR
# Steps to extract the contents of perfSONAR NetInstall ISO
# Download ISO and MD5 checksum
wget http://software.internet2.edu/pS-Performance_Toolkit/pS-Performance_Toolkit-3.4-NetInstall-x86_64.iso
wget http://software.internet2.edu/pS-Performance_Toolkit/pS-Performance_Toolkit-3.4-NetInstall-x86_64.iso.md5
md5sum -c pS-Performance_Toolkit-3.4-NetInstall-x86_64.iso.md5
# Mount ISO
mkdir /mnt/perfsonar
sudo mount -o loop pS-Performance_Toolkit-3.4-NetInstall-x86_64.iso /mnt/perfsonar
@treydock
treydock / local_hierarchical_mns.py
Created September 14, 2014 17:37
LocalHierarchicalMNS
##
# Copyright 2013-2014 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (http://www.herculesstichting.be/in_English)
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).
#
@treydock
treydock / build.sh
Created September 12, 2014 18:39
SLURM build script
#!/bin/bash
RPMBUILD_OPTS="--define '_without_aix 1' \
--define '_with_blcr 1' \
--define '_with_lua 1' \
--define '_without_postgres 1' \
--define '_without_sgijob 1' \
--define '_with_pam 1' \
--define '_with_readline 1' \
--define '_with_mysql 1' \
@treydock
treydock / SitePackage.lua
Created August 22, 2014 22:34
Lmod SitePackage.lua
-- -*- lua -*-
-- vim:ft=lua:et:ts=4
require("sandbox")
require("strict")
local Dbg = require("Dbg")
local dbg = Dbg:dbg()
local unpack = unpack or table.unpack
local hook = require("Hook")
@treydock
treydock / ovirt_node_regster.sh
Last active August 29, 2015 14:05
oVirt node registration using Host Deploy Protocol
#!/bin/bash
# Uses oVirt Host Deploy Protocol - http://www.ovirt.org/Features/HostDeployProtocol
# Define variables
engine="<CHANGEME ENGINE FQDN>"
address="<CHANGEME IPADDRESS>" # Could use `facter ipaddress`
sshPort=22
sshKeyFingerprint=$(ssh-keygen -lf /etc/ssh/ssh_host_rsa_key | awk -F' ' '{ print $2 }') # Facter does not yet have this fact
sshUser="root"