Skip to content

Instantly share code, notes, and snippets.

Avatar

Yogendra Rampuria - Yogi yogendra

View GitHub Profile
View Sea-x10.vcf
BEGIN:VCARD
VERSION:2.1
N:Limpanichsakul;Natta;;;
FN:Natta Limpanichsakul
X-ANDROID-CUSTOM:vnd.android.cursor.item/nickname;Sea;1;;;;;;;;;;;;;
TEL;CELL:+66950368179
TEL;WORK:+6626931989
EMAIL;HOME:natta.l@extend-it-resource.com
ADR;HOME:;;;Bangkok;;;Thailand
ORG:X10-IT
@yogendra
yogendra / 9xs2-f89t.sql
Last active Jun 13, 2022
Sample SQL Datasets
View 9xs2-f89t.sql
-- Source Website: https://data.cityofchicago.org/Education/Chicago-Public-Schools-Progress-Report-Cards-2011-/9xs2-f89t
-- Source CSV: https://data.cityofchicago.org/api/views/9xs2-f89t/rows.csv
-- Coverted with https://sqlizer.io with minor tweaks (table name and couple of column names changed)
DROP TABLE IF EXISTS schools;
CREATE TABLE schools
(
"School ID" int8,
"Name of School" text,
"Elementary, Middle, or High School" varchar(2),
"Street Address" varchar(100),
View base-ubuntu-minimal.sh
echo "vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant
sed -i "s/^#UseDNS no/UseDNS no/g" /etc/ssh/sshd_config
curl -L https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub >> ~/.ssh/authorized_keys
apt update
apt install open-vm-tools -qqy
curl https://raw.githubusercontent.com/boxcutter/ubuntu/master/script/cleanup.sh | bash
@yogendra
yogendra / README.md
Last active Sep 24, 2021
Run a Docker Registry with TLS
View README.md

Run Docker Registry with TLS

There are many instances that I need to do this. Especially if I am installing K8s in an internet restricted environment (example: [Install TKG in Internet restricted env][install-tkg-internet-restricted])

So I like to use [docker registry][docker-registry] and [mkcert][mkcert] to play with this scenario

  1. Create directories for certs and data

    mkdir -p data certs
View metric-server-0.4.4.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: metrics-server
name: metrics-server
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
@yogendra
yogendra / README.md
Last active Feb 17, 2021 — forked from rhardt-pivotal/node-ca-updater-daemonset.yaml
add a trusted CA to all the worker nodes in a TKG cluster
View README.md

Kubernetes - Private Registry

When you use your own custom private registry, you may end up using your own private CA signed or self signed certificates. This will cause container runtime to complain about untrusted cert, etc.

Here is a simple code that can fix this for you.

kubectl apply -f https://gist.github.com/yogendra/9937ead35a4ceb6f58ab5c4dc181cec3/node-ca-updater-daemons.yaml
View 1.README.md

Simple Ingress + TLS setup

  1. Update /etc/hosts to point web.corp.local to your ingress IP

    sudo echo "10.40.14.36 web.corp.local" >> /etc/hosts
    
  2. Create certs

    1. Create certificates
View allow-apps-egress-ent-svc.yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-apps-egress-ent-svc
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- to:
View scratch
docker volume create mlab-mongo
docker container run --rm --name mlab-mongo --network-alias mlab-mongo -p 27017:27017 -v mlab-mongo-data:/data/db -d mongo
docker container run --rm --name mlab -p 5000:5000 -e VCAP_SERVICES='{"mlab": ["credentials": {"uri":"mongodb://mlab-mongo:27017/mlab"}]}' -v config.py:/usr/src/app/config.py cloudgeek007/devopspipeline:6
@yogendra
yogendra / README.md
Last active Apr 17, 2020
Jenkins on Docker
View README.md

Run Jenkins on Docker

(Option 1) Docker Compose way

  1. You should have docker-compose installed. If you don't have it, get it from [docker/compose][docker-compose] release page.
  2. Get the [docker-compose.yml][docker-compose.yml]
  3. Go to command line / terminal
  4. Go to directory containing docker-compose.yml. Generally it will be Downloads directory
  5. Run docker compose and dertach
    docker-compose up -d