Skip to content

Instantly share code, notes, and snippets.

~ (k8s:default) > kubectl explain pod
KIND: Pod
VERSION: v1
DESCRIPTION:
Pod is a collection of containers that can run on a host. This resource is
created by clients and scheduled onto hosts.
FIELDS:
apiVersion <string>
@KyWa
KyWa / gist:d71f3e6011653a8ccbbf7b178084ec58
Created January 29, 2022 13:06
Kubectl Get All (namespaced api-resources)
~ (k8s:default) > kubegetall kube-system
Resource: configmaps
NAME DATA AGE
coredns 1 3d9h
extension-apiserver-authentication 6 3d9h
kube-proxy 2 3d9h
kube-root-ca.crt 1 3d9h
kubeadm-config 1 3d9h
kubelet-config-1.23 1 3d9h
@KyWa
KyWa / filesystemcheck.sh
Created November 10, 2021 03:25
Bash Check Filesystem Type
#!/bin/bash
if [ -z "$1" ];then
echo "0 Arguments given. Please pass in a disk path"
echo ""
fi
fstype=`df -T | grep $1 | awk '{print $2}'`
if [[ $fstype == "ext4" ]];then
@KyWa
KyWa / code-server.yml
Created August 31, 2021 02:01
Code Server YAML Manifest
---
apiVersion: v1
kind: Namespace
metadata:
name: code-server
---
apiVersion: v1
kind: Secret
metadata:
name: code-server
@KyWa
KyWa / snortscript.sh
Created August 27, 2021 14:51
Snort Script
#!/bin/bash
wget https://www.snort.org/downloads/community/community-rules.tar.gz -O community-rules.tar.gz
tar -xvzf community-rules.tar.gz -C /etc/snort/rules
systemctl restart snort
@KyWa
KyWa / gitcheck.sh
Created June 28, 2021 22:05
basic git check
#!/bin/bash
repodir="/home/user/repo"
check_git() {
cd $repodir
current="cat .git/FETCH_HEAD | awk '{print $1}'"
git pull
pulled="cat .git/FETCH_HEAD | awk '{print $1}'"
if [ $current = $pulled ];then