Skip to content

Instantly share code, notes, and snippets.

@boddumanohar
boddumanohar / jq-notes.md
Last active December 17, 2022 10:49
Extract a specific field from JSON output using jq
{
  "example": {
    "sub-example": [
      {
        "name": "123-345",
        "tag" : 100
      },
      {
 "name": "234-456",
@boddumanohar
boddumanohar / Caddyfile
Created September 11, 2022 11:37
caddy: using staging endpoint for letsencrypt
{
acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}
www.google.com {
route {
reverse_proxy blobber:5051
}
}
@boddumanohar
boddumanohar / run-etcd-locally.md
Created April 2, 2021 19:56
run etcd locally
docker run -d \
  -p 2379:2379 \
  -p 4001:4001 \
  --name etcd \
  -v /usr/share/ca-certificates/:/etc/ssl/certs \
  quay.io/coreos/etcd:v2.3.8 \
  -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
  --advertise-client-urls http://0.0.0.0:2379
@boddumanohar
boddumanohar / install_protoc.md
Last active February 20, 2021 15:51
How to Install Latest Protobuf on Ubuntu 20

METHOD 1:

PROTOCOL_BUF_VERSION=v3.15.1
PROTOC_GEN_GO_GRPC_VERSION=v1.1.0
PROTOC_GEN_GO_VERSION=v1.25.0
wget https://github.com/protocolbuffers/protobuf/releases/download/$PROTOCOL_BUF_VERSION/protoc-$PROTOCOL_BUF_VERSION-linux-x86_64.zip
wget https://github.com/grpc/grpc-go/releases/download/cmd/protoc-gen-go-grpc/$PROTOGEN_GO_GRPC_VERSION/protoc-gen-go-grpc.$PROTOGEN_GO_GRPC_VERSION.linux.amd64.tar.gz
wget wget https://github.com/protocolbuffers/protobuf-go/releases/download/$PROTOC_GEN_GO_VERSION/protoc-gen-go.$PROTOC_GEN_GO_VERSION.linux.amd64.tar.gz
sudo unzip -o protoc-3.15.1-linux-x86_64.zip -d /usr/local bin/protoc

Notes on Memory Map Detection in the Kernel

Introduction

The kernel needs to know the system memory map to initialize its memory management subsystem at early boot. The memory map defines the physical memory layout, which specifies how much memory is available on the system and which parts of the physical memory are reserved for memory-mapped I/O or other special purposes. The kernel uses the memory map to setup its internal memory management data structures in regions of the memory that are safe to use.

System memory is typically initialized by the firmware, which has most information about hardware in general. The firmware therefore knows the system memory map. The kernel has two methods for obtaining the memory map: the kernel can query the firmware for a memory map or the kernel can ask the boot loader to provide it. Both methods are used by kernels, usually depending on which machine architecture they're running on.

Firmware Methods

Keybase proof

I hereby claim:

  • I am boddumanohar on github.
  • I am boddumanohar (https://keybase.io/boddumanohar) on keybase.
  • I have a public key ASDzeJNX2mrVuIkieWTcTfOr-N8W7z_c62V0LxkZuXWAQgo

To claim this, I am signing this object: