Skip to content

Instantly share code, notes, and snippets.

@xddxdd
xddxdd / nginx-plain-proxy.patch
Created Jul 17, 2021
Patch for nginx to support plain (one-line request) protocol upstreams
View nginx-plain-proxy.patch
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index 64190f1..dbba290 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -283,6 +283,8 @@ static ngx_conf_post_t ngx_http_proxy_ssl_conf_command_post =
static ngx_conf_enum_t ngx_http_proxy_http_version[] = {
+ { ngx_string("plain"), NGX_HTTP_VERSION_PLAIN },
+ { ngx_string("0.9"), NGX_HTTP_VERSION_9 },
@xddxdd
xddxdd / lantian_whois.lua
Last active May 29, 2021
Lan Tian's nginx-based DN42 WHOIS server config
View lantian_whois.lua
local lantian_whois = {}
function lantian_whois.file_exists(subdir, target)
if target == nil then return false end
local f = io.open(ngx.var.document_root .. "/" .. subdir .. "/" .. string.gsub(target, "/", "_"), "rb")
if f == nil then return false end
f:close()
return true
end
@xddxdd
xddxdd / 0-hexo-gopher.txt
Last active Mar 24, 2021
Gophermaps generation code for Hexo
View 0-hexo-gopher.txt
Here's my code to generate Gophermaps for posts on a Hexo site.
I cannot guarantee this will work on your Hexo site. I had custom multilingual support on my site,
and manually removed all language related stuff from this code snippet. I did not test that the
code still functions after this modification.
Usage:
Put gopher.js into "scripts" folder of your theme, e.g. "themes/lantian/scripts/gopher.js".
@xddxdd
xddxdd / nginx-1.19.7-plain-protocol.patch
Last active May 10, 2021
Patch for nginx 1.19.7 to support plaintext protocol (like Gopher or Whois)
View nginx-1.19.7-plain-protocol.patch
diff --git a/auto/modules b/auto/modules
index f1c63f3d..516daaba 100644
--- a/auto/modules
+++ b/auto/modules
@@ -423,6 +423,18 @@ if [ $HTTP = YES ]; then
. auto/module
fi
+ if [ $HTTP_PLAIN = YES ]; then
+ have=NGX_HTTP_PLAIN . auto/have
@xddxdd
xddxdd / kitty.conf
Created Jan 16, 2021
Kitty font & color settings
View kitty.conf
font_family FiraCodeNerdFontComplete-Retina
bold_font FiraCodeNerdFontComplete-Bold
italic_font FiraCodeNerdFontComplete-Retina
bold_italic_font FiraCodeNerdFontComplete-Bold
font_features FiraCodeNerdFontComplete-Retina +ss03 +ss04 +ss05 +ss06 +ss07 +zero
font_features FiraCodeNerdFontComplete-Bold +ss03 +ss04 +ss05 +ss06 +ss07 +zero
background #212121
foreground #eeffff