Skip to content

Instantly share code, notes, and snippets.

View ashleykleynhans's full-sized avatar
:octocat:

Ashley Kleynhans ashleykleynhans

:octocat:
View GitHub Profile
@catchdave
catchdave / install_check_mk_osx.sh
Last active June 21, 2024 21:36
Install check_mk agent on OSX
# Clone Repo
git clone https://github.com/ThomasKaiser/Check_MK.git
cd Check_MK
# Remove less common plugins
rm -f agents/plugins/monitor-jss-and-macos-updates agents/plugins/city-temperatures agents/plugins/monitor-kerio agents/plugins/smart*
# Install dependencies
brew install smartmontools osx-cpu-temp
@koshatul
koshatul / README.md
Last active June 27, 2024 05:47
use Apple Keychain to store GPG Passphrases

gpg-agent setup

Need to setup gpg-agent first, on OSX I use keychain (it also does ssh-agent)

$ brew info keychain
keychain: stable 2.8.5
User-friendly front-end to ssh-agent(1)
https://www.funtoo.org/Keychain
/usr/local/Cellar/keychain/2.8.5 (7 files, 108.5KB) *
@dlenski
dlenski / bagcerts
Created July 17, 2018 03:56
Add "bag attributes" to a certificate chain
#!/bin/bash
#
# This script takes one or more x509 certificates in .PEM format (from
# stdin or files listed on command line) and adds helpful "bag
# attributes" before each certificate. This makes it easier for
# humans to identify the contents of the bundle.
#
# Requires (g)awk and openssl's x509 command line utility.
#
# Output fields included can be specified via openssl-x509 options:
@gdamjan
gdamjan / ssl-check.py
Last active April 14, 2024 07:16
Python script to check on SSL certificates
# -*- encoding: utf-8 -*-
# requires a recent enough python with idna support in socket
# pyopenssl, cryptography and idna
from OpenSSL import SSL
from cryptography import x509
from cryptography.x509.oid import NameOID
import idna
from socket import socket
@nicksantamaria
nicksantamaria / fork-example.php
Created October 20, 2016 22:35
Example: Parallel processing in PHP using pcntl_fork()
<?php
/**
* @file
* Basic demonstration of how to do parallel threads in PHP.
*/
// This array of "tasks" could be anything. For demonstration purposes
// these are just strings, but they could be a callback, class or
// include file (hell, even code-as-a-string to pass to eval()).
@sebastienvercammen
sebastienvercammen / Code.gs
Last active March 9, 2022 09:58
Nintendo PTC Account Verifier for Gmail v2 with CORS proxy (via Google Scripts & jQuery)
/*
Automatically click all "Verify your email" links in the welcome e-mail from
Nintendo Pokémon Trainer Club's signup e-mails.
Only unread emails in inbox will be processed.
All processed e-mails will be marked as read if verification was successful,
and optionally moved to trash if it's enabled in your settings.
How to use:
1. Login to Gmail
@tolsadus
tolsadus / networking.md
Last active July 8, 2016 09:24
Networking
  1. if you’re on (most modern distributions of) linux, forget that route(1) even exists (and throw ifconfig out in the same go) because it’s just absolutely frustrating. for probably 98% of what you need, ip(1) is the cool you care about

generally speaking, these will cover you: ip route, ip address, ip link

  1. when dealing with routing problems (​even if just two hosts next to each other​), mtr > traceroute > ping is an order that’s useful for a lot of what you need

mtr is nice because you can just let it keep running. press d in its display to get a running history breakdown of packets. fantastic for intermittent issues!

traceroute is generally known already, but depending on the complexity of your networks in question you may want traceroute-nanog or similar other ones. some of these are ASN-aware, which is useful.

git config --global alias.lola "log --graph --decorate --pretty=oneline --abbrev-commit --all"
@xrstf
xrstf / letsencrypt.md
Last active April 18, 2023 05:01
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on http://letsencrypt.readthedocs.org/en/latest/using.html and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for www.example.com and example.com).

Configuration

For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

@carlhoerberg
carlhoerberg / reconnect.js
Created May 13, 2015 14:45
How to build reconnect logic for amqplib
var amqp = require('amqplib/callback_api');
// if the connection is closed or fails to be established at all, we will reconnect
var amqpConn = null;
function start() {
amqp.connect(process.env.CLOUDAMQP_URL + "?heartbeat=60", function(err, conn) {
if (err) {
console.error("[AMQP]", err.message);
return setTimeout(start, 1000);
}