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 / gokit_exercise.diff
Created August 27, 2018 21:48
Gophercon Sympatico Gokit Exercise
diff --git a/internal/auth/http_server.go b/internal/auth/http_server.go
index a2f993d..0b55ffb 100644
--- a/internal/auth/http_server.go
+++ b/internal/auth/http_server.go
@@ -1,9 +1,12 @@
package auth
import (
+ "context"
"fmt"
@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 20, 2025 12:59
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 February 16, 2025 09:39
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
@schweigert
schweigert / Embedding GoLang into a Ruby application.md
Last active April 11, 2025 19:24
Embedding GoLang into a Ruby application - Blogpost to Magrathealabs

Go Title

I am passionate about Ruby, but its execution time compared to other languages is extremely high, especially when we want to use more complex algorithms. In general, data structures in interpreted languages become incredibly slow compared to compiled languages. Some algorithms such as ´n-body´ and ´fannkuch-redux´ can be up to 30 times slower in Ruby than Go. This is one of the reasons I was interested in embedding Go code in a Ruby environment.

For those who do not know how shared libraries operate, they work in a similar way as DLLs in Windows. However, they have a native code with a direct interface to the C compiler.

Note Windows uses the DLL system, and in this case, this does not necessarily have to be in native code.

One example is DLLs written in C#, which runs on a virtual machine. Because I do not use windows, I ended up not testing if it is poss

@posener
posener / go-table-driven-tests-parallel.md
Last active April 10, 2025 16:19
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 17, 2025 02:38 — forked from mwinters0/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 24, 2025 05:26 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.