Skip to content

Instantly share code, notes, and snippets.

@dims
dims / unfollow.js
Created November 15, 2024 16:04 — forked from ntfargo/unfollow.js
BlueSky | Unfollow All
/*
You need create .env file with the following variables:
BSKYHANDLE=yourhandle
BSKYPASS=yourpass
*/
const {
BskyAgent
} = require('@atproto/api');
require('dotenv').config();
cat <<EOF | curl --location 'https://bsky.social/xrpc/com.atproto.server.createSession' --header 'Content-Type: application/json' -d @- | jq
{
  "identifier": "dims.dev",
  "password": "$BSKY_PASSWORD"
}
EOF

WORKS!
go test -c -race ./pkg/kubelet/
stress ./kubelet.test -test.run=TestUpdateNodeStatusWithLease
@dims
dims / get-tag
Last active November 4, 2024 20:19
#!/bin/bash
set -xeu
TAG=${1#dims:}
git fetch --all --tags
git checkout tags/$TAG -b branch-for-tag-$TAG

Install cedar CLI binary

brew install rustup
rustup update
cargo install cedar-policy-cli

Install kind

go install sigs.k8s.io/[email protected]
{
"spec": {
"unwantedModules": {
"cloud.google.com/go": "cloud dependency",
"cloud.google.com/go/bigquery": "cloud dependency",
"cloud.google.com/go/compute": "cloud dependency",
"cloud.google.com/go/firestore": "db/datastore clients should not be required",
"cloud.google.com/go/storage": "cloud dependency",
"github.com/GoogleCloudPlatform/k8s-cloud-provider": "cloud dependency",
"github.com/PuerkitoBio/urlesc": "unmaintained, archive mode",
@dims
dims / fields.yaml
Last active August 17, 2024 20:28
v1.31 API generation
- definition: io.k8s.api.core.v1.PodSpec
field_categories:
- name: Containers
fields:
- containers
- initContainers
- ephemeralContainers
- imagePullSecrets
- enableServiceLinks
- os
#!/bin/bash
crictl ps
crictl pods
crictl stop $(crictl ps -q)
crictl rm $(crictl ps -q)
crictl stopp $(crictl pods -q)
crictl rmp $(crictl pods -q)
@dims
dims / gist:d8069b1c27409f9130f815bc6075ee2d
Created August 13, 2024 01:05
Shows the name of the command running on each port on MacOS
sudo lsof -iTCP -sTCP:LISTEN -n -P | awk 'NR>1 {print $9, $1, $2}' | sed 's/.*://' | while read port process pid; do echo "Port $port: $(ps -p $pid -o command= | sed 's/^-//') (PID: $pid)"; done | sort -n