Skip to content

Instantly share code, notes, and snippets.

View andsens's full-sized avatar

Anders Ingemann andsens

View GitHub Profile
andsens /
Last active October 26, 2022 11:38
Bash notebook for nifty things
#!/usr/bin/env bash
# wait for backgrounded jobs and propagate $?>0.
local pid
while read -r pid; do wait "$pid"; done < <(jobs -p)
# wait for backgrounded jobs, propagate $?>0, and exit early on failure.
while (($(jobs -p | wc -l) > 0)); do
if wait -n; then
andsens /
Created February 2, 2021 07:34
Patches the linux bluetooth driver to handle dongles that report they are CSR, but really aren't
#!/usr/bin/env bash
set -e
SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
main() {
local kernver
kernver=$(uname -r)
sudo apt update
#!/usr/bin/env bash
# Inspired by
# Guide:
# Install GPG on windows & Unix
# Add "enable-putty-support" to gpg-agent.conf
# Download wsl-ssh-pageant and npiperelay and place the executables in "C:\Users\[USER]\AppData\Roaming\" under wsl-ssh-pageant & npiperelay
# Adjust relay() below if you alter those paths
andsens / Component.tsx
Created April 18, 2020 07:46
FragmentReference reproduce for relay-tools/relay-compiler-language-typescript
import { ComponentPaginationQuery } from "./artifacts/ComponentPaginationQuery.graphql";
import { Component_items$key } from "./artifacts/Component_items.graphql";
export function Component(props: { itemsFragment: Component_items$key }) {
const {
data: { items },
} = usePaginationFragment<ComponentPaginationQuery, Component_items$key>(
fragment Component_items on Viewer
andsens /
Created July 29, 2019 22:26
Demonstration of
#!/usr/bin/env bash
DOC="Naval Fate.
Usage: ship <name> move <x> <y> [--speed=<kn>] ship shoot <x> <y>
--speed=<kn> Speed in knots [default: 10].
andsens / Dockerfile
Last active June 6, 2019 14:14
Kibana docker container with pre-optimized bundles
USER root
RUN NODE_OPTIONS="--max_old_space_size=4096" kibana-plugin install${LOGTRAIL_VERSION}/logtrail-${KIBANA_VERSION}-${LOGTRAIL_VERSION}.zip
COPY kibana.yaml /usr/share/kibana/config/kibana.yml
COPY elasticsearch.repo /etc/yum.repos.d/elasticsearch.repo
andsens / skaffold.log
Created March 8, 2019 09:40
skaffold deploy debug output
INFO[0000] Skaffold &{Version:v0.24.0 ConfigVersion:skaffold/v1beta6 GitVersion: GitCommit:6a829c4b29e3a102b0b14c4584cd174f780402e9 GitTreeState:clean BuildDate:2019-03-01T20:36:32Z GoVersion:go1.12 Compiler:gc Platform:darwin/amd64}
DEBU[0000] Defaulting build type to local build
INFO[0000] no config entry found for kube-context
INFO[0000] Using kubectl context:
INFO[0000] no config entry found for kube-context
DEBU[0000] Using builder: local
DEBU[0000] setting Docker user agent to skaffold-v0.24.0
INFO[0000] no config entry found for kube-context
DEBU[0000] push value not present, defaulting to true because localCluster is false
Starting build...
andsens / crd.yaml
Created March 6, 2019 16:13
skaffold reproduce
kind: CustomResourceDefinition
creationTimestamp: null
labels: "1.0"
- JSONPath: .status.conditions[?(@.type==\"Ready\")].status
andsens / Corefile
Last active February 12, 2019 12:38
Minikube DNS addon
.:53 {
cache 30
etcd k8s {
endpoint http://etcd:2379
andsens / npm-list-pkg-lock.json
Last active September 8, 2017 11:22
`npm list --json` when package-lock.json is absent and present
npm list --json
"name": "@secoya/rabbitmq-tools",
"version": "0.1.8",
"problems": [
"missing: amqplib@0.4.2, required by @secoya/rabbitmq-tools@0.1.8",
"missing: babel-runtime@6.9.2, required by @secoya/rabbitmq-tools@0.1.8",
"missing: bitsyntax@0.0.4, required by amqplib@0.4.2",
"missing: buffer-more-ints@0.0.2, required by amqplib@0.4.2",
"missing: readable-stream@1.1.14, required by amqplib@0.4.2",