Skip to content

Instantly share code, notes, and snippets.

@berghaus
berghaus / ugrextchecksum.sh
Created December 6, 2021 14:49
Scriped called by Dynafed when storage backend does not support Want-Digest header
#!/bin/bash
# Input arguments:
# $1 Signed GET URL
# $2 Checksum Type (md5, adler32, ...)
#
# Output:
# Should stdout with the format (no quotations):
# ">>>>> HASH 123124\n"
# we are going to use some storage stats toolage
@berghaus
berghaus / frank.pub
Created May 21, 2021 10:32
My public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDYwVT+a4+GbQd0ZZY9o/I94T2BQEjpYTV3SM6TgWmtosG7gPZa0LmCSJWDmApHVIw/b6Q6xBVMJvmslRblHpW3vMs5LE2CVTWguXZbp4dKwEeZxPjcdMKPgl9VO2LB2fnltjnvMNsPdzMVviTaQoMhwvRB/vsAW0Mbse5la0CJAogvb5EA++sRvsk+6ftpDTOC1YFdINtaRAUINYv8NwxnEKri82eWE0pV83xLoA4/+YdRRqhPStGRmRoRyn3u4vOdhLlzcBp85xTc56bLvquODYDOTR9NSRvQpCrWHdIXZwFUbMPW6+ONxbNQTE+47QYDgj2i4tq8DX6Z56Q3C5i5FNrbaARnq4ml+bOR/wqCoWmKK3A7vKi7ng/QZjQu0wi9YFT7roU4uXF1hdsFFuIp+zX9kArbbxG+YdE95Ubwfun1qtqKzJr1/QcBn3KZqcrVKzuS6F5lv9s9VP9Ic7Os4wkwAGr1OlhRszZNcMBW/fHXLIlOO59rJclKNX7I+yjhmYa7W+JKrJxCkwzxuTa9J25Loh9v5z9MH9xGGxuk1scmOO7R8wkJjpjgPJqbw6p6VcV8m3cs556BL7c50++JVP3WaJXEoqSRz4x2+qFSfoZdbmR+7iVoPkU83QW3Ae5FoIjU4H4eiAoTkPtftFbe8lIOWIabe5O7b267voisgQ== frank@eva
@berghaus
berghaus / make-atlas-access-map.conf
Created February 21, 2019 08:19
An daily cron job that grabs DNs in the ATLAS VO and generates a Dynafed configuration allowing read access to all
edg-mkgridmap --conf=/etc/edg-mkgridmap-atlas.conf|awk '{NF=NF-1;print "glb.allowusers[]: "$0" /data rl"}' > /etc/ugr/conf.d/access-atlas.conf
@berghaus
berghaus / panda_queueconfig.json
Last active February 15, 2019 15:08
Sample queue configuration where the messenger configuration for a specific queue overrides that of the template used in the queues.
{
"PRODUCTION_PUSH_TEMPLATE": {
"prodSourceLabel": "managed",
"nQueueLimitJobRatio": 50,
"nQueueLimitJobMax": 1000,
"nQueueLimitJobMin": 20,
"nQueueLimitWorker": 1000,
"maxWorkers": 10000,
"maxNewWorkersPerCycle": 100,
"mapType": "OneToOne",
@berghaus
berghaus / pre-commit
Last active November 21, 2017 14:57
Rucio pre-commit hook with docker
#!/usr/bin/env python
# Copyright European Organization for Nuclear Research (CERN)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Authors:
# - Vincent Garonne, <vincent.garonne@cern.ch>, 2012
@berghaus
berghaus / ATLAS_CAP_Metadata.md
Created March 15, 2016 16:10
a list of stuff from CMS/LHCb with some things I think may be relevant for ATLAS.
  • Basic Information:
    • Analysis number: On CMS' DAS as a catalogue of analyses. Do we have a similar register of ATLAS analyses?
  • Dataset: An array of files following the software provenance of the xAOD (level-3) used by the analysis back to the original RAW (level-4) data. This would be on AMI right now. Each data set here should contain:
    • Title
    • Description
    • type (RAW, ESD, AOD, D3PD)
    • Software version that produced the data
    • Dataset ID
    • Number of events
  • Integrated luminosity
@berghaus
berghaus / csv2json.py
Last active February 29, 2016 12:01
A script to convert CSV data into a list of JSON dictionaries.
# script to convert accelerators csv to json
import pandas
import json
import sys
def main(argv):
in_file = argv[0]
out_file = argv[1]
@berghaus
berghaus / query-inspire.py
Created February 9, 2016 10:40
A script to query the number of publications per year by the LHC collaborations from the inspire records. Written with hints from Sunje, Annette, Patricia, and Anxhela :-)
import json
import urllib2
from prettytable import PrettyTable
experiments = [ 'cern-lhc-alice', 'cern-lhc-atlas', 'cern-lhc-cms', 'cern-lhc-lhcb']
years = range(2008,2016)
publications = PrettyTable( ["Year"] + experiments )
for year in years:
@berghaus
berghaus / keybase.md
Created February 16, 2015 13:49
keybase identification

Keybase proof

I hereby claim:

  • I am berghaus on github.
  • I am berghaus (https://keybase.io/berghaus) on keybase.
  • I have a public key whose fingerprint is DF21 F80F C7DE CC9E 331B E8A4 9CD8 F59F 0FA8 2BFC

To claim this, I am signing this object:

@berghaus
berghaus / killAmazonInstances.sh
Created October 29, 2014 23:12
Script to kill stopped instances in all amazon EC2 regions
#!/bin/bash
export EC2_URL=https://ec2.us-east-1.amazonaws.com
export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
export EC2_HOME=/usr/local/ec2/ec2-api-tools-1.7.1.0
export PATH=$PATH:$EC2_HOME/bin
export AWS_ACCESS_KEY=
export AWS_SECRET_KEY=
for endpoint in $(ec2-describe-regions | awk '{print $3}');