Skip to content

Instantly share code, notes, and snippets.

@JohannesRudolph
JohannesRudolph / collie-cheatsheet.sh
Created June 30, 2022 09:33
collie cli cheatsheet - a list of useful tricks around collie
# query costs and output a filtered tsv, inspiration https://stackoverflow.com/a/39144364/125407
collie tenant cost --from 2022-05-01 --to 2022-05-31 meshcloud-dev --platform azure.meshcloud-azure-dev -o json \
| jq -r ".[] | [.relatedTenant.platformTenantId, .relatedTenant.platformTenantName, .totalUsageCost] | @tsv"
@JohannesRudolph
JohannesRudolph / fix-refresh-rate.sh
Last active November 30, 2020 08:27 — forked from judas-christ/fix-refresh-rate.sh
How to change refresh rate on an external display on macOS. Useful if for some reason macOS decides to no longer drive your 4k display at 60Hz and gives you no option to correct.
# install cscreen
brew cask install cscreen
# list displays
cscreen -l
# find your external screen in the list and write the number (not the ID) down somewhere
# in the following instructions, use that number instead of <SCREEN>
# list display modes for your external screen
@JohannesRudolph
JohannesRudolph / dashboard.json
Created July 3, 2019 05:25
grafana-repeat-dashboard-export-sample
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@JohannesRudolph
JohannesRudolph / lg.bin
Last active February 24, 2023 18:07
4k at 60Hz via HDMI 2.0 on a Coffee Lake integrated GPU using Fedora
@JohannesRudolph
JohannesRudolph / dbconnect-mongodb.sh
Created June 26, 2018 16:46
connect to cloud foundry db services via cf ssh tunnels
#!/bin/bash
set -e
container="$1:dbssh"
VCAP_SERVICES=$(cf ssh $container -c 'echo $VCAP_SERVICES')
MONGO_URI=$(echo $VCAP_SERVICES | jq -r .MongoDB[0].credentials.uri)
PARSED_URI=$(./parse-url $MONGO_URI)
@JohannesRudolph
JohannesRudolph / keystonev3token.sh
Last active September 23, 2017 18:47
Fetching a project-scoped Keystone V3 Token using bash
#!/bin/bash
set -e
if [ -z "$OS_USERNAME" ]; then echo "Error: OS_USERNAME is unset"; exit 1; fi;
if [ -z "$OS_PASSWORD" ]; then echo "Error: OS_PASSWORD is unset"; exit 1; fi;
if [ -z "$OS_USER_DOMAIN_NAME" ]; then echo "Error: OS_USER_DOMAIN_NAME is unset"; exit 1; fi;
if [ -z "$OS_PROJECT_DOMAIN_NAME" ]; then echo "Error: OS_PROJECT_DOMAIN_NAME is unset"; exit 1; fi;
if [ -z "$OS_AUTH_URL" ]; then echo "Error: OS_AUTH_URL is unset"; exit 1; fi;
if [ -z "$OS_PROJECT_NAME" ]; then echo "Error: OS_PROJECT_NAME is unset"; exit 1; fi;
@JohannesRudolph
JohannesRudolph / cors.lua
Last active March 4, 2021 13:41
HAproxy Lua Script for answering CORS preflight requests (for OpenStack Swift)
core.register_service("cors-response", "http", function(applet)
applet:set_status(200)
applet:add_header("Content-Length", "0")
applet:add_header("Access-Control-Allow-Origin", applet.headers["origin"][0])
applet:add_header("Access-Control-Allow-Credentials", "true")
applet:add_header("Access-Control-Allow-Headers", "Origin, DNT, If-Match, If-Modified-Since, If-None-Match, If-Range, If-Unmodified-Since, X-Requested-With, Content-Type, X-Auth-Token, X-Service-Token, X-Newest, X-Trans-Id-Extra, X-Trans-Id, X-Account-Meta-Temp-URL-Key, X-Account-Meta-Temp-URL-Key-2, X-Timestamp, X-Openstack-Request-Id, X-Account-Bytes-Used, X-Account-Container-Count, X-Account-Object-Count, X-Account-Meta-Quota-Bytes, X-Account-Access-Control, X-Container-Meta-Temp-URL-Key, X-Container-Meta-Temp-URL-Key-2, X-Storage-Policy, X-Container-Object-Count, X-Container-Bytes-Used, X-Container-Meta-Quota-Count, X-Container-Meta-Quota-Bytes, X-Container-Read, X-Container-Write, X-Container-Sync-Key, X-Container-Sync-To
@JohannesRudolph
JohannesRudolph / haproxy.cfg
Created September 21, 2017 16:20
HAProxy CORS config for Openstack Swift using radosgw - with fixed buffer issue
global
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
@JohannesRudolph
JohannesRudolph / haproxy.cfg
Created September 18, 2017 08:36
HAProxy CORS config for Openstack Swift using radosgw - with buffer issue
global
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
@JohannesRudolph
JohannesRudolph / log.txt
Created July 27, 2017 13:11
concourse-1251-logs
This file has been truncated, but you can view the full file.
{"timestamp":"1501158250.404868841","source":"worker","message":"worker.setup.unpacking","log_level":1,"data":{"session":"1"}}
{"timestamp":"1501158255.259465933","source":"worker","message":"worker.setup.done","log_level":1,"data":{"session":"1"}}
{"timestamp":"1501158255.260781527","source":"worker","message":"worker.garden.extract-resources.extract.extracting","log_level":1,"data":{"resource-type":"archive","session":"2.1.1"}}
{"timestamp":"1501158255.485595226","source":"worker","message":"worker.garden.extract-resources.extract.extracting","log_level":1,"data":{"resource-type":"bosh-deployment","session":"2.1.2"}}
{"timestamp":"1501158255.865631342","source":"worker","message":"worker.garden.extract-resources.extract.extracting","log_level":1,"data":{"resource-type":"bosh-io-release","session":"2.1.3"}}
{"timestamp":"1501158256.025983572","source":"worker","message":"worker.garden.extract-resources.extract.extracting","log_level":1,"data":{"resource-type":"bosh-io-stemcell","session":"2.1.4"}}