Skip to content

Instantly share code, notes, and snippets.

View knrt10's full-sized avatar
😇
I may be slow to respond.

Kautilya Tripathi knrt10

😇
I may be slow to respond.
View GitHub Profile
@knrt10
knrt10 / changelog.sh
Last active March 7, 2024 06:20
headlamp changelog script
#!/usr/bin/env bash
# The env variable RANGE specifies the range of commits to be searched for the changelog.
# If unset the latest tag until origin/main will be set.
#
# The env variable GITHUB_TOKEN can specify a GitHub personal access token.
# Otherwise, one could run into GitHub rate limits. Go to
# https://github.com/settings/tokens to generate a token.
set -e
@knrt10
knrt10 / aks-kubeconfig.sh
Created February 12, 2024 09:17
Create AKS cluster and get base64 encoded value of kubeconfig
#!/bin/bash
set -euo pipefail
set -x
export RESOURCE_GROUP=headlamp-stateless
export LOCATION="EAST US"
export CLUSTER_NAME="headlamp"
export SSH_KEY=~/.ssh/headlamp.pub
@knrt10
knrt10 / docker-compose-headlamp-run.sh
Created February 12, 2024 08:56
Run headlamp using docker-compose
#!/bin/bash
set -euo pipefail
set -x
# Clone headlamp repository from github
git clone https://github.com/headlamp-k8s/headlamp.git --depth=1 && cd headlamp
echo '
version: "3"
@knrt10
knrt10 / create-azurevm.sh
Last active February 12, 2024 05:04
Create a VM on azure
#!/bin/bash
set -euo pipefail
set -x
export VM_NAME=stateless
export RESOURCE_GROUP=headlamp-stateless
export LOCATION="EAST US"
export IMAGE="Ubuntu2204"
export VM_SIZE=Standard_D8as_v5
@knrt10
knrt10 / install-docker-amd64.sh
Last active February 12, 2024 08:42
Install docker in amd64 machines
#!/bin/bash
set -euo pipefail
set -x
# Source: https://docs.docker.com/engine/install/ubuntu/
apt-get update
apt-get -y remove docker docker-engine docker.io containerd runc || true
apt-get install -y \
@knrt10
knrt10 / gateway-prep.sh
Created April 5, 2022 09:31
gateway-prep.sh for mac
#!/bin/bash
set -eu
conf_zip=""
if [ -f kv0.zip ] ; then
conf_zip="kv0.zip"
fi
if [ -f kv1.zip ] ; then
conf_zip="kv1.zip"
#!/usr/bin/env bash
helm create santosh-test-helm
cd santosh-test-helm/
rm -rf templates charts
mkdir templates/
@knrt10
knrt10 / install-actions-runner-debian.yaml
Last active May 11, 2021 13:03
Deployment to install actions runner on Debian based machine
apiVersion: apps/v1
kind: Deployment
metadata:
name: github-action-runner
spec:
replicas: 1
selector:
matchLabels:
app: github-action-runner
strategy: {}
@knrt10
knrt10 / install-docker-debian.sh
Created May 11, 2021 10:55
Script to install docker in debian
#!/bin/bash
set -euo pipefail
set -x
# Source: https://docs.docker.com/engine/install/debian
apt-get update
apt-get -y remove docker docker-engine docker.io containerd runc || true
apt-get -y install \
➜ kc logs run-mysql-benchmark-n86hb -f  ✔  10235  15:35:06
Starting the database server...
[i] MySQL data directory not found, creating initial DBs
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)
2021-05-11 10:05:01 1 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory")
[i] MySQL root Password: 111111
[i] Creating database: sbtest
2021-05-11 10:05:01 0 [Note] /usr/bin/mysqld (mysqld 10.5.9-MariaDB-log) starting as process 94 ...
2021-05-11 10:05:01 0 [Note] InnoDB: Uses event mutexes
2021-05-11 10:05:01 0 [Note] InnoDB: Compressed tables use zlib 1.2.11