Skip to content

Instantly share code, notes, and snippets.

View ebirn's full-sized avatar

Erich Birngruber ebirn

View GitHub Profile
@ebirn
ebirn / seff.py
Last active September 30, 2022 14:26
SLURM job efficiency
#!/usr/bin/env python3
# porting of https://github.com/SchedMD/slurm/blob/master/contribs/seff/seff
#
# sacct -P -n -a --format JobID,State,Cluster,AllocCPUS,REQMEM,TotalCPU,Elapsed,MaxRSS,ExitCode,NNodes,NTasks -j 12655203
# sacct --format=Jobid,JobName,State,QOS,Partition%5,Timelimit,Elapsed,NCPU,CPUTime,TotalCpu,SystemCPU,UserCPU,ReqMem,MaxRSS,MaxVMSize $@
import sys
import subprocess
import json
from collections import Counter
@ebirn
ebirn / test.txt
Created October 15, 2019 07:41
test123
This is just a test
@ebirn
ebirn / test.txt
Created October 9, 2019 09:17
test123
This is just a test
@ebirn
ebirn / test.txt
Created October 9, 2019 09:17
test123
This is just a test
@ebirn
ebirn / test.txt
Created October 9, 2019 09:14
test123
This is just a test
@ebirn
ebirn / nodelist.py
Created October 1, 2019 15:01
magic slurm node list parser
#!/usr/bin/env python
import re
node_lists = [
"clip-g1-[0-1],clip-g2-[2-3]",
"clip-g1-0,clip-g2-0",
"clip-g1-0,clip-g2-1",
"clip-g1-1",
"clip-a-[1,3,5]",
"clip-b-[1-3,5]",
@ebirn
ebirn / fluentd-amqp-connect-error.rb
Created January 28, 2019 20:53
Error in fluentd-plugin-amqp when connecting to TLS rabbitmq
require 'bunny'
@rabbitmq_host = 'localhost'
# here the default for :tls value is false
def get_connection_options()
opts = {
hosts: [ @rabbitmq_host ], port: 5671, vhost: '/',
pass: 'guest', user: 'guest', ssl: true,
@ebirn
ebirn / slurm_status.php
Created August 1, 2018 13:31
SLURM job resource utilization things
<!DOCTYPE html>
<html lang="en">
<head>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet">
<title>CIR Status Board</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="date.js"></script>
@ebirn
ebirn / ansible-add-string-to-line.yml
Created February 7, 2018 10:32 — forked from iAugur/ansible-add-string-to-line.yml
Ansible: Add a String to an existing line in a file
# Adapted from solution provided by http://stackoverflow.com/users/57719/chin-huang http://stackoverflow.com/a/31465939/348868
# Scenario: You want to add a group to the list of the AllowGroups in ssh_config
# before:
# AllowGroups Group1
# After:
# AllowGroups Group1 Group2
- name: Add Group to AllowGroups
replace:
backup: yes
@ebirn
ebirn / gist:9e9cfab3893ff5ae93a160f627fa3cd0
Created July 6, 2017 12:34
remote tcpdump - local wireshark
REMOTE_HOST=""
# tcpdump:
# -U ... unbuffered
# -w ... write to file (- stdout)
#
ssh $REMOTE_HOST 'sudo tcpdump -i eth0 -U -w - not port 22' | wireshark -i - -k