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 / setup-percona-server.sh
Created October 21, 2010 00:38
A small shell script to install percona-server (and -client).
#!/bin/sh
############################
# Author: Till Klampaeckel #
# License: New BSD License #
############################
version=$1
if [ "x$version" = "x" ]; then
echo "Usage: ./$0 5.0|5.1"
javascript:var%20e=document.createElement('script');e.setAttribute('language','javascript');e.setAttribute('src','http://bit.ly/bookmarklet/load.js');document.body.appendChild(e);void(0);
/var/log/traefik.log
{
compress
create 0640 root root
daily
delaycompress
missingok
notifempty
rotate 5
@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