Skip to content

Instantly share code, notes, and snippets.

@mabitt
mabitt / README.md
Created January 14, 2022 17:22
Cheatsheet

Cheatsheet collection

@mabitt
mabitt / docker-compose.yml
Created July 26, 2019 18:03
docker-compose for OpenVPN-AS with PiHole and cloudflared proxy-dns (DNS over HTTPS)
version: "3.5"
services:
cloudflared:
container_name: cloudflared
image: visibilityspots/cloudflared:amd64
restart: unless-stopped
networks:
openvpn_net:
ipv4_address: 10.0.0.2
### Keybase proof
I hereby claim:
* I am mabitt on github.
* I am mabitt (https://keybase.io/mabitt) on keybase.
* I have a public key ASAP5ehMFisoLQL8qtjatofTVu06fOp8gAFktJNyNffLGwo
To claim this, I am signing this object:
#!/bin/bash
CREATED=$(docker ps -qa --no-trunc --filter "status=created")
if [ -n "$CREATED" ]; then
echo "Removing created conteiners - $HOSTNAME"
for ID in $CREATED ; do docker rm $ID ; done
fi
EXITED=$(docker ps -qa --no-trunc --filter "status=exited")
if [ -n "$EXITED" ]; then
@mabitt
mabitt / gist:90b4978434024af14698174921ab81c3
Last active October 3, 2024 16:06
RethinkDB on Docker Swarm
docker service rm rdb-primary rdb-secondary rdb-proxy
docker network rm rdb-net
sleep 5
docker network create --driver overlay rdb-net
sleep 2
docker service create \
--name rdb-primary \
--network rdb-net \
@mabitt
mabitt / gist:a3b6f030e57409bdd7266226e16419ac
Created September 21, 2017 16:19
Caddyserver ssl terminator conf
:80 {
redir 301 {
/ https://{host}{uri}
}
}
:443 {
gzip
proxy / backend:80 {
policy round_robin
@mabitt
mabitt / flow.sh
Last active September 5, 2017 18:29
Create AWS Stencils .desktop files for Calligra Flow
IFS=$'\n'
rm -rf GRAYSCALE
for D in `ls -1 -d -- */ `
do
echo "Creating $D/collection.desktop"
echo "[Desktop Entry]" > "$D/collection.desktop"
echo "Name=AWS_${D%?}" >> "$D/collection.desktop"
echo "Name[en_US]=AWS_${D%?}" >> "$D/collection.desktop"
done
@mabitt
mabitt / gist:96c774ed0ddfec6269fcb51b56906e02
Created April 12, 2017 02:15
Fleetctl restart (capistrano/bash)
fleetctl stop #{fetch(:application)}-#{fetch(:app_env)}.service
printf "waiting:> for %s to stop #{fetch(:application)}-#{fetch(:app_env)};"
is_running=1
while [ $is_running -ne 0 ]
do is_running=`fleetctl list-units | grep running | grep #{fetch(:application)}-#{fetch(:app_env)} | wc -l`
sleep 1
printf "."
done
echo ""
fleetctl start #{fetch(:application)}-#{fetch(:app_env)}.service