Skip to content

Instantly share code, notes, and snippets.

View konstruktoid's full-sized avatar
🤖

Thomas Sjögren konstruktoid

🤖
  • Sweden
  • 20:41 (UTC +02:00)
  • LinkedIn in/thosjo
View GitHub Profile
@konstruktoid
konstruktoid / mac_developer_certs.md
Last active March 3, 2022 00:25
Installing Developer ID certificates on Mac OS X

Installing Developer ID certificates on Mac OS X

Short guide showing how to install Developer ID certificates, when the Allow button doesn't show up under System Preferences > Security & Privacy > General or you're seeing (libkern/kext) system policy prevents loading; check the system/kernel logs for errors or try kextutil(8). in the installation logs (CMD + L).

System information

macOS Catalina
ProductName:    Mac OS X
ProductVersion: 10.15.4
#!/usr/bin/python3
# https://oeis.org/A232449
# Belphegor's Prime: n = 13
def belph(n):
belph = (10 ** (n + 3) + (2 * 3 ** 2 * 37)) * 10 ** (n + 1) + 1
return belph
#!/bin/sh
RELEASE_DATE=
for p in $(curl -sSL 'https://kernel.ubuntu.com/~kernel-ppa/mainline/daily/current/HEADER.html' | grep -E '.*all\.deb|.*generic.*amd64\.deb' | sed -e 's/.*ref="//g' -e 's/">.*//g'| sort | uniq); do
wget -nc "https://kernel.ubuntu.com/~kernel-ppa/mainline/daily/current/$p"
RELEASE_DATE="$(echo "$p" | awk -F '.' '{print $6}' | sed 's/_.*//g')"
done
if ! dpkg -l | grep -qE "linux.*$RELEASE_DATE.*"; then
find . -name "*modules*$RELEASE_DATE*.deb" -type f | while read -r m; do
#!/bin/sh
if command -v gem; then
if gem --version | grep -q '^3'; then
gem update
fi
fi
if command -v brew; then
brew update
#!/bin/sh
MAX_RAM_IN_MB=768
DEBUG=0
if [ -f '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java' ]; then
JAVA='/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java'
else
JAVA=java
@konstruktoid
konstruktoid / getReplicationInfo.py
Last active April 23, 2021 03:54
replacing eval getReplicationInfo with python functions -- https://jira.mongodb.org/browse/PYTHON-1717
def oplogstats(connection):
c = connection
localdb = c["local"]
if "oplog.rs" in localdb.collection_names():
collstats = dict()
collstats.clear()
collstats = localdb.command("collstats", "oplog.rs")
return collstats
#!/bin/sh
PROJNAME="$(basename "$(git rev-parse --show-toplevel)")"
CONTRIBUTORS="$(git shortlog -sne | awk '{$1=""; print $0}' | sed 's/^ /* /g' | sort -i -f -k2)"
DATE="$(LANG=C date --utc)"
{
echo "The following people, listed in alphabetical order, have contributed to ${PROJNAME}:"
echo
echo "${CONTRIBUTORS}"
@konstruktoid
konstruktoid / Vagrantfile
Created November 8, 2018 14:32
Ubuntu ZFS Vagrantfile
Vagrant.configure(2) do |config|
config.vm.define "zfsU01" do |zfsU01|
zfsU01.vm.box = "ubuntu/bionic64"
zfsU01.ssh.insert_key = true
zfsU01.vm.network "private_network", ip:"10.2.3.4"
zfsU01.vm.hostname = "zfsU01"
zfsU01.vm.provision "shell",
inline: "apt-get update && apt-get -y upgrade && apt-get -y install zfsutils-linux --no-install-recommends"
zfsU01dataDisk1 = './zfsU01dataDisk1.vdi'
$ cat /etc/systemd/system/jenkins.service
[Unit]
Description=Jenkins - open source automation server
Before=multi-user.target
After=network-online.target
[Service]
ExecStart=/etc/init.d/jenkins start
ExecStop=/etc/init.d/jenkins stop
CapabilityBoundingSet=~CAP_SYS_PTRACE
### Keybase proof
I hereby claim:
* I am konstruktoid on github.
* I am konstruktoid (https://keybase.io/konstruktoid) on keybase.
* I have a public key ASBAeDNxQphVebofQdKNcdWQdQbrkCoOLPeghZN3vP1m6Ao
To claim this, I am signing this object: