Skip to content

Instantly share code, notes, and snippets.

diff --git a/units/meson.build b/units/meson.build
index bfc107e..78d3897 100644
--- a/units/meson.build
+++ b/units/meson.build
@@ -3,4 +3,4 @@ systemd_netlogd_conf = configure_file(
output : 'systemd-netlogd.service',
configuration : substs)
install_data(systemd_netlogd_conf,
- install_dir : get_option('prefix') / 'system')
+ install_dir : get_option('sysconfdir') / 'system')
@xddxdd
xddxdd / default.nix
Created June 4, 2024 05:56
Nix pocl package
{
lib,
stdenv,
fetchFromGitHub,
nix-update-script,
cmake,
pkg-config,
hwloc,
llvmPackages_16,
lttng-ust,
#!/system/bin/sh
# Kill audioserver PID if it was initialized already
SERVERPID=$(pidof audioserver)
[ "$SERVERPID" ] && kill $SERVERPID
mount -o bind /vendor/etc/audio_effects.xml /odm/etc/audio_effects.xml
magiskpolicy --live 'allow audioserver audioserver_tmpfs file { read write execute }'
magiskpolicy --live 'allow audioserver system_file file { execmod }'
magiskpolicy --live 'allow mediaserver mediaserver_tmpfs file { read write execute }'
@xddxdd
xddxdd / 0001-setup.sh
Created July 30, 2022 18:52
All startup scripts executed by OpenVZ 7 in guest
#!/bin/bash
# Copyright (c) 2001-2017, Parallels International GmbH
# Copyright (c) 2017-2019 Virtuozzo International GmbH. All rights reserved.
#
# This file is part of OpenVZ libraries. OpenVZ is free software; you can
# redistribute it and/or modify it under the terms of the GNU Lesser General
# Public License as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@xddxdd
xddxdd / nginx-plain-proxy.patch
Created July 17, 2021 16:21
Patch for nginx to support plain (one-line request) protocol upstreams
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 10:00
Lan Tian's nginx-based DN42 WHOIS server config
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 March 24, 2021 15:46
Gophermaps generation code for Hexo
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 02:49
Patch for nginx 1.19.7 to support plaintext protocol (like Gopher or Whois)
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 January 16, 2021 13:49
Kitty font & color settings
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