Skip to content

Instantly share code, notes, and snippets.

diff --git a/main.go b/main.go
index 4bc5c9a..54b5b3f 100644
--- a/main.go
+++ b/main.go
@@ -103,8 +103,8 @@ func main() {
usage()
},
}
- flag.StringVar(&dataDir, "datadir", dataDir, "data directory")
- flag.StringVar(&viewDir, "viewdir", viewDir, "view directory")
diff --git a/cli.go b/cli.go
new file mode 100644
index 0000000..b7ec8c9
--- /dev/null
+++ b/cli.go
@@ -0,0 +1,231 @@
+package main
+
+import (
+ "fmt"
@till
till / main.go
Created September 15, 2023 18:26
logrus hooks, and how they work
package main
import (
"fmt"
"io"
"os"
"github.com/sirupsen/logrus"
)
@till
till / Dockerfile
Created February 7, 2022 17:46
A static website with sveltekit
FROM node:17.0-alpine as build
ADD app /app
WORKDIR /app
RUN npm ci --fetch-timeout=600000
RUN npm run build
FROM nginx:stable
@till
till / test.sh
Created June 14, 2021 12:34
Creating a Docker volume?
$ curl -s -o /dev/null -w "%{http_code}" -X POST \
-d '{"Name":"till-test"}' \
-H 'Content-Type: application/json' http://localhost:2375/volumes/create
201
$ curl -s -o /dev/null -w "%{http_code}" -X POST \
-d '{"Name":"till-test"}' \
-H 'Content-Type: application/json' http://localhost:2375/volumes/create
201
@till
till / dashboard.json
Last active March 18, 2021 11:14
A Grafana dashboard to show aggregated metrics by Swarm Stack (powered by Cortex/Planetary Quantum)
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@till
till / curl
Created September 27, 2020 18:29
CURL and hostnames
core@node-001 ~ $ curl --unix-socket /var/run/docker.sock http:/plugins
{"message":"page not found"}
core@node-001 ~ $ curl -V
curl 7.66.0 (x86_64-cros-linux-gnu) libcurl/7.66.0 OpenSSL/1.1.1g zlib/1.2.11
Release-Date: 2019-09-11
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTPS-proxy IPv6 Kerberos Largefile libz NTLM SPNEGO SSL TLS-SRP UnixSockets
@till
till / ignition.json
Created May 27, 2020 17:28 — forked from thetechnick/ignition.json
Hetzner Cloud terraform coreos install
{
"ignition": {
"version": "2.0.0",
"config": {}
},
"storage": {
},
"systemd": {},
"networkd": {},
"passwd": {
@till
till / testinfra.py
Created November 10, 2019 12:35
Debuggable TestInfra
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
def get_docker_services(host):
@till
till / Dockerfile.molecule
Created November 10, 2019 12:32
Dockerfile for Molecule
FROM quay.io/ansible/molecule:2.22
RUN apk add --update build-base
RUN pip install --upgrade pip
RUN pip install dnspython requests==2.20.1 docker docker-compose hcloud molecule[hetznercloud]