Skip to content

Instantly share code, notes, and snippets.

View dims's full-sized avatar

Davanum Srinivas dims

View GitHub Profile
#!/bin/bash
cat > ubuntu-pod.json <<EOF
{
"metadata": {
"name": "ubuntu-sandbox",
"namespace": "default",
"attempt": 1,
"uid": "ubuntu-pod-uid"
},
# Create a fresh new Ubuntu 24.04 VM and run the commands below:
# Install a bunch of stuff we need
apt update && apt -y install gperf sudo htop psutils build-essential pkg-config git wget unzip
# Clone what we need
git clone https://github.com/kubernetes/kubernetes $HOME/go/src/k8s.io/kubernetes
git clone https://github.com/containerd/containerd $HOME/go/src/github.com/containerd/containerd
# Latest golang
@dims
dims / skip-job.sh
Created February 6, 2025 11:55
Script to skip certain jobs in a PR
#!/usr/bin/env bash
# Default repository and job name
REPO="google/cadvisor"
JOB_NAME="pull-cadvisor-e2e"
# Function to display usage
usage() {
echo "Usage: $0 -p <PR_NUMBER> [-j <JOB_NAME>] [-s <SHA>] [-r <REPOSITORY>]"
echo "Example: $0 -p 3615"
@dims
dims / README.md
Last active February 1, 2025 03:06
Deploy deepseek-ai distill models

Notes

Deploy using kubectl apply -f deepseek.yaml and watch the logs on the pod. When you see vllm listening on port 8000, use port forward so you can try running python query.py

kubectl port-forward svc/deepseek-r1-server 8000:8000

Links

@dims
dims / README.md
Created January 14, 2025 15:13
Using pprof to find memory leaks for golang binaries
  1. run the main.go using go run main.go
  2. find the pid of the process and send a USR1 signal using kill -USR1 pid-of-main
  3. the heap_profile.pprof will be generated in the directory the main process was running
  4. run go tool pprof -http=:8081 heap_profile.pprof to visualize the heap
@dims
dims / features.md
Last active May 4, 2025 12:38
`Feature Gates in Kubernetes master branch on Jan 11, 2025`
@dims
dims / eks-add-on-to-k8s-version.sh
Created January 8, 2025 17:08
EKS add-on version to Kubernetes version matrix
#!/bin/bash
aws eks describe-addon-versions | jq -r '.addons[] |
{
addon: .addonName,
versions: [
.addonVersions[] | {
version: .addonVersion,
kubernetes_versions: [
.compatibilities[].clusterVersion
@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