Skip to content

Instantly share code, notes, and snippets.

View hongkongkiwi's full-sized avatar
🤓

Andy hongkongkiwi

🤓
View GitHub Profile
## Prerequisites:
# 1) Create a Docker IPv4 bridge network
# 2) Pick an IPv4 Address for Traefik, use the end of the network range
# 3) Pick a domain, recommend real DNS but faking is possible by editing the /etc/hosts file to point to Traefik's IPv4 address.
# 4) Replace the ${DOMAIN} place holder in the config-ldap.yaml, and env-config.js and files with the domain.
# 5) Get a valid certificate via Let's Encrypt or another method, recommend a wildcard cert
# 6) Copy cert/private key as /etc/letsencrypt/live/${DOMAIN}/{privkey.pem, fullchain.pem}, Uncomment lines 233-234 in the docker.compose.yml file
# Also uncomment the lines in traefik_dynamic.yaml after cert and key are in place
# 7) Copy this file as '.env', fill out with the appropriate values
@obfusk
obfusk / build.gradle
Last active July 5, 2024 05:53
use apksigner instead of signingConfig in build.gradle
// See https://developer.android.com/studio/publish/app-signing#secure-shared-keystore
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties
def signedReleases = keystorePropertiesFile.exists()
if (signedReleases) {
println("Using ${keystorePropertiesFile} for release signingConfig...")
keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
@obfusk
obfusk / openssl-gen-apk-signing-cert-and-privkey.sh
Created November 19, 2022 20:14
generate certificate & private key for APK siging using openssl
openssl req -x509 -newkey rsa:4096 -sha512 -outform DER -out cert.der -days 10000 -nodes -subj '/CN=test key' -keyout - | openssl pkcs8 -topk8 -nocrypt -outform DER -out privkey.der
@mvanbaak
mvanbaak / recyclarr-sonarrv4.yml
Last active May 18, 2024 06:10
recyclarr configuration for sonarr v4 Custom Formats setup. As example it does prefer releases with DolbyVision/HDR. Remove the part 'HDR Metadata' if you are not interested in it
sonarr:
# sonarr4k running sonarr v4 dev install (custom formats)
- base_url: http://sonarrv4:8989/sonarr
api_key: [REDACTED]
quality_definition: series
delete_old_custom_formats: true
custom_formats:
@sorny
sorny / x11_forwarding_macos_docker.md
Last active February 28, 2025 03:14
X11 forwarding with macOS and Docker

X11 forwarding on macOS and docker

A quick guide on how to setup X11 forwarding on macOS when using docker containers requiring a DISPLAY. Works on both Intel and M1 macs!

This guide was tested on:

  • macOS Catalina 10.15.4
  • docker desktop 2.2.0.5 (43884) - stable release
  • XQuartz 2.7.11 (xorg-server 1.18.4)
  • Macbook Pro (Intel)
@slawekzachcial
slawekzachcial / self-signed-certificate-with-custom-ca-and-kms.md
Last active April 11, 2024 16:44
Self Signed Certificates with Custom Root CA and Root CA Key Encrypted with AWS KMS

This Gist is based on Self Signed Certificate with Custom Root CA gist.

It adds the use of AWS KMS to generate and decrypt the Root CA private key, so that this key does not need to be stored in plaintext. Instead, the key is stored encrypted, and is being decrypted using AWS KMS only when needed.

Create AWS KMS CMK - Done Once

Create symmetic CMK (customer-managed key) and give it an alias of alias/root-ca-encrypting-key that will be used later to reference to it:

@FinnWoelm
FinnWoelm / read-text-message.sh
Created December 27, 2019 14:01
How to read text messages from USB modem
# Full instructions: http://manpages.ubuntu.com/manpages/bionic/en/man8/mmcli.8.html
# Examples: http://manpages.ubuntu.com/manpages/bionic/en/man8/mmcli.8.html#examples
# Supported modems: https://www.freedesktop.org/wiki/Software/ModemManager/SupportedDevices/
# Get list of connected modems.
mmcli --list-modems
# Output:
# Found 1 modems:
# /org/freedesktop/ModemManager1/Modem/1 [huawei] E3531
# The number at the end of the path is the modem index.
@artizirk
artizirk / wg-ip.py
Last active January 11, 2025 11:06
Generate WireGuard IP Addresses from public key, compatible with wg-ip bash script
#!/usr/bin/env python3
# need at least python3.6+ for blake2
from base64 import b64decode
from hashlib import sha256, blake2s
from ipaddress import ip_address, ip_network
# https://github.com/chmduquesne/wg-ip
def gen_ip(pubkey, subnet=ip_network('fe80::/64')):
"""Generate wg-ip compatible addresses from WireGuard public key.
@slykar
slykar / dell-idrac6-ipmitool-fan-controll.md
Last active November 28, 2024 15:34
Fan control IPMI commands for Dell T610

Dell Fan Control Commands

print temps and fans rpms

ipmitool -I lanplus -H <iDRAC-IP> -U <iDRAC-USER> -P <iDRAC-PASSWORD> sensor reading "Ambient Temp" "FAN 1 RPM" "FAN 2 RPM" "FAN 3 RPM"

print fan info

@nwesterhausen
nwesterhausen / apprise_notify.sh
Created October 9, 2019 15:57
Apprise Notifier Script for Radarr/Sonarr/Lidarr
#!/bin/bash
###
# This script utilizes apprise (https://github.com/caronc/apprise) to send notifications
# You need to have apprise available for the user sonarr operates under.
# I installed it via `sudo pip install --system apprise` although the python
# community really dislikes it when you do that. Recommended installation would be
# something along the lines of:
#
# sudo su sonarr -s /bin/bash
# pip install --user apprise