Skip to content

Instantly share code, notes, and snippets.

View LevitatingBusinessMan's full-sized avatar
🕴️
Ricing my polybar...

Rein Fernhout LevitatingBusinessMan

🕴️
Ricing my polybar...
View GitHub Profile
@LevitatingBusinessMan
LevitatingBusinessMan / wrap.fish
Created April 9, 2024 01:48
like rlwrap but in 10 lines of fish
#!/usr/bin/env fish
while true
read -P "" input
if test $status -ne 0
break
end
echo $input
end | $argv
@LevitatingBusinessMan
LevitatingBusinessMan / recipient_email.js
Last active March 23, 2024 01:39
Userscript to ensure that a recipients email address is shown when composing in roundcube
// ==UserScript==
// @name RecipientEmailFixerRoundcube
// @version 1
// @grant none
// ==/UserScript==
function on_mutation() {
document.querySelectorAll("body.action-compose li.recipient").forEach(recipient => {
if (!recipient.fixed) {
const [name, email] = recipient.children
#!/usr/bin/env fish
set packages (paclist core | cut -f1 -d' ')
set --erase IFS
set parallel 10
set mirror 'http:\/\/ftp.snt.utwente.nl\/pub\/os\/linux\/archlinux\/$repo\/os\/$arch'
# setup the config
set config (cat pacman.conf | sed \
-e "s/Include = \/etc\/pacman.d\/mirrorlist/Server = $mirror/" \
-e "s/\#ParallelDownloads = 5/ParallelDownloads = $parallel/"
@LevitatingBusinessMan
LevitatingBusinessMan / coroutine.c
Last active February 28, 2024 08:49
A totally sane implementation of a coroutine in C
#include <stdio.h>
#define COROUTINE static long ip = 0; if (ip) asm ("jmp *%0" : : "r" (ip + 7));
#define YIELD_32(i) asm volatile("movl %1, %%eax \n pop %%rbp \n call 1f\n 1: pop %0 \n ret" : "=m" (ip) : "r" (i));
int fibonacci() {
COROUTINE
YIELD_32(0);
YIELD_32(1);
YIELD_32(1);
@LevitatingBusinessMan
LevitatingBusinessMan / gef_prompt.patch
Created February 22, 2022 18:46
Fixes the prompt from gef when using TUI.
--- /tmp/gef.py.bckp 2022-02-22 19:37:04.589652454 +0100
+++ /bedrock/strata/arch/usr/share/gef/gef.py 2022-02-22 19:42:11.126081267 +0100
@@ -151,7 +151,8 @@
CROSS = "\u2718 "
TICK = "\u2713 "
BP_GLYPH = "\u25cf"
-GEF_PROMPT = "gef\u27a4 "
+#GEF_PROMPT = "gef\u27a4 "
+GEF_PROMPT = "gef> "
GEF_PROMPT_ON = f"\001\033[1;32m\002{GEF_PROMPT}\001\033[0m\002"
@LevitatingBusinessMan
LevitatingBusinessMan / tunnel.fish
Last active November 8, 2023 01:25
Reconfigure running wireguard interface to be used as a tunnel
#!/bin/fish
# Tunnel a wireguard interface
set dev $argv[1]
set peer $argv[2]
if test -z $dev
echo "No device specified"
exit
end
#tmux at -t irssi || tmux new -s irssi irssi
# Starting is handled by tmux@irssi.service
tmux at -t irssi
@LevitatingBusinessMan
LevitatingBusinessMan / wallpapercycle.sh
Created October 23, 2023 21:12
Cycle through wallpapers
#!/bin/sh
file=`ls -dt ~/wallpapercycle/* | tail -n1`
touch $file
echo $file
feh --bg-tile $file
@LevitatingBusinessMan
LevitatingBusinessMan / hide.c
Last active October 11, 2023 12:50
LD_PRELOAD rootkit for hiding or redirecting files
#define _GNU_SOURCE
#include <dlfcn.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
int new_fds[50][2] = {{0,0}};
@LevitatingBusinessMan
LevitatingBusinessMan / subdomains.fish
Last active October 6, 2023 11:52
Bruteforce subdomains
#!/usr/bin/env fish
argparse n/nameserver= d/domain= w/wordlist= o/output= -- $argv
or exit
if test -z $_flag_n; or test -z $_flag_d; or test -z $_flag_w
echo "Required arguments: nameserver, domain, wordlist"
echo "You can find the nameserver with nslookup and querytype=soa"
exit
end