Skip to content

Instantly share code, notes, and snippets.

View joe-speedboat's full-sized avatar
🙃
AiHoi!

Chris Rüttimann joe-speedboat

🙃
AiHoi!
View GitHub Profile
@joe-speedboat
joe-speedboat / kickstucklocks.sh
Created February 27, 2024 15:19 — forked from justdave/kickstucklocks.sh
Zimbra 8.8.5 seems to freeze up on me periodically. I wrote this script to automatically kick it when it happens to avoid getting calls from users at odd hours complaining that they couldn't check their mail.
#!/bin/bash
# Script to automatically restart mailboxd when IMAP mailboxes fail to lock
# (which usually indicates the server has hung)
#
# Configure MAILTO to match where you want the notification email sent.
#
# Prerequisite: You must install LogWarn, which can be found at
# https://github.com/archiecobbs/logwarn if your package manager doesn't have
# it.
@joe-speedboat
joe-speedboat / okd-4.13.gpg-key-update.sh
Created July 10, 2023 15:13
OKD 4.12 -> 4.13 upgrade fails "Release not accepted"
git clone https://github.com/openshift/cluster-update-keys.git
cd cluster-update-keys/
git checkout release-4.13
oc create configmap -n openshift-config-managed release-verification-keys --from-file=keys
oc patch clusterversion version --type=merge -p '{"spec":{"upstream":"https://api.openshift.com/api/upgrades_info/v1/graph","channel":"stable-4","overrides":[{"group":"config.openshift.io/v1","kind":"FeatureGate","name":"cluster","unmanaged":false},{"group":"config.openshift.io/v1","kind":"FeatureGate","name":"tech-preview-upgrade","unmanaged":false}],"releaseVerification":{"publicKey":"name=release-verification-keys","type":"ConfigMap"}}}'
@joe-speedboat
joe-speedboat / nginx.conf
Created March 18, 2022 05:29 — forked from jhazelwo-charter/nginx.conf
NGINX FreeIPA authentication
worker_processes 4;
pid /app/run/nginx.pid;
error_log /app/log/error.log;
events {
worker_connections 768;
}
http {
@joe-speedboat
joe-speedboat / open-source-sso.md
Created October 8, 2021 05:07 — forked from bmaupin/open-source-sso.md
Comparison of open-source SSO implementations
@joe-speedboat
joe-speedboat / guide.md
Created September 22, 2021 11:39 — forked from cclloyd/guide.md
Set up OPNSense with FreeIPA Authentication.

Using FreeIPA Authentication with OPNSense

Step 1

Go to your IPA admin page and create a new user named opnsense. Log in once on any computer joined to the FreeIPA realm and set their password (since the one you provide upon account creation will be expired), then logout.

Step 2

@joe-speedboat
joe-speedboat / script-template.sh
Created December 18, 2020 06:56 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@joe-speedboat
joe-speedboat / nginx.conf
Last active October 27, 2019 11:49 — forked from 6aditya8/nginx.conf
Nginx SSL/TLS configuration for getting "A+" in Qualys SSL Labs test
# forked from: https://gist.github.com/6aditya8/277ce867451922cfe9f41d93c5316850
# Configuration options are limited to SSL/TLS
# Enable SSL session caching for improving performance by avoiding the costly session negotiation process where possible
# SSL Labs doesn't assume that SNI is available to the client, so it only tests the default virtual server
# setting this globally to make it work across all the nginx virtual servers (including the default virtual server)
ssl_session_cache shared:ssl_session_cache:10m;
ssl_session_timeout 10m;
server {
@joe-speedboat
joe-speedboat / postfix
Last active March 7, 2023 14:56 — forked from TinLe/postfix
postfix grok patterns for graylog 3.x
# Syslog stuff
COMPONENT ([\w._\/%-]+)
COMPID postfix\/%{COMPONENT:component}(?:\[%{NUMBER:pid}\])?
POSTFIX (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{COMPID}:
# Milter
HELO (?:\[%{IP:helo}\]|%{HOST:helo}|%{DATA:helo})
MILTERCONNECT %{QUEUEID:qid}: milter-reject: CONNECT from %{RELAY:relay}: %{GREEDYDATA:milter_reason}; proto=%{WORD:proto}
MILTERUNKNOWN %{QUEUEID:qid}: milter-reject: UNKNOWN from %{RELAY:relay}: %{GREEDYDATA:milter_reason}; proto=%{WORD:proto}
@joe-speedboat
joe-speedboat / ultrasonic_pest_repeller.ino
Last active August 8, 2018 06:54
Ultrasonic pest repeller
int speaker = 0; // speaker pin (pwm)
long int pick_freq = 22000;
int duration = 100; // ms to play tone
int led = 13; // led operating status pin
@joe-speedboat
joe-speedboat / postgres-cheatsheet.md
Created April 20, 2018 07:38 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)