Skip to content

Instantly share code, notes, and snippets.

@mekb-turtle
mekb-turtle / domains.txt
Last active January 5, 2022 05:57
~25k long list of malicious domains to block
li.nk
0rz.tw
1-url.net
126.am
short.ste
short.st
t.ly
tiny.cc
soo.gd
clicky.me
@mekb-turtle
mekb-turtle / README.md
Last active June 17, 2022 13:28
lfs initramfs init.in for rootwait
@mekb-turtle
mekb-turtle / tri.js
Last active July 11, 2022 13:15
Script to convert Blender .obj file to raw triangles - https://github.com/mekb-turtle/render
#!/usr/bin/env node
const fs = require("fs");
const file = fs.readFileSync(process.argv[2]).toString().split("\n").filter(e => !e.startsWith("#")).map(e => e.replace(/\s+/g, " "));
const scale = parseFloat(process.argv[3] || "1");
const color = process.argv[4] || "0xFFFFFF";
let vertices = [];
let faces = [];
const triangle = (arr) => {
if (arr.length < 3) return [ arr ];
let z = [];
@mekb-turtle
mekb-turtle / dhcpcd.conf
Created August 9, 2022 06:14
stop dhcpcd from overriding resolv.conf
#controlgroup wheel
#hostname
#clientid
duid
persistent
vendorclassid
#option domain_name_servers, domain_name, domain_search
option classless_static_routes
option interface_mtu
option host_name
@mekb-turtle
mekb-turtle / proxy.js
Created September 9, 2022 13:05
Simple Node.js proxy
#!/usr/bin/env node
const net = require("net");
const serverClientHost = "192.168.88.79"; // P->S
const serverClientPort = 22;
const proxyServerPort = 1337; // C->S
const proxyServer = new net.Server();
proxyServer.on("connection", (socket) => {
console.log("[C-P] new connection");
console.log(socket.address());
let serverClient = new net.Socket();
@mekb-turtle
mekb-turtle / liminetest.sh
Last active October 16, 2022 09:10
Test Limine configurations
#!/usr/bin/bash
DIR=/tmp/liminetest
ISO_DIR=$DIR/isoroot
ISO=$DIR/out.iso
LIMINE_CONFIG=limine.cfg
LIMINE_DIR=limine.d # for adding extra fonts and stuff
LIMINE_BIN_DIR=/usr/share/limine
mkdir -pv "$DIR/" "$ISO_DIR/" "$ISO_DIR/$LIMINE_DIR/" && \
cp -v "${1-/boot/$LIMINE_CONFIG}" "$ISO_DIR/$LIMINE_CONFIG" || exit "$?"
cp -vr "${2-/boot/$LIMINE_DIR}"/* "$ISO_DIR/$LIMINE_DIR/"
@mekb-turtle
mekb-turtle / archwiki.sh
Last active February 10, 2023 17:28
script to search locally downloaded ArchWiki pages using dmenu
#!/usr/bin/bash
HTML_CLIENT="librewolf"
AW="/usr/share/doc/arch-wiki/html/$(locale|grep "^LANG="|sed "s|^LANG=||;s|[_. :].*||")"
while true; do
if [[ -d "$AW" ]]; then
cd -- "$AW"
RES="$(printf "%s\n" Cancel * | dmenu -i)"
if [[ "$RES" == "Cancel" ]]; then exit; fi
AW="$AW/$RES"
else if [[ -f "$AW" ]]; then
@mekb-turtle
mekb-turtle / openrgb
Last active February 27, 2023 00:45
openrgb sdk server dinit service (replace /home/mekb/ with your home directory, and default_noram with your profile)
type = process
command = /usr/bin/openrgb --server --server-port 6742 -p default_noram --config /home/mekb/.config/OpenRGB/
smooth-recovery = true
logfile = /var/log/dinit/openrgb.log
waits-for = udev-settle
@mekb-turtle
mekb-turtle / pacman-apt
Last active March 13, 2023 08:24
Pacman-like front-end for apt
#!/usr/bin/bash
ROOT_PROGRAM=(sudo)
APT=(apt)
function pacman-run-apt(){
"${APT[@]}" "$@"
}
function pacman-run-apt-with-root(){
IFS=
if [[ "$(id -u)" == "0" ]]; then
"${APT[@]}" "$@"
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
</match>
<alias>
<family>serif</family>