Skip to content

Instantly share code, notes, and snippets.

View ristomatti's full-sized avatar

Ristomatti Airo ristomatti

  • Maya Consulting Oy
  • Helsinki, Finland
View GitHub Profile
@m-radzikowski
m-radzikowski / script-template.sh
Last active April 21, 2025 17:51
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@sakurai-youhei
sakurai-youhei / _etc_nginx_conf.d_default.conf
Last active May 23, 2021 11:17
Reverse-proxying blynk-server by Nginx with simple WAF
# empty
@kabili207
kabili207 / Rclone systemd service.md
Last active April 21, 2025 09:50
Rclone systemd user service

rclone systemd service

Preparation

This service will use the same remote name you specified when using rclone config create. If you haven't done that yet, do so now.

Next, create the mountpoint for your remote. The service uses the location ~/mnt/<remote> by default.

mkdir ~/mnt/dropbox
@MatthewVance
MatthewVance / Caddyfile
Last active March 6, 2025 16:33
Caddy config (Caddyfile) and systemd service to reverse proxy Restic REST server running via Rclone.
bind 192.168.1.106:8889
tls /etc/caddy/ssl/host_name-bundle.pem /etc/caddy/ssl/end_device-key.pem {
protocols tls1.2 tls1.3
}
# Reverse proxy to rclone restic rest service
proxy / localhost:8080 {
# health_check /
transparent
max_conns 1024
@RichardBronosky
RichardBronosky / README.MD
Last active April 14, 2025 15:49
cb - A leak-proof tee to the clipboard - Unify the copy and paste commands into one intelligent chainable command.

cb

A leak-proof tee to the clipboard

This script is modeled after tee (see [man tee][2]) and works on Linux, macOS, Cygwin, WSL/WSL2

It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable.

This project started as an answer to the StackOverflow question: [How can I copy the output of a command directly into my clipboard?][3]

@mihow
mihow / load_dotenv.sh
Last active April 22, 2025 02:18
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a