Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@AAber
AAber / Node-Gateway-DaemonSet.yaml
Last active September 13, 2018 14:32
Expose a node application running in a Kubernetes DaemonSet by running a socat DaemonSet
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: gateway-daemon-set
namespace: default
spec:
template:
metadata:
labels:
app: gateway-app
@AAber
AAber / FreeSSLcertificate2JavaKeystore.sow.txt
Last active March 24, 2020 06:56
Create and add free letsencrypt certificate to any Java application keystore (Nexus 3.2.0 docker keystore)
## == Certificate for any setup for free (4 months) == ##
## 1. Open http and https from all the world to the host
## == For openvpn server == ##
# systemctl stop openvpnas.service
## 2. Become root and run let's encrypt docker tool
$ sudo -i
# export LETSENCRYPT_EMAIL=info@mydomain.com
# export DNSNAME=myhost.mydomain.com
@AAber
AAber / .bashrc
Last active June 21, 2017 12:58
.bashrc function to push git commit (instead of 5 commands use 1 command)
gpfunction() {
git status
echo [Enter to continue...]
read a
git pull
git commit -am"$1"
git push
LATEST_TAG_NUMBER=`git tag |sort -n|tail -1`
NEW_TAG_NUMBER=`echo $LATEST_TAG_NUMBER + 1|bc`
git tag $NEW_TAG_NUMBER
@AAber
AAber / disk_used_alert2slack
Created June 14, 2017 13:38
Script to monitor disk space and alert via slack when disk usage is > 80% Place the script in /etc/cron.hourly
#!/bin/bash
# Parse df selected output
df -h|egrep -v 'File|tmpfs|docker|udev'| \
while read LINE; do
USED_NUMBER=`echo $LINE |awk '{print $5}'|sed 's/\%//'|sed 's/ //g'`
USED_PERCENT=`echo $LINE |awk '{print $5}'|sed 's/ //g'`
MOUNT_POINT=`echo $LINE |awk '{print $6}'|sed 's/ //g'`
if [ $USED_NUMBER -gt 80 ]; then
# Create message without spaces