Skip to content

Instantly share code, notes, and snippets.

@agp8x
agp8x / backup.sh
Created October 14, 2020 10:19
local backup with restic
#!/bin/bash
tags=""
while getopts t: opt; do
case $opt in
t) echo $OPTARG;tags="${tags} --tag ${OPTARG}";;
esac
done
while read name path; do
echo "## ${name}";
{{$services := dict}}
{{$www := dict "rule" "Host(`www.foobar.de`) && PathPrefix(`/files`)" "url" "https://frontend.intern.foobar.de"}}
{{$_ := set $services "www" $www}}
{{$git := dict "rule" "Host(`git.foobar.de`)" "url" "https://service3.intern.foobar.de"}}
{{$_ := set $services "git" $git}}
{{range $name, $conf := $services}}
#[http.routers.{{$name}}_tls]
# rule = "{{$conf.rule}}"
@agp8x
agp8x / 01.py
Last active December 17, 2018 21:17
aoc08
# V1
class Node:
nodes = []
def __init__(self, numbers):
#print(numbers)
if not numbers:
self.num_childs=0
self.num_meta=0
self.metadata=[]
self.children=[]
version: '3'
services:
traefik:
image: traefik:1.6
command: --api --docker --docker.exposedbydefault=false
volumes:
- ./traefik.toml:/traefik.toml
- ./acme.json:/acme.json
- /var/run/docker.sock:/var/run/docker.sock
heads = ['']
data = []
head_a = False
data_a = False
new_data = None
with open("data.yaml") as src:
for line in src:
if (not head_a) and (not data_a):
if "head" in line:
head_a=True
import requests
from datetime import datetime
import argparse
import json
TAGS = "https://registry.hub.docker.com/v2/repositories/{image}/tags/"
LIB_PREFIX = "library/"
TAG_STORE = {}
@agp8x
agp8x / Readme.rst
Last active September 20, 2017 06:34

Usage

  1. create a postgres.env file:
    • user and db are optional
      • user defaults to postgres
      • db defaults to <user>

    POSTGRES_USER=<user> POSTGRES_PASSWORD=<secret>

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
for t in iot webops-perf design programming web-platform data;do mkdir $t;for i in `curl -s http://www.oreilly.com/$t/free/|grep 'csp'|cut -d'"' -f2|cut -d? -f1`;do for l in `curl -s $i'?download=yes&order=42'|grep data-src|cut -d'"' -f2`;do wget $l -P $t;done;done;done;
for t in iot webops-perf design programming web-platform data;do mkdir $t;for i in $(curl -s http://www.oreilly.com/$t/free/|grep 'csp'|cut -d'"' -f2|cut -d? -f1);do for l in $(curl -s $i'?download=yes&order=42'|grep data-src|cut -d'"' -f2);do wget $l -P $t;done;done;done;
#for t in iot webops-perf design programming web-platform data;do mkdir $t;for i in `curl -s http://www.oreilly.com/$t/free/|grep 'csp'|cut -d'"' -f2|cut -d? -f1`;do for l in `curl -s $i'?download=yes&order=42'|grep data-src|grep pdf|cut -d'"' -f2`;do wget $l -P $t;done;done;done;