Skip to content

Instantly share code, notes, and snippets.

View tsopokis's full-sized avatar

Yannis Tsopokis tsopokis

View GitHub Profile
tsopokis /
Last active March 10, 2023 14:00 — forked from mosquito/
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/bin, you should use paths specific for your environment.

Description=%i service with docker compose
tsopokis /
Created November 10, 2022 20:06 — forked from troyfontaine/
Ubiquiti USG config.gateway.json Syntax

Ubiquiti USG Advanced Configuration


Integrated DNS Overview

When using a USG with Ubiquiti's Unifi Controller software (version 5.6 and earlier), the functionality of integrating the hostnames of clients (when they request a DHCP lease) into local DNS does not appear to work as you would find with Consumer grade routers. To work around this limitation, we can add static host mappings to a configuration file that will be provisioned to the USG when either a configuration change is made or we force provisioning to the USG itself.

Non-GUI Supported Dynamic DNS Providers

I've added in the necessary syntax for adding Cloudflare DDNS to the USG for VPN/Services setup courtesy of this post by britannic on the Ubiquiti Forums.

Configuration File

tsopokis /
Created August 29, 2018 10:33
Bash Script PID file locking with extra care trying to avoid simultaneous runs using a random backoff
#!/bin/bash -
set -e
scriptname=$(basename $0)
if [ -d /var/run ] && [ -w /var/run ]; then
if [ -f $pidfile ]; then
pid=$(cat $pidfile)