Skip to content

Instantly share code, notes, and snippets.

@shashank-k
shashank-k / nginxproxy.md
Created April 21, 2022 09:23 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@shashank-k
shashank-k / ckaexamprep.md
Created August 28, 2021 16:47 — forked from gabrielfsousa/ckaexamprep.md
CKA exam preparation

Preparation for CKA with Kubernetes version 1.17.1 on REDHAT 8

What i need to know for the exam ? 🏁

% Domain
08% Application Lifecycle Management
12% Installation, Configuration & Validation
19% Core Concepts
11% Networking
@shashank-k
shashank-k / Vagrantfile
Created July 23, 2021 13:12 — forked from djoreilly/Vagrantfile
Vagrant with extra disks
Vagrant.configure("2") do |config|
config.vm.box = "trusty"
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.hostname = "devstack"
# forward ssh keys from main host - handy for gerrit and github
config.ssh.forward_agent = true
@shashank-k
shashank-k / README.md
Created July 12, 2021 17:51 — forked from dims/README.md
Kubernetes Resources
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 / 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

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 / 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]
################################################################################
############################# 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 / 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