This Web Components keeps the year in your copyright notice up-to-date.
export { CopyrightYearElement }
const name = "copyright-year";
class CopyrightYearElement extends HTMLSpanElement {
module:=$(shell go list -f '{{.Module}}' .) | |
source:=$(shell go list -f '{{join .GoFiles "\n"}}' $(module)) | |
embedded:=$(shell go list -f '{{join .EmbedFiles "\n"}}' $(module)) | |
build: $(module) | |
$(module): $(source) $(embedded) | |
go build -v $(module) |
This function creates a registration code with 8 ASCII characters. The aim is to send a user a secret, which can be easily copied by the user into a registration dialog. The secret uses a reduced alphabet of 32 letters and digits. Characters known to be commonly confused by users are removed. The secret is not a password. It is just a personal token to enable the registration in order to prevent annonymous registration attempts.
package main | |
import ( | |
dbg "runtime/debug" | |
fmt "fmt" | |
os "os" | |
tm "time" | |
) | |
func outer() { |
Suppose you have cloned https://github.com/CVEProject/cvelistV5
Find all CVE-IDs for which the assignerShortName
of the cveMetadata
is "Go":
find cves -type f -name 'CVE-*.json' -exec cat {} + |
jq -r '.cveMetadata | select(.assignerShortName == "Go") | .cveId'
#! /bin/bash | |
if [[ -e "$1" && ! -d "$1" ]]; then | |
jq -C . "$@" | |
else | |
jq -C "${@-.}" | |
fi | | |
less -R | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Bounce</title> | |
<style> | |
body { background: silver; } | |
canvas { background: white; } | |
span.sign { display: inline-block; white-space: pre; width: 1ch; text-align: center; } | |
span.number { display: inline-block; white-space: pre; } |
#! /bin/bash | |
set -eu | |
usage() { echo "Usage: $0 [-w WAIT] [PNGFILE]" 1>&2; } | |
while getopts "w:h" o; do | |
case "${o}" in | |
w) wait=$((OPTARG));; | |
h) usage; exit 0;; | |
*) exit 1;; |
The following produces a table with two columns: a date and a file name.
$ find /etc/network -type f -printf '%T@\t%p\n'
1670618223.0000000000 /etc/network/if-down.d/resolved
1689161114.2422386520 /etc/network/interfaces
1673911860.0000000000 /etc/network/if-up.d/ntpsec-ntpdate
1670618223.0000000000 /etc/network/if-up.d/resolved