Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am juris on github.
  • I am jurisp ( on keybase.
  • I have a public key ASCN7LsJI-gkDy7KG94WxRa0tEGGF8pdyFw6rKrh2Z38oQo

To claim this, I am signing this object:

juris /
Last active Mar 12, 2021
OpenVPN scripts for per client iptables configuration

Every time a new client connects to OpenVPN server, script creates set of individual iptables rules based on client common name and content of ccd files. When client disconnects from OpenVPN server, removes these individual rules. can be used to launch OpenVPN in docker contaner.

This should be a part of openvpn.conf file for scripts to work

# Client configuration
script-security 2
client-config-dir  /etc/openvpn/ccd
juris /
Last active Mar 29, 2021
Redis Cluster backup script
readonly cluster_topology=$(redis-cli -h redis-cluster cluster nodes)
readonly slaves=$(echo "${cluster_topology}" | grep slave | cut -d' ' -f2,4 | tr ' ' ',')
readonly backup_dir="/opt/redis-backup"
mkdir -p ${backup_dir}
for slave in ${slaves}; do
master_id=$(echo "${slave}" | cut -d',' -f2)
juris /
Created Sep 13, 2017
bash spinner function
# Simple spinner function to show rotating stick
# while process is doing something useful
spinner() {
local pid=$!
local spin='-\|/'
while kill -0 $pid 2>/dev/null
i=$(( (i+1) %4 ))
printf "\r${spin:$i:1}"