Skip to content

Instantly share code, notes, and snippets.

@jordansissel
jordansissel / conf
Last active May 19, 2022
Parsing flags from a file in Clamp in Ruby
View conf
--version 1.2.3.4
@jordansissel
jordansissel / OUTPUT
Created Nov 9, 2021
pleaserun systemd service extraction with jq
View OUTPUT
[Unit]
Description=no description given
[Service]
Type=simple
User=root
Group=root
# Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.
# Prefixing the path with '-' makes it try to load, but if the file doesn't
# exist, it continues onward.
View x11-copilot.c
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
Display *dpy;
// Below here, Copilot generated the rest.
dpy = XOpenDisplay(NULL);
if (dpy == NULL) {
@jordansissel
jordansissel / output.md
Last active Oct 18, 2021
Climate controllers with local network access, according to Home Assistant
View output.md
% git clone --depth 1 https://github.com/home-assistant/core

Find "climate" support, then look for components with iot_class matching "local"

% grep -l climate */const.py | awk -F/ '{print $1}' | xargs -n1 sh -c 'jq .iot_class $1/manifest.json | grep -q local && echo "* https://www.home-assistant.io/integrations/$1"' -
@jordansissel
jordansissel / OUTPUT
Created May 27, 2021
xinput list devices showing pointer locations
View OUTPUT
% gcc main.c $(pkg-config --libs x11 xi --cflags) -o xinput-example
% ./xinput-example
Pointer id:2 at location 1011,756
@jordansissel
jordansissel / Setup.md
Last active Feb 2, 2021
Arch Linux setup
View Setup.md

Partitioning

Partitioning is something I do once a year and never remember. Arch's docs have great reference guides, but I just want to move on with my life without reading too much docs. This aims to simplify my partitioning experience.

fdisk /dev/<disk device>

g # new gpt disk label
@jordansissel
jordansissel / Steps.md
Created Sep 24, 2020
Home Assistant on Raspberry Pi OS
View Steps.md
@jordansissel
jordansissel / main.go
Created Nov 21, 2019
go-elasticsearch w/ setting custom trusted CA certs and custom headers
View main.go
package main
import (
"encoding/base64"
"crypto/x509"
"fmt"
"github.com/elastic/go-elasticsearch/v8"
"io/ioutil"
"log"
"net/http"
View example
$ test1=foo
$ set -a
$ test2=foo
$ test3=foo
$ set +a
$ env | grep test
test2=foo
test3=foo
@jordansissel
jordansissel / FZF Examples.md
Last active Feb 14, 2021
FZF usage examples
View FZF Examples.md

GKE

Get credentials for a given GKE cluster

gcloud container clusters get-credentials $(gcloud container clusters list --format json | jq -r '.[] | "\(.name) --zone \(.location)"' | fzf --height 10 --sync)

Kubernetes