Skip to content

Instantly share code, notes, and snippets.

@msutter
msutter / gist:d376e79a6d899aafe30dff95ec97c0ac
Last active January 2, 2023 09:22
Macbook pro 2017 OSX version 13.1 Bluetooth Audio Stutter fix
# This are the command line commands to change the bluetooth settings in case of audio stuttering
# Changes are based on the nice video made by Simon McCabe on youtube where he is using the bluetooth explorer app
# https://www.youtube.com/watch?v=OVRbLRRz5TU
# The settings are reversible but proceed at your own risk.
#
# My defaults are
# sudo defaults read com.apple.BluetoothAudioAgent
# {
# "Apple Bitpool Max (editable)" = 64;
# "Apple Bitpool Min (editable)" = 50;
@msutter
msutter / GNUPG_agent_forwarding.md
Last active February 27, 2020 10:26 — forked from TimJDFletcher/GNUPG_agent_forwarding.md
GnuPG agent forwarding

Forward GnuPG agent from macOS to Linux

On the remote machine

Run gpg once as your to create the directory structure

gpg --list-keys

For remote systemd based hosts

[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;

File Manipulation Approaches

Full configurations

Static content

  • Software/script => have you considered packaging it?
  • binary/large data file => add metadata (git + vcsrepo type, maybe even git-annex or git-lfs?)
  • Puppet >= 3.7:
@msutter
msutter / cleanupUnusedWorkspaceInSlaves.groovy
Created January 8, 2018 15:41 — forked from ceilfors/cleanupUnusedWorkspaceInSlaves.groovy
When you delete jobs in Jenkins, the corresponding workspaces in the build slaves won't be deleted automatically. This Jenkins script will go to each slave and check if the jobs are already deleted in Jenkins master and delete the workspace.
import com.cloudbees.hudson.plugins.folder.Folder
import hudson.FilePath
import jenkins.model.Jenkins
def boolean isFolder(String name) {
def item = Jenkins.instance.getItemByFullName(name)
return item instanceof Folder
}
def deleteUnusedWorkspace(FilePath root, String path) {
@msutter
msutter / gist:e580a1b48a8551128217225fe4a8568b
Created January 8, 2018 14:59 — forked from akomakom/jenkins-groovy-system-script.groovy
A jenkins script to clean up workspaces on slaves. On all slaves with less than X free GB, this script removes /slaves/workspace/* if slave is idle. If not idle, it removes /full/job/workspace/path for each job that isn't currently running.
/**
Jenkins System Groovy script to clean up workspaces on all slaves.
Check if a slave has < X GB of free space, perform cleanup if it's less.
If slave is idle, wipe out everything in the workspace directory as well any extra configured directories.
If slave is busy, wipe out individual job workspace directories for jobs that aren't running.
Either way, remove custom workspaces also if they aren't in use.
**/
import hudson.model.*;

External facts

External facts provide a way to use arbitrary powershell scripts as facts, or set facts statically with data structured as INIFILE, JSON or YAML. If you’ve ever wanted to write a custom fact in Powershell, this is how.

Facts location

To add external facts to your Puppet modules, just place them in MODULEPATH/MODULENAME/facts.d/. at the same level as you would place manifests, files or templates directories.

They will be automatically distributed with pluginsync during the puppet run.

Keybase proof

I hereby claim:

  • I am msutter on github.
  • I am msutter (https://keybase.io/msutter) on keybase.
  • I have a public key whose fingerprint is 128F E4EA 73E7 A2A3 5942 4A1F 3ED8 8B0E 96D7 2B72

To claim this, I am signing this object:

docker volume ls -f dangling=true
DRIVER VOLUME NAME
local 002cc45096db5d7b5535b3a2c0b1c6418d71dd965a9db40b052f0d021a915329
local 0142c6323ffaa73eb5a39297c7837601b6335727d14144694d6cb4a52fa2b86c
local 014b858ee4f1a63ed5bfe719e3f7cf3fc4488bc4cfbbfc11d1c8e1aa26270f22
local 031555b35b84aa7a54d723f72fa8e27295ac09ad62e4fd32a030e89f8916a70b
local 038e8985832088758f4d4b8d83a4a274c726d78028febb6b744a979c486e167b
local 05b482c142b13a7e30ce42958017777b1f56e7c2f9d19c4514ad95c2898ca06f
local 076038107f2155276b1129279414f966461360698f9cbc4ac6da768f99b20877
local 0958f47b6517974968126238ce479d31ec9769b6ce618b06b0a34a1ef92b5c1c