Skip to content

Instantly share code, notes, and snippets.

View greenmoss's full-sized avatar

Kurt Yoder greenmoss

View GitHub Profile
@greenmoss
greenmoss / userpic.sh
Last active March 19, 2024 13:02 — forked from palmerc/userpic.sh
Updating a user's picture from a script
#!/bin/bash
set -xeuo pipefail
declare -x USERNAME="$1"
declare -x USERPIC="$2"
declare -r DSIMPORT_CMD="/usr/bin/dsimport"
declare -r ID_CMD="/usr/bin/id"
@greenmoss
greenmoss / fib_random.py
Created March 14, 2023 15:59
Exploration of fibonacci sequence as a source of random numbers
#!/usr/bin/env python3
import sys
import time
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
#!/usr/bin/env python3
def add_digits(the_digits, sum_log10_inversed = False):
total = 0
digit_count = len(the_digits)
if(sum_log10_inversed):
the_digits.reverse()
# count down, from the last digit to the first
wget -q -nc -O /tmp/wl.txt https://raw.githubusercontent.com/greenmoss/w/master/w ; sort -R /tmp/wl.txt | head -20 ; tr -dc a-z0-9 </dev/urandom | head -c 20
@greenmoss
greenmoss / openssl s_client -connect ...:443
Created February 17, 2021 19:49
openssl client output
CONNECTED(00000005)
depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
verify return:1
depth=1 C = US, O = DigiCert Inc, CN = DigiCert SHA2 Secure Server CA
verify return:1
depth=0 C = US, ST = Virginia, L = Dulles, O = "LISCR, LLC", CN = *.liscr.com
verify return:1
---
Certificate chain
0 s:/C=US/ST=Virginia/L=Dulles/O=LISCR, LLC/CN=*.liscr.com
@greenmoss
greenmoss / certbot-dns-mailcow
Last active September 9, 2024 17:04
This script renews letsecnrypt SSL certificates using Cloudflare dns-1 renewal. It assumes you are using Mailcow.
#!/usr/bin/env bash
# This script renews letsecnrypt SSL certificates using Cloudflare dns-1 renewal
# It assumes you are using Mailcow
set -euo pipefail
# REQUIRED set these:
[email protected]
your_domain=mail.your.domain # only tested with single domain
cloudflare_ini_path=/root/.cloudflare # add your Cloudflare file here, called cloudflare.ini
@greenmoss
greenmoss / letsencrypt-auto-failure-console.txt
Last active April 1, 2017 19:28
letsencrypt-auto fails at installing python-augeas
Bootstrapping dependencies for Debian-based OSes...
Ign http://us.archive.ubuntu.com trusty InRelease
Get:1 http://us.archive.ubuntu.com trusty-updates InRelease [65.9 kB]
Hit http://us.archive.ubuntu.com trusty-backports InRelease
Hit http://us.archive.ubuntu.com trusty Release.gpg
Get:2 http://us.archive.ubuntu.com trusty-updates/main Sources [395 kB]
Get:3 http://security.ubuntu.com trusty-security InRelease [65.9 kB]
Ign http://ppa.launchpad.net trusty InRelease
Get:4 http://us.archive.ubuntu.com trusty-updates/restricted Sources [6,327 B]
Get:5 http://us.archive.ubuntu.com trusty-updates/universe Sources [176 kB]
.controller('View1Ctrl', [ '$scope', '$log', '$http', function($scope, $log, $http) {
$log.debug('foobar');
$scope.name = '';
$scope.names = [{name:"Chris"}, {name:"Calvin"}];
$scope.addName = function() {
$scope.names.push( {'name':$scope.name} );
$scope.name = '';
};
var h = $http({
method: 'GET',
$http({
method: 'GET',
url: 'https://google.com',
headers: {'Content-Type':'text/plain'}
})
.then(function(response) {
$log.debug(response.data)
});
@greenmoss
greenmoss / gocd support
Created April 7, 2016 19:15
slightly-redacted output of /go/api/support
Timestamp:
==========
Thu Apr 07 18:29:56 UTC 2016
=================
Config Statistics
=================