Skip to content

Instantly share code, notes, and snippets.

View corbinbs's full-sized avatar
💭
🚜💻📈

Brian S. Corbin corbinbs

💭
🚜💻📈
View GitHub Profile
@binura-g
binura-g / single-line-cert.sh
Last active May 2, 2024 06:52
Convert Certificates ( .pem, / .crt / etc ) into single-line strings for JSON payloads
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' cert-name.pem
@hynek
hynek / gunicorn_callbacks_for_worker_id.py
Last active March 6, 2024 04:55
This is an attempt to emulate uWSGI’s uwsgi.worker_id() that ensures that I have worker IDs from 1…--workers which is useful in logging and instrumentation where changing PIDs are annoying.
import os
def on_starting(server):
"""
Attach a set of IDs that can be temporarily re-used.
Used on reloads when each worker exists twice.
"""
server._worker_id_overload = set()
@progrium
progrium / sshmany
Last active April 20, 2016 12:37
bash script for executing a command via ssh in parallel on multiple servers with colored output
#!/bin/bash
#
# Usage:
# $ echo "host1 host2 host3" | ./sshmany uname -a
# $ cat myservers | ./sshmany echo Hello world
#
cmd="$@"
servers="$(cat)"
i=37
for server in $servers; do
@kstrauser
kstrauser / freezewheels.py
Created August 29, 2013 17:45
This works like a hypothetical "pip freezewheels" that makes wheels of all installed packages.
#!/usr/bin/env python
"""
Build wheels of all currently installed packages (as listed by "pip freeze")
"""
import glob
import importlib
from subprocess import call
@bsneed
bsneed / build_runscript.sh
Created July 21, 2011 06:33
Copy a settings bundle and set a useful version for testflight if its a Debug build. This happens post file copy and won't change your source files.
#!/bin/bash
BUILD_VER=$(/usr/bin/defaults read ${CODESIGNING_FOLDER_PATH}/Info CFBundleVersion)
BUILD_APPNAME=$(/usr/bin/defaults read ${CODESIGNING_FOLDER_PATH}/Info CFBundleDisplayName)
if [ "$CONFIGURATION" == "Debug" ]; then
echo leaving Settings.bundle in place.
/usr/bin/defaults write ${CODESIGNING_FOLDER_PATH}/Info CFBundleDisplayName "WM ß - $BUILD_VER"
else
rm -rf ${CODESIGNING_FOLDER_PATH}/Settings.bundle