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
<?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>
@mekb-turtle
mekb-turtle / colorbars.sh
Last active April 17, 2023 04:24
bash script to show terminal colors
#!/usr/bin/bash
if [[ "$TERM" == "linux" ]]; then
printf "%s" $'\x1b[48;5;0;38;5;15m 0 \x1b[48;5;1;38;5;15m 1 \x1b[48;5;2;38;5;15m 2 \x1b[48;5;3;38;5;15m 3 \x1b[48;5;4;38;5;15m 4 \x1b[48;5;5;38;5;15m 5 \x1b[48;5;6;38;5;15m 6 \x1b[48;5;7;38;5;15m 7 \x1b[0m\n'
printf "%s" $'\x1b[48;5;0;38;5;15m 8 \x1b[48;5;1;38;5;15m 9 \x1b[48;5;2;38;5;15m10 \x1b[48;5;3;38;5;15m11 \x1b[48;5;4;38;5;15m12 \x1b[48;5;5;38;5;15m13 \x1b[48;5;6;38;5;15m14 \x1b[48;5;7;38;5;15m15 \x1b[0m\n'
else
printf "%s" $'\x1b[48;5;0;38;5;255m 0 \x1b[48;5;1;38;5;255m 1 \x1b[48;5;2;38;5;255m 2 \x1b[48;5;3;38;5;255m 3 \x1b[48;5;4;38;5;255m 4 \x1b[48;5;5;38;5;255m 5 \x1b[48;5;6;38;5;255m 6 \x1b[48;5;7;38;5;16m 7 \x1b[0m\n'
printf "%s" $'\x1b[48;5;8;38;5;255m 8 \x1b[48;5;9;38;5;16m 9 \x1b[48;5;10;38;5;16m10 \x1b[48;5;11;38;5;16m11 \x1b[48;5;12;38;5;16m12 \x1b[48;5;13;38;5;16m13 \x1b[48;5;14;38;5;16m14 \x1b[48;5;15;38;5;16m15 \x1b[0m\n'
printf "%s" $'\n'
for m in {0..5}; do
for l in {0..5}; do
@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 / 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 / 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 / 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 / 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[@]}" "$@"