Skip to content

Instantly share code, notes, and snippets.

@shashank-k
shashank-k / links.md
Created March 26, 2018 11:34 — forked from g0t4/links.md
Starting Point Files for Jenkins2 Getting Started course
@shashank-k
shashank-k / keycloak_aws_deployment.md
Created May 12, 2018 08:22 — forked from pgchamberlin/keycloak_aws_deployment.md
Deploying Keycloak to AWS using a Ubuntu AMI

Deploying Keycloak to AWS

The objective of this guide is to deploy Keycloak to AWS in a minimally complex way for testing and discovery purposes. This means using the standalone build of Keycloak backed with Hibernate H2. The result is not a production ready system. It won't scale, it won't survive significant load, it can't be clustered.

Mostly this Gist is a distillation of the Keycloak Server Installation guide for a specific use case: to spin up a quick and dirty Keycloak instance for testing and experimenting.

Steps

  • Spin up and configure a Ubuntu AMI
  • Install and configure Keycloak with an SSL cert
@shashank-k
shashank-k / squid.conf
Created June 24, 2018 07:38 — forked from hpcorona/squid.conf
simple squid3 configuration to allow all to connect to all
#Recommended minimum configuration:
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 0.0.0.0/8 192.168.100.0/24 192.168.101.0/24
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
@shashank-k
shashank-k / pre-commit
Created August 23, 2018 09:36 — forked from jamtur01/pre-commit
A Terraform validation and formatting pre-commit hook
#!/usr/bin/env bash
set -e
# Formats any *.tf files according to the hashicorp convention
files=$(git diff --cached --name-only)
for f in $files
do
if [ -e "$f" ] && [[ $f == *.tf ]]; then
#terraform validate `dirname $f`
terraform fmt $f
################################################################################
############################# Monit control file #############################
################################################################################
##
#
# Comments begin with a '#' and extend through the end of the line. Keywords
# are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
#
@shashank-k
shashank-k / scp_demo.py
Last active January 27, 2019 04:35 — forked from mlafeldt/scp_demo.py
Python- paramiko examples
#!/usr/bin/env python
import sys, paramiko
if len(sys.argv) < 5:
print "args missing"
sys.exit(1)
hostname = sys.argv[1]
password = sys.argv[2]

The view ClusterRole doesn’t actually have permissions for the Cluster level objects like Nodes and Persistent Volume Claims. So we’ll have to create a new RBAC config.

First, we’ll create a new dashboard-viewonly ClusterRole:

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: dashboard-viewonly
@shashank-k
shashank-k / kubectl.md
Created November 26, 2020 07:56 — forked from so0k/kubectl.md
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
Questions are not from any actual exam!!!
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution:
@shashank-k
shashank-k / README.md
Created July 12, 2021 17:51 — forked from dims/README.md
Kubernetes Resources