cat <<'EOF' > '/etc/systemd/system/[email protected]'
[Unit]
Description=%i service with docker compose
Requires=docker.service
After=docker.service
[Service]
Restart=always
WorkingDirectory=/etc/docker/compose/%i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"bytes" | |
"flag" | |
"fmt" | |
"os" | |
"regexp" | |
"strconv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set +xv -eo pipefail; | |
MODULE="${1:-$(id -nu)}"; | |
LOGFILE="${2:-$(date +%Y-%b-%d_%H%M%S)}"; | |
LOGDIR=${LOGDIR:-~/.log}; | |
mkdir -vp "${LOGDIR}"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ "$DEVNAME" = "sda3" ]; then | |
if [ "$ACTION" = "add" ]; then | |
/usr/sbin/cryptsetup luksOpen "/dev/$DEVNAME" "$DEVNAME" --key-file "/root/$DEVNAME.key" | |
/usr/bin/mount "/dev/mapper/$DEVNAME" "/mnt/$DEVNAME" | |
elif [ "$ACTION" = "remove"]; then | |
/usr/bin/umount -r "/mnt/$DEVNAME" | |
/usr/sbin/cryptsetup luksClose "$DEVNAME" | |
fi | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
EMAIL="[email protected]"; | |
APIKEY="xyz"; # https://dash.cloudflare.com/<account_id>/profile/api-tokens | |
ZONE="abc"; # https://dash.cloudflare.com/<account_id>/<zone> | |
RECORDID=$(curl -fso- -H "Authorization: Bearer ${APIKEY}" -H "Content-Type: application/json" "https://api.cloudflare.com/client/v4/zones/${ZONE}/dns_records?name=${1}" | jq -crM '.result[].id'); | |
curl -fso- \ | |
-H "Authorization: Bearer ${APIKEY}" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -xeo pipefail; | |
IMAGE_SIZE=2000M | |
BOOT_SIZE=256M | |
IMAGE_ARCH=arm64 | |
while getopts "s:" option; do | |
case $option in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nexus166/gobld:ubuntu-cgo | |
SHELL ["/bin/bash", "-evxo", "pipefail", "-c"] | |
RUN export DEBIAN_FRONTEND=noninteractive; \ | |
apt-get update; \ | |
apt-get dist-upgrade -y; \ | |
apt-get install -y --no-install-recommends \ | |
gawk binutils bsdmainutils build-essential file git libncurses5-dev perl python3-distutils rsync unzip wget; \ | |
rm -fr /var/lib/apt/cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <unistd.h> | |
#include <sys/syscall.h> | |
#include <sys/types.h> | |
#include <sys/utsname.h> | |
#include <stdio.h> | |
#include <string.h> | |
int uname(struct utsname *buf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
until [[ -z "$(find ${1:-.} -name '* *')" ]]; do | |
find ${1:-.} -name "* *" -type d -print0 | while read -d '' f; do | |
mv -fv "$f" "${f// /_}"; | |
done; | |
find ${1:-.} -name "* *" -type f -print0 | while read -d '' f; do | |
mv -fv "$f" "${f// /_}"; | |
done; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nexus166/gobld:ubuntu-cgo | |
SHELL ["/bin/bash", "-evxo", "pipefail", "-c"] | |
RUN export DEBIAN_FRONTEND=noninteractive; \ | |
apt-get update; \ | |
apt-get dist-upgrade -y; \ | |
apt-get install -y --no-install-recommends \ | |
gawk binutils bsdmainutils build-essential file git libncurses5-dev perl python rsync unzip wget; \ | |
rm -fr /var/lib/apt/cache |