Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Backup WSL
#./script.sh backup ~/wsl-backup
# Restore WSL
#./script.sh restore ~/wsl-backup
# Backup WSL
backup_wsl() {
@mohatb
mohatb / nc-proxy-readme.md
Created September 26, 2022 09:49 — forked from m1tk4/nc-proxy-readme.md
netcat tcp proxy, for mapping ports on a remote machine to a local machine

Helper script to map ports to other servers.

Use Case

had a database that was only accesible in the VPC on aws, so i created an dev intance and did a ssh tunnel to that dev instance with netcat mapping the port to the database

Sample Usage

Forward all request from local 5432 to remote host google.com port 80

./nc-proxy.sh 5432 google.com 80
#!/bin/sh
# Source: http://kubernetes.io/docs/getting-started-guides/kubeadm
set -e
source /etc/lsb-release
if [ "$DISTRIB_RELEASE" != "20.04" ]; then
echo "################################# "
echo "############ WARNING ############ "
#!/bin/sh
# Source: http://kubernetes.io/docs/getting-started-guides/kubeadm
set -e
source /etc/lsb-release
if [ "$DISTRIB_RELEASE" != "20.04" ]; then
echo "################################# "
echo "############ WARNING ############ "
@mohatb
mohatb / aks.sh
Created February 5, 2022 21:36 — forked from vfarcic/aks.sh
# Source: https://gist.github.com/0e28b2a9f10b2f643502f80391ca6ce8
####################
# Create a Cluster #
####################
# This script assumes that you followed the instructions from the "Creating And Managing Google Kubernetes Engine (GKE) Clusters With Terraform" section" section.
# It assumes that you have:
# * The resource group *devops-catalog-aks*
# * The storage account *devopscatalog*
FROM alpine:3.11 AS build
ARG CHANNEL=unstable
ARG VERSION=0.99.1-127
ARG ARCH=amd64
RUN mkdir /build
WORKDIR /build
RUN apk add --no-cache curl tar
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
component: alert-on-reboot-la
name: alert-on-reboot-la
namespace: kube-system
spec:
selector:
matchLabels:
@mohatb
mohatb / kubectl.md
Created December 16, 2020 21:04 — 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
@mohatb
mohatb / kubectl.md
Created December 16, 2020 21:04 — 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