Skip to content

Instantly share code, notes, and snippets.

Avatar

Kurt Yoder greenmoss

View GitHub Profile
View parse_maybe_numeric.py
#!/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
View gist:6749b555831313c39c3ed5367c387714
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
View openssl s_client -connect ...:443
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 Sep 16, 2021
This script renews letsecnrypt SSL certificates using Cloudflare dns-1 renewal. It assumes you are using Mailcow.
View certbot-dns-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:
your_email=letsencrypt@your.domain
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 Apr 1, 2017
letsencrypt-auto fails at installing python-augeas
View letsencrypt-auto-failure-console.txt
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]
View gist:67b8b5017aba357c0b390fbe4409bb93
.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',
View gist:774d2528e1ccc51a163febfccfb263d1
$http({
method: 'GET',
url: 'https://google.com',
headers: {'Content-Type':'text/plain'}
})
.then(function(response) {
$log.debug(response.data)
});
@greenmoss
greenmoss / gocd support
Created Apr 7, 2016
slightly-redacted output of /go/api/support
View gocd support
Timestamp:
==========
Thu Apr 07 18:29:56 UTC 2016
=================
Config Statistics
=================
@greenmoss
greenmoss / decode_vcrpy.py
Created Apr 3, 2016
Decode compressed responses from vcrpy test artifacts
View decode_vcrpy.py
#!/usr/bin/env python
# Now you'll be able to read those encoded/compressed
# responses in your vcrpy test artifacts!
# References:
# https://github.com/kevin1024/vcrpy/issues/249
# http://stackoverflow.com/questions/36366234
# Thanks to Reti43 on StackOverflow
import sys
View gist:e3f6e4adac5ad8e88639
http://w.on24.com/r.htm?e=933790&s=1&k=4A2CC635D86AD5D497BDEE5D39396973