Skip to content

Instantly share code, notes, and snippets.

View tie's full-sized avatar
🍔
The devil is in the detail.

Ivan Trubach tie

🍔
The devil is in the detail.
View GitHub Profile
@tie
tie / postgresql-run-as-root.patch
Created July 3, 2024 14:00
PostgreSQL patch to allow running as root user (e.g. in containers).
diff --git a/src/backend/main/main.c b/src/backend/main/main.c
index 51ffb8e773..c92d25c77b 100644
--- a/src/backend/main/main.c
+++ b/src/backend/main/main.c
@@ -49,7 +49,6 @@ static bool reached_main = false;
static void startup_hacks(const char *progname);
static void init_locale(const char *categoryname, int category, const char *locale);
static void help(const char *progname);
-static void check_root(const char *progname);
# Quote _replacement_ string for sed s command.
# See https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html
#
# Example:
# $ foo='/usr/bin/\&foo'
# $ echo "$foo"
# /usr/bin/\&foo
# echo "$(quoteSedReplacement foo)"
# \/usr\/bin\/\&foo
#
@tie
tie / TextReplacement.plugin.js
Last active February 9, 2023 09:11
BetterDiscord plugin that enables auto-correct (text replacements) for message text area
/**
* @name TextReplacement
* @author Ivan Trubach
* @authorId 783087994419675201
* @description Enable autocorrect for messages, specifically text replacements on macOS.
* @version 0.0.4
*/
const memoSymbol = Symbol.for("react.memo")
@tie
tie / crond
Created November 15, 2020 21:08
OpenWrt scheduled update and reboot
0 5 * * * opkg update && opkg list-upgradable | cut -d ' ' -f 0 | xargs -r opkg --autoremove upgrade -- && reboot
@tie
tie / bits.c
Last active December 20, 2019 06:53
All binary strings of length n containing exactly k ones.
/*
// Poor man’s C++ solution.
#include<algorithm>
#include<string>
#include<iostream>
int main() {
int n, k;
std::cin >> n >> k;
@tie
tie / tricks.md
Last active August 7, 2019 20:24
Not so obvious things

Linux things

Fix stupid Docker

Docker daemon messes up iptables configuration.

>/etc/docker/daemon.json cat <<EOF
{
	"iptables": false
@tie
tie / TTGL.svg
Created March 24, 2017 23:31
TOUCH THE UNTOUCHABLE
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.