Skip to content

Instantly share code, notes, and snippets.

%matplotlib qt
import pyaudio
import numpy as np
import matplotlib.pyplot as plt
from queue import Queue
import threading
import time
from IPython.display import display, clear_output
@pojntfx
pojntfx / main.sh
Last active March 19, 2024 03:03
Bluesky/AT Protocol: cURL API Interaction Cheatsheet
#!/bin/bash
# This script resolves a DID, retrieves an API key, fetches a user's feed,
# and posts a "Hello, world" message to the user's feed.
# Resolve DID for handle
HANDLE='felicitas.pojtinger.com'
DID_URL="https://bsky.social/xrpc/com.atproto.identity.resolveHandle"
export DID=$(curl -G \
--data-urlencode "handle=$HANDLE" \
@darkn3rd
darkn3rd / provision.md
Last active January 4, 2024 08:30
Pedantic ADHD Guide to Kubernetes Provisioning

Pedantic ADHD Guide to Kubenretes Provisioning

This is my guide for how to get Kubernetes provisioned using Azure, Google Cloud, or AWS using CLI tools. This will require setting up an account with local CLI tools. The goal of this is to quickly set up a disposable test clusters in minimalist way.

The Tools

Some tools used here:

  • General
  • direnv (direnv) - used to setup environment variables automatically
import "https://deno.land/x/dotenv/load.ts";
const response = await fetch("https://www.getrevue.co/api/v2/issues", {
headers: {
Authorization: `Token ${Deno.env.get("REVUE_API_KEY")}`,
},
});
const issues = await response.json();
@legowerewolf
legowerewolf / readme.md
Last active April 7, 2024 02:13
Tailscale on Steam Deck
@stealthybox
stealthybox / README.md
Last active July 15, 2022 01:55
Does anyone have an example k8s deployment with RBAC permissions to run something like `kubectl get --raw /apis/metrics.k8s.io/v1beta1/nodes` ? https://twitter.com/rothgar/status/1544934007397175297

This is a tested example.
Not all clusters will have the metrics API, but this will function for ones that do.

The deployment uses the bitnami/kubectl image. It runs "get node metrics" in a shell while loop that sleeps.

The Deployment's Pod-template uses a ServiceAccount that is ClusterRoleBound to a ClusterRole permitting the list and get verbs for the Node kind in the metrics.k8s.io API group.

Here's how to reproduce:

@mislav
mislav / config.json
Last active January 18, 2024 10:48
Experiment in using GitHub CLI to authenticate fetching docker images from GitHub Package Registry
// ~/docker/config.json
{
"credsStore": "desktop",
"credHelpers": {
"docker.pkg.github.com": "gh",
"ghcr.io": "gh"
}
}
@frabert
frabert / COPYING
Last active December 21, 2023 13:35
Favicons for HN
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@toricls
toricls / app-runner-template.yml
Created May 19, 2021 06:57
AWS App Runner CloudFormation Template generated using AWS Copilot
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
AWSTemplateFormatVersion: 2010-09-09
Description: CloudFormation template that represents a request driven web service on AWS App Runner.
Parameters:
AppName:
Type: String
EnvName:
Type: String
WorkloadName:
@dims
dims / README.md
Last active April 18, 2024 06:16
Kubernetes Resources