This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is an example file, with example values. | |
#export RESTIC_PASSWORD=apassword | |
#export RESTIC_REPOSITORY=b2:bucket:path | |
#export B2_ACCOUNT_ID=12345 | |
#export B2_ACCOUNT_KEY=abcdefg | |
#restic_backup /etc | |
#restic_backup /root | |
#restic_backup /var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# My goal was two-fold: | |
# Avoid installing PHP for a single 12-line PHP file (only 5 actual LOC) | |
# Instead this utilises ngx_lua (and luaJIT) which avoids forking out and keeps the logic in-memory. | |
# Optimize where I could by moving static resources into the configuration/memory. | |
# The large download test files can also be moved into a ramdisk to eek out a bit more performance by reducing disk IO | |
# Serve the same speedtest from multiple domains using only relative URLs and traversing subdomains | |
# The idea is that speedtest.companyA.com can be served from the same server{} block as speedtest.companyB.com | |
# The index page has links to allow the user to force a connection over ipv4 or ipv6. A connection to /ipv4, for | |
# instance, will redirect the user to ipv4.speedtest.$X/ where $X is determined dynamically. Likewise for /ipv6, | |
# and there's /default to redirect to just speedtest.$X/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
=begin | |
Migrate TT-RSS data from MySQL to Postgres | |
Author: Bryce Chidester <bryce@cobryce.com> | |
Provided as-is, no warranty. Make backups! | |
This script may work in the reverse direction... but probably not. And seeing as | |
TT-RSS doesn't officially support any other database backend at this time, there's | |
really no point in migrating to or from any other database. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quick and dirty script to split a fluentd buffer chunk into "good" and "bad" buffers. | |
# Uses the validation logic from fluentd-buffer-check.rb (https://gist.github.com/brycied00d/70c53104d780835d2d48610b7a783c8c) | |
# Compatible with fluentd 1.9.0. (Much of the buffer/metadata code taken from fluentd source.) | |
# Copyright 2020 Bryce Chidester <bryce.chidester@calyptix.com> | |
require 'msgpack' | |
require 'time' | |
def flush_new_buffer(state, chunk_id, data, prefix = 'NEW_buffer', suffix = 'log') | |
path = "#{prefix}.#{state}#{chunk_id}.#{suffix}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Simple script to "validate" all records in a fluentd buffer | |
# Sometimes, something goes wonky in my environment and weird data ends up in the | |
# buffer file, and then causes certain output plugins to choke. Ideally, I can | |
# catch this earlier as a fluentd filter, but in the meantime I'm left with buffer | |
# files with lots of good data and bad data and I need a tool to confirm what that | |
# buffer contains. | |
# Version 2 of this script will write the good records to a "good file" for reinclusion | |
# back into fluentd, and a "bad file" recording the unprocessable entities. Additionally, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quick and dirty script to split a fluentd buffer chunk into smaller chunks. | |
# Compatible with fluentd 1.9.0. (Much of the buffer/metadata code taken from fluentd source.) | |
# Copyright 2020 Bryce Chidester <bryce.chidester@calyptix.com> | |
require 'msgpack' | |
require 'time' | |
NEW_CHUNK_SIZE = 100_000 | |
def flush_new_buffer(state, chunk_id, data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Quick and dirty script to print the contents of a fluentd buffer chunk | |
# Useful when investigating a "corrupt" chunk, typically containing malformed | |
# record data. Recrd data is printed to stdout; progress/information is printed | |
# to stderr. | |
# Compatible with fluentd 1.9.0. (Much of the buffer/metadata code taken from fluentd source.) | |
# Copyright 2020 Bryce Chidester <bryce.chidester@calyptix.com> | |
require 'msgpack' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This is a quick, simple script to download a profile backup from a Zeroshell | |
# instance. It has been tested with release 3.9.3 | |
# No warranty or guarantee of any kind is made, nor any support offered. | |
# Copyright Bryce Chidester <bryce@cobryce.com> | |
# Configuration: Replace <hostname>, <username>, and <password> as appropriate. | |
endpoint='https://<hostname>/cgi-bin/kerbynet' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Easy to use! | |
# awsetbg -u /path/to/multi-bg-set.sh -r /path/to/images | |
# Or, just call it by itself: /path/to/multi-bg-set.sh /path/to/some/image.ext | |
INPUT=$1 | |
if [ ! -f "$INPUT" ] | |
then | |
echo "Input file must exist!" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; ## listen for ipv4; this line is default and implied | |
listen [::]:80 default_server ipv6only=on; ## listen for ipv6 | |
server_name localhost; # A sane default, nobody cares | |
# The actual logic | |
set $this_host $host; | |
if ($host !~* "\.fqdn\.com$") { | |
#rewrite ^ https://$host.fqdn.com:8006$request_uri? permanent; | |
set $this_host "$host.fqdn.com"; | |
} |
NewerOlder