Skip to content

Instantly share code, notes, and snippets.

View tuxfight3r's full-sized avatar
:octocat:
Working from home

Mohan Balasundaram tuxfight3r

:octocat:
Working from home
View GitHub Profile
@tuxfight3r
tuxfight3r / spinnaker.tf
Created May 17, 2019 00:42 — forked from hareku/spinnaker.tf
Spinnaker + AWS Terraform
#####################################
# Namespace: Spinnaker
#####################################
resource "kubernetes_namespace" "spinnaker" {
metadata {
name = "spinnaker"
}
}
#####################################
@tuxfight3r
tuxfight3r / openshift-cheatsheet.md
Created April 25, 2019 09:42 — forked from canit00/openshift-cheatsheet.md
My Openshift Cheatsheet

My Openshift Cheatsheet

Examine the cluster quota defined for the environment:

$ oc describe AppliedClusterResourceQuota

Install pkgs using yum in a Dockerfile

@tuxfight3r
tuxfight3r / socat-forward-tcp.sh
Created April 18, 2019 14:15 — forked from drmalex07/socat-forward-tcp4-to-tcp6.sh
Tunnel TCP traffic via socat. #socat
#!/bin/bash
PUBLIC_IP4_IFACE=eth2
LISTEN_IFACE=${PUBLIC_IP4_IFACE}
listen_address=$(ip -f inet addr show dev ${LISTEN_IFACE} | grep -Po 'inet \K[\d.]+')
listen_port=${1}
target_host=${2}
target_port=${3}
@tuxfight3r
tuxfight3r / README-oneshot-systemd-service.md
Created April 18, 2019 13:45 — forked from drmalex07/README-oneshot-systemd-service.md
An example with an oneshot service on systemd. #systemd #systemd.service #oneshot

README

Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services, no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.

Let's create a example foo service that when started creates a file, and when stopped it deletes it.

Define setup/teardown actions

Create executable file /opt/foo/setup-foo.sh:

@tuxfight3r
tuxfight3r / lambda-basic-auth.js
Created April 16, 2019 09:04 — forked from lmakarov/lambda-basic-auth.js
Basic HTTP Authentication for CloudFront with Lambda@Edge
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';
@tuxfight3r
tuxfight3r / aws-eks-lab.sh
Created April 14, 2019 18:10 — forked from mtulio/aws-eks-lab.sh
Basic EKS lab to setup an new cluster
#!/bin/bash
# Basic EKS client Setup and management
# Doc: https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html
OS_NAME=linux
OS_ARCH=amd64
OS_DIST=$(cat /etc/os-release |grep ^NAME |awk -F'=' '{print$2}')
KUBECTL_URL=https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-07-26/bin/${OS_NAME}/${OS_ARCH}/kubectl
@tuxfight3r
tuxfight3r / kubectl.md
Created February 21, 2019 16:34 — 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
@tuxfight3r
tuxfight3r / memory_layout.md
Created February 21, 2019 16:32 — forked from CMCDragonkai/memory_layout.md
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore
@tuxfight3r
tuxfight3r / audit.rules
Created February 14, 2019 11:33 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
@tuxfight3r
tuxfight3r / aws_create_site.yml
Created January 30, 2019 23:46 — forked from ruzickap/aws_create_site.yml
Ansible playbook which creates instances and tag volumes
---
- name: Create Instance in AWS
hosts: localhost
connection: local
gather_facts: false
vars:
aws_access_key: "xxxxxx"
aws_secret_key: "xxxxxx"
security_token: "xxxxxx"