Skip to content

Instantly share code, notes, and snippets.

Mohan Balasundaram tuxfight3r

Block or report user

Report or block tuxfight3r

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tuxfight3r /
Last active May 7, 2019
openshift4 boot strap ignition configs

Openshift 4 bootstrap node ignition configs

# Ignition config touches 4 components when it bootstraps
# 1. Ignition version
$cat bootstrap.ign |jq '.ignition'
  "config": {},
  "security": {
    "tls": {}
tuxfight3r /
Last active Nov 25, 2019
python3 HTTP Echo Server with directory browsing
#!/usr/bin/env python3
# Author: Mohan Balasundaram
# Date: 02/05/2019
# Purpose: HTTP Echo server with directory browsing
# To run a http server and return all request headers in / path
# and to allow directory browsing in any other path prefix
from http.server import BaseHTTPRequestHandler, SimpleHTTPRequestHandler
import urllib.parse
tuxfight3r /
Last active May 1, 2019
openshift4 default resources

get clusterversions

$ oc get clusterversions
version   4.1.0-rc.0   True        False         25h     Cluster version is 4.1.0-rc.0

get clusteroperator

$ oc get clusteroperator
tuxfight3r /
Last active Nov 25, 2019
certbot letsencrypt tricks

letsencrypt cert tricks

# create free lets encrypt certs
certbot certonly --standalone --preferred-challenges http -d

# Useful links:


splunk notes

index=* | stats count user
index=* | stats count by user method version
index=* user="adm*"|stats count by user method version
index=* NOT user="-"|stats count by user method version
index=* NOT user="-" method=get|stats count by user method version

index=* user="*"| timechart count by user

curl connect to https domain using ip

curl --resolve --cacert adcacrt.crt -v

curl use proxy

# http proxy
curl -v -x -L
tuxfight3r /
Last active Apr 27, 2019
container basics cgroups namespaces
# Prepare a hash. We need it to identify our container.
$ uuid="ps_$(shuf -i 42002-42254 -n 1)"
# Prepare a root dir for all the containers.
$ btrfs_path='/var/bocker' && cgroups='cpu,cpuacct,memory';
# Prepare root filesystem based on the given `$image`.
$ btrfs subvolume snapshot "$btrfs_path/$image" "$btrfs_path/$uuid" > /dev/null
# Create a cgroup
tuxfight3r /
Last active Apr 25, 2019
Python script for returning environment facts in json format based on the requested network.
# Author: Mohan Balasundaram
# Date: 25/04/2019
# Purpose: python api for node location facts in json format
from flask import Flask, request, Response
import netaddr
import json
# user data

My Openshift Cheatsheet

Examine the cluster quota defined for the environment:

$ oc describe AppliedClusterResourceQuota

Install pkgs using yum in a Dockerfile

tuxfight3r /
Last active Apr 27, 2019
minikube tips & tricks

create a new minikube profile

minikube profile lab

minikube set config for cpu/memory/disk

minikube config set cpus 4
minikube config set memory 8192
minikube config set disk-size 10240MB
You can’t perform that action at this time.