Skip to content

Instantly share code, notes, and snippets.

View 0xdeadbeer's full-sized avatar
🔬
Avoiding rapid decay into disorder and chaos

Kevin J. 0xdeadbeer

🔬
Avoiding rapid decay into disorder and chaos
View GitHub Profile
@0xdeadbeer
0xdeadbeer / wiener_rsa.py
Last active March 12, 2023 13:53
Wiener's attack on RSA - Python3
#!/usr/bin/python3
import contfrac
import math
"""
Generously coded by me and my friend in the middle of a chill Sunday
Resources:
- https://crypto.stanford.edu/~dabo/pubs/papers/RSA-survey.pdf
- https://en.wikipedia.org/wiki/Wiener%27s_attack
- https://en.wikipedia.org/wiki/RSA_(cryptosystem)
@0xdeadbeer
0xdeadbeer / new_backup_system.py
Last active April 29, 2024 20:58
Cronjob backup script
#!/usr/bin/python3
import os, os.path
import sys
import time
from datetime import datetime
def help():
print("Data reaper!")
print("Written by: @0xdeadbeer")
print(" - first_param: list containing file locations to backup")
@0xdeadbeer
0xdeadbeer / rclone-backup.py
Created April 16, 2023 14:16
Backup to Google Drive through rclone
#!/usr/bin/python3
import os, os.path
import sys
import time
from datetime import datetime
def help():
print("Data reaper!")
print("Written by: @0xdeadbeer")
print(" - first_param: list containing file locations to backup")
@0xdeadbeer
0xdeadbeer / vfs-mount.sh
Created April 26, 2023 16:08
Mount VirtioFS on Linux
#!/bin/sh
# scripted by: @0xdeadbeer
# parameters: ./vfs-mount.sh [mount_tag] [mount_path]
mount -t virtiofs $1 $2
@0xdeadbeer
0xdeadbeer / anki-english-vocabulary.sh
Created June 29, 2023 20:53
Simple and efficient way to add vocabulary to Anki through AnkiConnect (using dmenu for input)
#!/usr/bin/sh
# CONSTANTS
deck_name="deck name"
card_type_name="card type name"
anki_server="http://localhost:8765/"
front_part=$(dmenu -p "Word: " < /dev/null)
front_part_escaped=$(printf '%s\n' "$front_part" | sed 's/"/\\"/g')
# if either of them is empty, exit
@0xdeadbeer
0xdeadbeer / Makefile
Created November 12, 2023 11:37
Example Makefile
CC=gcc
CFLAGS=
LDFLAGS=
TARGET=project
SDIR=src
ODIR=build
SRC=$(shell find $(SDIR) -type f -name *.c)
OBJ=$(SRC:.c=.o)
@0xdeadbeer
0xdeadbeer / water.glsl
Created December 4, 2023 17:20
Water effect with GLSL
#version 300 es
precision highp float;
precision highp sampler2D;
in vec2 uv;
out vec4 out_color;
uniform vec2 u_resolution;
uniform float u_time;
@0xdeadbeer
0xdeadbeer / 300-japanese-words.csv
Created January 8, 2024 16:06
300 Anki exported + awk-ed CSV flashcards.
word reading pipe_separated_definitions
おに ogre | demon | onispirit of a deceased personogre-like person (i.e. fierce, relentless, merciless, etc.)it (in a game of tag, hide-and-seek, etc.)very | extremely | super-Oni
相打ち あいうち simultaneously striking one another (in kendo, etc.)draw | tie
矢印 やじるし arrow (symbol)(romantic) interest (for a certain person) | direction (of one's attention, etc.)
致命傷 ちめいしょう fatal wound
細胞 さいぼう cellcell (in an organization, esp. a communist party)
眼球 がんきゅう eyeball
報い むくい reward | recompense | returnpunishment | retribution
借金 しゃっきん debt | loan | liabilities | borrowing money
鍛錬 たんれん tempering (metal) | annealing | forgingtoughening | disciplining | training
@0xdeadbeer
0xdeadbeer / build.sh
Created January 21, 2024 11:24
Simple sh build script
#!/usr/bin/sh
CC=gcc
CFLAGS=
LDFLAGS=
SRC=./src
ODIR=./build
mkdir -p $ODIR
find $SRC -type f -name "*.c" | parallel -j 4 gcc $CFLAGS {} -o $ODIR/{/.} $LDFLAGS
@0xdeadbeer
0xdeadbeer / indexofes.tree
Created February 4, 2024 19:48
[FULL] Tree of index-of.es website snapshot (Feb 15/16 2022) - 0xdeadbeer
$ tree -d
.
├── Android
├── Art-Gallery
│   ├── A
│   │   ├── aachen
│   │   ├── aagaard
│   │   ├── abadia
│   │   ├── abaquesn