Skip to content

Instantly share code, notes, and snippets.

Avatar
🤓
coding

Clay Risser clayrisser

🤓
coding
View GitHub Profile
@clayrisser
clayrisser / zalando_standby_minio.md
Created Sep 13, 2020 — forked from senthilcodr/zalando_standby_minio.md
Zalando Standby Cluster using MinIO
View zalando_standby_minio.md

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:
View apache-directory-studio.desktop
[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 — forked from hmenn/android-studio.desktop
android studio desktop shortcut file
View android-studio.desktop
[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 Apr 2, 2020
Rancher Kubernetes Force Delete Namespace
View force_del_namespace.sh
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 Apr 2, 2020
Extract cert.pem and fullchain.pem from tls.crt
View extract_cert_and_fullchain.sh
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 Feb 8, 2020
Update Rancher 2
View backup.sh
#!/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 Jan 20, 2020
Universal Makefiles
View Makefile
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)
View sudo make install
This file has been truncated, but you can view the full file.
[sudo] password for codejamninja:
[ 0%] Built target elfloader_dummy32
[ 0%] Built target elfloader_dummy64
[ 0%] Built target bsdln
[ 0%] Built target x86_64-apple-darwin11-ld
[ 0%] Built target x86_64-apple-darwin11-ar
[ 0%] Built target stuff
[ 0%] Built target lipo
[ 0%] Built target ranlib
View increase_inotify.sh
#!/bin/sh
test -f /etc/sysctl.conf && \
(sudo sed -i 's/fs.inotify.max_user_watches=[[:digit:]]*//g' /etc/sysctl.conf && \
sudo sed -i '/^$/d' /etc/sysctl.conf && \
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p) || true
@clayrisser
clayrisser / qini.py
Last active Sep 11, 2019
Restic AWS Credentials Wrapper
View qini.py
#!/usr/bin/python3
import os
import sys
from configparser import ConfigParser
config = ConfigParser()
config.read(os.path.abspath(sys.argv[1]))
def get_value(path, value):