Skip to content

Instantly share code, notes, and snippets.

sudo dnf update -y --refresh; sudo dnf install -y qemu-guest-agent tar; sudo systemctl disable --now firewalld; sudo dnf clean all; sudo systemctl reboot
sudo -i
curl -sfL https://get.rke2.io | INSTALL_RKE2_CHANNEL=v1.27 INSTALL_RKE2_TYPE=server sh -
cat <<EOF >> /etc/rancher/rke2/config.yaml
node-taint:
  - "CriticalAddonsOnly=true:NoExecute"
EOF
export PROXY_DOMAIN=
cat <<EOF >> /etc/sysconfig/rke2-server
@mundry
mundry / 0001-Introduce-access_log-variable-time_iso8601_ms.patch
Created January 24, 2022 21:01
Patch to add `$time_iso8601_ms` to nginx
From 697b506f5b23269f2ffadf29f5f93adcede094b1 Mon Sep 17 00:00:00 2001
From: mundry <mundry@users.noreply.github.com>
Date: Fri, 28 Oct 2016 20:36:30 +0200
Subject: [PATCH 1/1] Introduce access_log variable time_iso8601_ms.
A new variable $time_iso8601_ms has been introduced to the http and
stream log modules to log the request time in ISO 8601 format with
millisecond precision.
---
src/core/ngx_times.c | 16 +++++++++++++++-
@mundry
mundry / nginx_version.py
Created October 22, 2016 12:43
Script to append a git revision hash to the nginx server version.
#!/usr/bin/env python2.7
#-*- encoding: utf-8 -*-
# Usage:
# ./nginx_version.py /path/to/nginx/src/core/nginx.h <git hash>
# or:
# /path/to/nginx-codebase-root$ /path/to/nginx_version.py <git hash>
from os.path import abspath
from re import compile
@mundry
mundry / ngx_brotli-pkgconfig-auto-discovery.patch
Last active October 16, 2016 18:18
Patch to use pkg-config during ngx_brotli's auto-discovery. Requires pkg-config to be configured properly (e.g. through PKG_CONFIG_PATH) before nginx's configure script is executed.
--- a/config
+++ b/config
@@ -66,8 +66,8 @@ ngx_feature_test="BrotliEncoderCreateInstance(NULL, NULL, NULL)"
# auto-discovery
ngx_feature="Brotli library"
-ngx_feature_path=
-ngx_feature_libs="-lbrotlienc -lm"
+ngx_feature_path="$(pkg-config --cflags-only-I libbrotlienc | sed 's/-I//g')"
+ngx_feature_libs="$(pkg-config --libs libbrotlienc)"
@mundry
mundry / main.go
Last active March 21, 2016 21:59
Go example of generating subresource integrity hashes (https://www.srihash.org).
package main
import (
"crypto/sha256"
"crypto/sha512"
"encoding/base64"
"fmt"
"io/ioutil"
"log"
)
@mundry
mundry / expose_hphp.patch
Last active February 29, 2016 18:17
Patch to make HHVM's expose_hphp config setting more granular.
diff --git a/hphp/runtime/base/runtime-option.cpp b/hphp/runtime/base/runtime-option.cpp
index 3a3d25a..9903996 100644
--- a/hphp/runtime/base/runtime-option.cpp
+++ b/hphp/runtime/base/runtime-option.cpp
@@ -179,7 +179,7 @@ std::string RuntimeOption::ForceCompressionURL;
std::string RuntimeOption::ForceCompressionCookie;
std::string RuntimeOption::ForceCompressionParam;
bool RuntimeOption::EnableKeepAlive = true;
-bool RuntimeOption::ExposeHPHP = true;
+std::string RuntimeOption::ExposeHPHP = "full";
@mundry
mundry / libfiles.py
Last active October 11, 2016 17:30
Utility script to help find missing or obsolete source files listed in libbrotli's Makefile.am.
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# Utility script to help find missing or obsolete source files listed in
# libbrotli's Makefile.am.
#
# Usage:
# $ cd libbrotli
# $ ./libfiles.py
@mundry
mundry / README.markdown
Last active December 31, 2015 19:27
Self-signed SSL Certificate one-liner

Self-signed SSL Certificate one-liner

$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout domain.key -out domain.crt
  • openssl req - generate a certificate
  • -x509 - use x509 specification
  • -nodes - no DES, don't encrypt the private key
  • -days 365 - valid for 1 year
@mundry
mundry / README.markdown
Last active December 2, 2015 20:31
Web server maintenance configuration for Apache and Nginx.

Web Server Maintenance Configuration

Serves a file maintenance.html for every request while it is present. No need to restart the web server or alter its configuration to switch the site into maintenance mode.

Apache

@mundry
mundry / instructions.md
Last active April 8, 2018 17:23
Temporary installation of cgit with lighttpd for testing.

Install lighttpd in a temporary location.

curl -o {/tmp,http://download.lighttpd.net/lighttpd/releases-1.4.x}/lighttpd-1.4.45.tar.xz
tar xf /tmp/lighttpd-1.4.45.tar.xz -C /tmp
cd /tmp/lighttpd-1.4.45
./configure --prefix=/tmp/lighttpd
make -j8
make install