Skip to content

Instantly share code, notes, and snippets.

Asher Aber AAber

Block or report user

Report or block AAber

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AAber
AAber / Node-Gateway-DaemonSet.yaml
Last active Sep 13, 2018
Expose a node application running in a Kubernetes DaemonSet by running a socat DaemonSet
View Node-Gateway-DaemonSet.yaml
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 Oct 15, 2017
Create and add free letsencrypt certificate to any Java application keystore (Nexus 3.2.0 docker keystore)
View FreeSSLcertificate2JavaKeystore.sow.txt
## == 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 Jun 21, 2017
.bashrc function to push git commit (instead of 5 commands use 1 command)
View .bashrc
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 Jun 14, 2017
Script to monitor disk space and alert via slack when disk usage is > 80% Place the script in /etc/cron.hourly
View disk_used_alert2slack
#!/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
You can’t perform that action at this time.