Skip to content

Instantly share code, notes, and snippets.

View doughgle's full-sized avatar

Douglas Hellinger doughgle

View GitHub Profile
@doughgle
doughgle / gist:b22e0e0ccdb02ec6b61a04b4c9ae9f2e
Last active January 17, 2023 14:42 — forked from mkweskin/gist:e531e65791c1d8036dd720ef3baf8af6
Github markdown to Jira/Confluence markup using pandoc

using doughgle/docs-as-code:main

$ docker run -it ghcr.io/doughgle/docs-as-code:main bash

Example markdown

hugo:/src$ cat test.md 
@doughgle
doughgle / tech-radar.json
Last active April 5, 2023 07:49
Runtime Platform Tech Radar
[
{
"name": "EKS",
"ring": "adopt",
"quadrant": "platform services",
"isNew": "FALSE",
"description": "Elastic Kubernetes Service"
},
{
"name": "EC2",
@doughgle
doughgle / git-send-email.md
Created August 14, 2021 12:57
This article captures a few problems I encountered on setting up git send-email and how I resolved them.

git send-email

Git send-email is used by the Linux dev community to send patches as opposed to pull requests. Follow the excellent tutorial on https://git-send-email.io/.

If its a case of TL;DR, in the working git repository:

$ git send-email --annotate -v3 HEAD^

This article captures a few problems I encountered and how I resolved them.

Decode a Linux Kernel Call Trace (kernel panic or kernel oops)

Kernel Call Trace

A Linux kernel call trace, like any traceback, call stack, stacktrace or backtrace, lists a most-recent-first chain of function calls which led to a crash. For the linux kernel, a crash is a panic or oops.

Without debug symbols, a kernel stack trace may come only with a line-by-line list of function symbols, e.g.

[ 844.569701][ T7073] Call Trace:
@doughgle
doughgle / helm-cheat-sheet.md
Last active December 15, 2020 13:27
Cheat Sheet for Helm v3

Helm Cheat Sheet

For Helm 3.

Concepts

Helm is a Package Manager for Kubernetes.

Just like:

YUM is a Package Manager for Fedora and Redhat Linux.

@doughgle
doughgle / myfunc.s
Last active January 26, 2018 10:32
.file "example.c" # filename
.text # store in text section
.globl myfunc # exported symbol
.type myfunc, @function #
myfunc: # function name
.LFB0:
.cfi_startproc #### PROLOGUE
pushq %rbp # push base pointer (64bit) onto the stack
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
#include <stdint.h>
#include <stdio.h>
long int globl_cnt = 3;
void myfunc() {
int32_t a; // variable initialized with the value of %edi register
int64_t b = 0;
int32_t c = 0;
@doughgle
doughgle / debug.c
Created November 28, 2017 14:30
hardcode line 1 of /proc/1/sched
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 1ca0130..8d4e1fc 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -927,8 +927,11 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns,
{
unsigned long nr_switches;
- SEQ_printf(m, "%s (%d, #threads: %d)\n", p->comm, task_pid_nr_ns(p, ns),
- get_nr_threads(p));
@doughgle
doughgle / gist:e3a8c350dbf2370e69212f8b91fa4c88
Created November 20, 2017 15:26
Linux kernel 4.14 patch to disguise TracerPid in /proc/*/status
commit acc0182c3d3869802bc20c8bf4e04c3464936bcc
Author: Douglas Hellinger <[email protected]>
Date: Sun Nov 19 22:48:46 2017 +0800
Fix tracerPid=0 in /proc
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 6f6fc16..bcf470d 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c