Skip to content

Instantly share code, notes, and snippets.

View schnapster's full-sized avatar
🔥

Dennis Neufeld schnapster

🔥
View GitHub Profile
@v--
v-- / party_mode.ipynb
Last active August 26, 2022 10:17
Achieve full runtime nondeterminism by randomly selecting which function to run
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andrebrait
andrebrait / keychron_linux.md
Last active June 26, 2024 03:35
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@schnapster
schnapster / grafana_b2_backup.sh
Last active June 23, 2024 16:35
Backup Grafana sqlite db to Backblaze
#!/bin/bash
#
# Prerequisites:
# sudo apt install pipx curl jq tar sqlite3
# sudo pipx install b2
#
# pass 4 args:
# - instance (meta information), example: <machine name>
# - b2 bucket name (target of the upload), example: grafana-backups
# - path to backblaze credentials file that sets B2_ACCOUNT_ID and B2_APP_KEY
@schnapster
schnapster / prometheus_b2_backup.sh
Last active June 23, 2024 16:35
Backup Prometheus v2.1+ snapshots to b2 backblaze. Requires b2, curl, jq, tar
#!/bin/bash
#
# Prerequisites:
# sudo apt install pipx curl jq tar
# sudo pipx install b2
#
# Enabled admin api in your prometheus, see: https://prometheus.io/docs/prometheus/2.1/querying/api/#tsdb-admin-apis
#
# pass 6 args:
# - prometheus base url, example: http://localhost:9090
@seanhandley
seanhandley / docker-compose.yml
Last active June 7, 2024 19:25
How To Set Up Docker For Mac (Mojave) with Native NFS
version: '2'
services:
api:
volumes:
- "nfsmount:${CONTAINER_DIR}"
volumes:
nfsmount:
driver: local
driver_opts:
@ggarcia24
ggarcia24 / pipeline.gdsl
Last active June 15, 2024 20:25
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
@a7ul
a7ul / jamf.md
Last active May 31, 2024 15:49
removing all restrictions on jamf managed macos device - Provided you have root access.

REMOVE JAMF RESTRICTIONS ON MAC

REMOVE ONLY RESTRICTIONS

sudo jamf removeMDMProfile removes all restrictions

sudo jamf manage brings back all restrictions and profiles

REMOVE ALL RESTRICTIONS AND DISABLE JAMF BINARIES WHILE KEEPING YOUR ACCESS TO VPN AND OTHER SERVICES

sudo jamf removeMDMProfile removes all restrictions

@hurricane-voronin
hurricane-voronin / README.md
Last active July 1, 2024 16:42
Naming Classes Without a 'Manager'
@joshenders
joshenders / smokeping.sh
Last active July 26, 2022 18:43
Poor man's smokeping for OS X
#!/bin/bash
# https://gist.github.com/joshenders/52cb78bedaea6787faac
# This script uses the BSD variants of commands and is intended to
# be run on an unmodified installation of OSX.
pmset noidle &
now=$(date +%s)
duration=$((86400*3)) # 3days
@haasn
haasn / about:config.md
Last active April 2, 2024 18:46
Firefox bullshit removal via about:config

Firefox bullshit removal

Updated: Just use qutebrowser (and disable javascript). The web is done for.