Skip to content

Instantly share code, notes, and snippets.

View clayrisser's full-sized avatar
🤓
coding

Clay Risser clayrisser

🤓
coding
View GitHub Profile
@clayrisser
clayrisser / sweep_cluster.sh
Created May 22, 2024 09:05
Delete all pods with phase Error
kubectl get pods --all-namespaces -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name,REASON:.status.phase --field-selector=status.phase=Failed --no-headers | awk '{print $1 " " $2}' | while read ns pod; do echo kubectl delete pod $pod -n $ns
@clayrisser
clayrisser / accouting_cheat_sheet.md
Last active October 2, 2023 13:58
Accounting Cheat Sheet

Accounting Cheat Sheet

DEA - Debit increases Expenses and Assets

CLI - Credit increases Liabilities and Income

Assets Liabilities (Equity) Income (Revenue) Expenses
Debit
Credit
@clayrisser
clayrisser / THIRD-PARTY.txt
Last active July 18, 2021 02:03
Proposed THIRD-PARTY.txt IANAL
3RD PARTY LICENSES
This document contains the list of Third Party Software included with
<PROJECT_NAME>, along with the license information.
Third Party Software may impose additional restrictions and it is the
user's responsibility to ensure that they have met the licensing
requirements of <PROJECT_NAME> and the relevant license of
the Third Party Software they are using.
@clayrisser
clayrisser / zalando_standby_minio.md
Created September 13, 2020 03:43 — forked from senthilcodr/zalando_standby_minio.md
Zalando Standby Cluster using MinIO

To set-up wal shipping in primary cluster:

  1. In the file manifests/configmap.yaml, uncomment the line containing wal_s3_bucket and set it to the bucket name created in MinIO.
  2. And then, add the following lines to the same file:
  pod_environment_configmap: postgres-pod-config
---
apiVersion: v1
kind: ConfigMap
metadata:
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Apache Directory Studio
Exec=/opt/ApacheDirectoryStudio/ApacheDirectoryStudio
Icon=/opt/ApacheDirectoryStudio/features/org.apache.directory.studio.nls.feature_2.0.0.v20170904-M13/studio.png
Categories=Network;Development
Keywords=ldap;
@clayrisser
clayrisser / android-studio.desktop
Created May 12, 2020 19:28 — forked from hmenn/android-studio.desktop
android studio desktop shortcut file
[Desktop Entry]
Encoding=UTF-8
Version=2.2.3
Type=Application
Terminal=false
Exec="/opt/android-studio/bin/studio.sh"
Name=Android Studio
Comment=Android Studio
Categories=Programming;
Icon=/opt/android-studio/bin/studio.png
@clayrisser
clayrisser / force_del_namespace.sh
Created April 2, 2020 14:23
Rancher Kubernetes Force Delete Namespace
NAMESPACE=
CLUSTER_ID=
kubectl get namespace $NAMESPACE -o json | jq '.spec = {"finalizers":[]}' > temp.json
curl -k -H "Content-Type: application/json" \
-X PUT --data-binary @temp.json \
127.0.0.1:8001/k8s/clusters/$CLUSTER_ID/api/v1/namespaces/$NAMESPACE/finalize
@clayrisser
clayrisser / extract_cert_and_fullchain.sh
Last active April 2, 2020 13:33
Extract cert.pem and fullchain.pem from tls.crt
cat tls.crt | base64 -d | tr '\n' '~' | \
sed 's/-\+END CERTIFICATE-\+~-\+BEGIN CERTIFICATE-\+/~/g' | \
awk '{split($0,array,"~~~")} END{print array[1]}' | tr '~' '\n' > cert.pem
echo "-----END CERTIFICATE-----" >> cert.pem
echo >> cert.pem
echo "-----BEGIN CERTIFICATE-----" > fullchain.pem
cat tls.crt | base64 -d | tr '\n' '~' | \
sed 's/-\+END CERTIFICATE-\+~-\+BEGIN CERTIFICATE-\+/~/g' | \
awk '{split($0,array,"~~~")} END{print array[2]}' | tr '~' '\n' >> fullchain.pem
@clayrisser
clayrisser / backup.sh
Last active February 8, 2020 23:14
Update Rancher 2
#!/bin/sh
export RANCHER_CONTAINER_NAME=rancher
export RANCHER_CONTAINER_TAG=v2.3.5
export DATE=$(date '+%s')
docker stop $RANCHER_CONTAINER_NAME
docker create --volumes-from $RANCHER_CONTAINER_NAME --name rancher-data-$DATE rancher/rancher:$RANCHER_CONTAINER_TAG
docker run --volumes-from rancher-data-$DATE -v $PWD:/backup busybox tar zcvf /backup/rancher-data-backup-$RANCHER_VERSION-$DATE.tar.gz /var/lib/rancher
docker start $RANCHER_CONTAINER_NAME
@clayrisser
clayrisser / Makefile
Created January 20, 2020 01:55
Universal Makefiles
PLATFORM := $(shell node -e "process.stdout.write(process.platform)")
ifeq ($(PLATFORM), win32)
SHELL = cmd
endif
.EXPORT_ALL_VARIABLES:
all:
@echo platform: $(PLATFORM)
@echo shell: $(SHELL)