Skip to content

Instantly share code, notes, and snippets.

View terinjokes's full-sized avatar

Terin Stock terinjokes

View GitHub Profile
@terinjokes
terinjokes / klogs.zsh
Last active February 26, 2023 23:20
FZF function for Kubernetes logs (including previewing)
klogs() {
pod="$(kubectl get po -o wide|tail -n+2|fzf -n1 --reverse --tac --preview='kubectl logs --tail=20 --all-containers=true {1}' --preview-window=down:50%:hidden --bind=ctrl-p:toggle-preview --header="^P: Preview Logs"|awk '{print $1}')"
if [[ -n $pod ]]; then
kubectl logs --all-containers=true $pod
fi
}
@terinjokes
terinjokes / 00-README.org
Last active January 28, 2022 21:16
Retro Tea Breaks Vol. 1 PDF Patch

Retro Tea Break: Vol. 1 QPDF Diff

This is a diff to the Retro Tea Break: Vol. 1 PDF that fixes several problems:

  • Corrects the PDF page number offset, so they match the physical book’s page numbers.
  • Removes the forced page fitting from the link annotations, such as those on the contents listing page.
  • Adds a document outline to the PDF, so your PDF viewer can provide direct links to chapters.

Usage

@terinjokes
terinjokes / client.go
Last active May 6, 2021 05:13
Golang example of context in API Clients
package api
import (
"encoding/json"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
)
type Client {
@terinjokes
terinjokes / 01-override_term.patch
Last active January 8, 2021 21:05
OpenSSH 8.4p1 OverrideTerm option
diff --git a/mux.c b/mux.c
index 376f0d71..a240664d 100644
--- a/mux.c
+++ b/mux.c
@@ -1922,7 +1922,9 @@ mux_client_request_session(int fd)
close(devnull);
}
- if ((term = getenv("TERM")) == NULL)
+ term = options.override_term ? options.override_term : getenv("TERM");
--- arch-config 2020-12-29 22:22:45.661044626 -0800
+++ nixos-config 2020-12-29 19:41:49.856275201 -0800
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/x86_64 5.10.3 Kernel Configuration
+# Linux/x86_64 5.10.2 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (GCC) 9.3.0"
CONFIG_CC_IS_GCC=y
@terinjokes
terinjokes / 00-configuration.nix
Last active December 30, 2020 06:30
XPS 13 9310 NixOS with working Bluetooth
{ config, pkgs, lib, ... }:
let
archKernel = (pkgs.linuxManualConfig rec {
inherit (pkgs) stdenv;
version = "5.10.3";
modDirVersion = "5.10.3";
src = pkgs.fetchurl {
url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
@terinjokes
terinjokes / u-boot-x86_64-zboot.patch
Created December 27, 2020 13:19
terrible hack to get u-boot 2020.10 to boot bzImages with sysboot
diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c
index 8716e782f6..214baf18b0 100644
--- a/cmd/pxe_utils.c
+++ b/cmd/pxe_utils.c
@@ -552,6 +552,17 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
/* Try booting a Image */
else
do_bootz(cmdtp, 0, bootm_argc, bootm_argv);
+#elif defined(CONFIG_CMD_ZBOOT)
+ else {
@terinjokes
terinjokes / gist:3854368
Created October 8, 2012 19:20
error compiling texinfo
make: Entering directory `/mnt/clfs/sources/texinfo-4.13/tools'make all-recursivemake[1]: Entering directory `/mnt/clfs/sources/texinfo-4.13/tools'
Making all in lib
make[2]: Entering directory `/mnt/clfs/sources/texinfo-4.13/tools/lib'make[2]: Nothing to be done for `all'.make[2]: Leaving directory `/mnt/clfs/sources/texinfo-4.13/tools/lib'
Making all in info
make[2]: Entering directory `/mnt/clfs/sources/texinfo-4.13/tools/info'
make all-am
make[3]: Entering directory `/mnt/clfs/sources/texinfo-4.13/tools/info'
gcc -g -O2 -o ginfo dir.o display.o dribble.o echo-area.o filesys.o footnotes.o gc.o indices.o info-utils.o info.o infodoc.o infomap.o m-x.o man.o nodemenu.o nodes.o search.o session.o signals.o terminal.o tilde.o variables.o window.o doc.o ../lib/libtxi.a ../gnulib/lib/libgnu.a
terminal.o: In function `terminal_end_using_terminal':
/mnt/clfs/sources/texinfo-4.13/info/terminal.c:166: undefined reference to `tputs'
// later require
var start=window.performance.now();
CloudFlare.define("stuff",
['cloudflare/console'],
function(console) {
var url='https://piwik-ssl.ns1.net/piwik.js';
CloudFlare.require([url], function(url) {
window.console.log("require later time differential =");
window.console.log(window.performance.now() - start);
});
@terinjokes
terinjokes / vpnc-v6-split.patch
Created April 4, 2018 19:03
patch to never set the default route for split IPv6
diff -ura vpnc-scripts.orig/vpnc-script vpnc-scripts.new/vpnc-script
--- vpnc-scripts.orig/vpnc-script 2018-04-04 11:39:54.203748883 -0700
+++ vpnc-scripts.new/vpnc-script 2018-04-04 11:52:22.039505461 -0700
@@ -676,11 +676,7 @@
while [ $i -lt $CISCO_IPV6_SPLIT_INC ] ; do
eval NETWORK="\${CISCO_IPV6_SPLIT_INC_${i}_ADDR}"
eval NETMASKLEN="\${CISCO_IPV6_SPLIT_INC_${i}_MASKLEN}"
- if [ $NETMASKLEN -lt 128 ]; then
- set_ipv6_network_route "$NETWORK" "$NETMASKLEN"
- else