Skip to content

Instantly share code, notes, and snippets.

View msmyers's full-sized avatar

Michael Smyers msmyers

View GitHub Profile
/**
* @param {Express.Request} request
* @param {Express.Response} response
*/
async testRecaptcha(request, response) {
/** @type {String} */
const captcha = request.allParams().recaptchaToken;
// check assumptions, or crash
Preconditions.shouldBeNonBlankString(captcha, 'missing: params.recaptchaToken');

My Facebook Shenanigans

This is a continuation of a conversation between Andrew Fine and Michael Smyers.

Foreward

Alright dude. I'll respect you by researching and responding. Please respect me by reading it.

No lengthy response necessary. You're welcome to respond, I do not expect it.

Keybase proof

I hereby claim:

  • I am msmyers on github.
  • I am msmyers (https://keybase.io/msmyers) on keybase.
  • I have a public key ASCKtjsOcPrM7iRvq9ROBPnezPWsoBWUJNzP3KK808HuEAo

To claim this, I am signing this object:

@msmyers
msmyers / setup.sh
Created December 29, 2020 08:27
Sub-CA: self-signed pki automation tool.
#!/usr/bin/env bash
# Assumptions: easyrsa3 available in current dir, and functional openssl.
# This basic example puts the "evoeco_ca" and "children_ca" PKI dirs on the same system.
# A real-world setup would use different systems and transport the public components.
msmyers_ca="evoeco-ca"
# TODO: externalize
nopass="nopass"
@msmyers
msmyers / ntp.conf
Created February 4, 2021 06:37 — forked from phillipuniverse/ntp.conf
Set up NTP with Ansible, dedicating one as a timelord
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
@msmyers
msmyers / README.md
Created May 29, 2021 05:17 — forked from RichardBronosky/README.md
Using cloud-init for cloudless provisioning of Raspberry Pi

Installing cloud-init on a fresh Raspbian Lite image

This is a work in Progress!

Purpose

This mainly demonstrates my goal of preparing a Raspberry Pi to be provisioned prior to its first boot. To do this I have chosen to use the same cloud-init that is the standard for provisioning servers at Amazon EC2, Microsoft Azure, OpenStack, etc.

I found this to be quite challenging because there is little information available for using cloud-init without a cloud. So, this project also servers as a demonstration for anyone on any version of Linux who may want to install from source, and/or use without a cloud. If you fall into that later group, you probably just want to read the code. It's bash so everything I do, you could also do at the command line. (Even the for loop.)

did:3:kjzl6cwe1jw146l06cexqabfzr2jr0je0flpjvwbygn8agf084yaphsfsjd8axy

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
By default, binaries installed by gem will be placed into:
/usr/local/lib/ruby/gems/3.1.0/bin
You may want to add this to your PATH.
ruby is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have ruby first in your PATH, run:
#!/bin/sh
# This script installs the Nix package manager on your system by
# downloading a binary distribution and running its installer script
# (which in turn creates and populates /nix).
{ # Prevent execution if this script was only partially downloaded
oops() {
echo "$0:" "$@" >&2
exit 1