Skip to content

Instantly share code, notes, and snippets.

View mtodd's full-sized avatar
🔐
[redacted]

Matt Todd mtodd

🔐
[redacted]
View GitHub Profile
@nkatsaros
nkatsaros / auth_extracted.diff
Created August 27, 2018 20:11
gophercon sympatico, auth extracted
diff --git a/cmd/auth/logging.go b/cmd/auth/logging.go
new file mode 100644
index 0000000..712f806
--- /dev/null
+++ b/cmd/auth/logging.go
@@ -0,0 +1,43 @@
+package main
+
+import (
+ "net/http"
@nadavrot
nadavrot / Matrix.md
Last active April 2, 2024 06:45
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@samthor
samthor / autocert-server.go
Last active April 15, 2024 15:47
Demo autocert server in Go
package main
import (
"crypto/tls"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/user"
@jcalvert
jcalvert / debug_output.log
Last active November 29, 2018 05:04
fail_greeter output
D0313 13:02:59.116947506 23841 is_epollexclusive_available.cc:83] epoll_ctl with EPOLLEXCLUSIVE | EPOLLONESHOT succeeded. This is evidence of no EPOLLEXCLUSIVE support. Not using epollex polling engine.
I0313 13:02:59.117012639 23841 ev_epollex_linux.cc:1482] Skipping epollex because it is not supported.
I0313 13:02:59.117025034 23841 ev_epoll1_linux.cc:114] grpc epoll fd: 7
D0313 13:02:59.117047422 23841 ev_posix.cc:140] Using polling engine: epoll1
D0313 13:02:59.117135413 23841 dns_resolver.cc:331] Using native dns resolver
D0313 13:02:59.117158235 23841 timer_manager.cc:85] Spawn timer thread
I0313 13:02:59.117215775 23841 init.cc:153] grpc_init(void)
D0313 13:02:59.117380384 23844 timer_generic.cc:637] TIMER CHECK BEGIN: now=0 next=9223372036854775807 tls_min=0 glob_min=0
I0313 13:02:59.117425596 23841 completion_queue.cc:433] grpc_completion_queue_create_internal(completion_type=0, polling_type=0)
D0313 13:02:59.117426687 23844 t
@posener
posener / go-table-driven-tests-parallel.md
Last active April 4, 2024 19:45
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()

Setting up netboot.xyz with an EdgeRouter

This document covers how to setup netboot.xyz, a service that provides iPXE-based installation and live boot of a bunch of operating systems, on a Ubiquiti EdgeRouter.

Assumptions

I've made a few assumptions throughout this document that will probably be different for your setup:

@ckelner
ckelner / kubernetes_overview.md
Last active April 9, 2024 20:04 — forked from WintersMichael/kubernetes_overview.md
Understanding Kubernetes in 10 minutes - By Mike Schuette

Understanding Kubernetes in 10 minutes

Original document can be found here; written by Mike Schuette.

This document provides a rapid-fire overview of Kubernetes concepts, vocabulary, and operations. The target audience is anyone who runs applications in a cloud environment today, and who wants to understand the basic mechanics of a Kubernetes cluster. The goal is that within 10 minutes, managers who read this should be able to listen in on a Kubernetes conversation and follow along at a high level, and engineers should be ready to deploy a sample app to a toy cluster of their own.

This orientation doc was written because the official Kubernetes docs are a great reference, but they present a small cliff to climb for newcomers.

If you want to understand why you should consider running Kubernetes, see the official Kubernetes conceptual overview document. This doc

@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 25, 2024 03:58 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@sridharavinash
sridharavinash / status.sh
Last active March 30, 2017 01:25
Branch build status on command line
#!/bin/bash
#
# Export $GITHUB_TOKEN with your access token
#
function get_build_status(){
branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
repo=$(git config --get remote.origin.url | egrep -Eo '/(\w+)' | cut -d '/' -f 2)
status=$(curl -s -u "$GITHUB_TOKEN:x-oauth-basic" https://api.github.com/repos/github/$repo/commits/$branch/status | jq '.state' | tr -d '"')
@jsonmaur
jsonmaur / bzexcluderules_editable.xml
Last active April 9, 2024 04:47
Backblaze Custom Exclude
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/_build/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/deps/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />