Define the GIST url and pipe some script to bash/sh
GIST=https://gist.githubusercontent.com/marcbachmann/16574ba8c614bb3b78614a351f324b86/raw/a7e17acc57938a047c093f560858e3b0a8e2c741
curl -s $GIST/script-name | bash
const OriginalDate = global.Date | |
function restoreFakeDate () { | |
global.Date = OriginalDate | |
} | |
function useFakeDate (date) { | |
date = new OriginalDate(date) | |
class Date extends OriginalDate { | |
constructor (...args) { |
-- zaddhset sortedsetkey score hsetkey fieldname fieldvalue [fieldname fieldvalue ...] | |
-- sortedsetkey = KEYS[1] | |
-- score = KEYS[2] | |
-- hsetkey = KEYS[3] | |
-- fields = ARGV | |
if #KEYS ~= 3 or #ARGV < 2 or #ARGV % 2 ~= 0 then | |
return {err="ERR wrong number of arguments for 'zaddhset' command"} | |
end | |
if redis.call('EXISTS', KEYS[3]) == 1 then return nil end |
#!/bin/bash | |
set -e | |
USERNAME=$1 | |
if ! grep -qE '^[a-zA-Z0-9.@\-\+_]{2,100}$' <<< "$USERNAME"; then | |
1>&2 echo -e "❌ Username is missing or contains invalid characters | |
Usage: ./kubernetes-create-user.sh [email protected] | |
Will create a certificate using subject '/[email protected]' | |
and write the credentials into the '[email protected]' file." |
-- ISC LICENSE | |
-- | |
-- Copyright (c) 2021, Marc Bachmann <[email protected]> | |
-- Permission to use, copy, modify, and/or distribute this software for any | |
-- purpose with or without fee is hereby granted, provided that the above | |
-- copyright notice and this permission notice appear in all copies. | |
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
const response = await fetch(`http://localhost:8080/stream`, { | |
method: 'get', | |
headers: { | |
Authorization: `Bearer SomeToken` | |
} | |
}) | |
for await (const value of ndJsonIterator(response.body)) { | |
console.log(value) | |
} |
{ "log-driver": "journald", "log-opts": {"tag": "{{.Name}}/{{.ID}}"}} |
FROM multiarch/alpine:x86_64-v3.6 as syslog-ng | |
ENV VERSION=3.12.1 | |
RUN apk --no-cache add ca-certificates glib pcre eventlog libressl json-c && \ | |
apk add --no-cache --virtual .build-deps alpine-sdk wget build-base glib-static glib-dev eventlog-dev pcre-dev libressl-dev python2-dev json-c-dev && \ | |
wget -O "/tmp/syslog-ng-$VERSION.tar.gz" "https://github.com/balabit/syslog-ng/releases/download/syslog-ng-$VERSION/syslog-ng-$VERSION.tar.gz" && \ | |
cd /tmp && \ | |
tar zxfv "syslog-ng-$VERSION.tar.gz" && \ | |
cd "syslog-ng-$VERSION" |
@version: 3.12 | |
options { | |
chain_hostnames(0); | |
time_reopen(10); | |
time_reap(360); | |
log_fifo_size(2048); | |
create_dirs(yes); | |
group(adm); | |
perm(0640); |
[SERVICE] | |
Flush 5 | |
Daemon Off | |
Log_Level info | |
Parsers_File /etc/fluent-bit/parsers.conf | |
[INPUT] | |
Name Tail | |
Path /mnt/data/docker/containers/*/*.log | |
Path_Key file |