Skip to content

Instantly share code, notes, and snippets.

@ebirn
ebirn / ssh_client_config
Last active April 24, 2026 13:57
MacOS SSH config for secure keys (secure enclave + touchid, yubikey)
# to use the "tagged" config on the commandline:
# ssh -P <tagname> example.com
# to reuse the config in a Host block, use as stanza within the Host block
# Tag <tagname>
# see also https://man7.org/linux/man-pages/man5/ssh_config.5.html
# MacOS secure enclave + touchid
# see also https://gist.github.com/arianvp/5f59f1783e3eaf1a2d4cd8e952bb4acf
# requires downloading key first, disable password (it needs touchid anyways)
@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