Skip to content

Instantly share code, notes, and snippets.

View CardealRusso's full-sized avatar
🎯
Focusing

Cardeal Russo CardealRusso

🎯
Focusing
View GitHub Profile
@CardealRusso
CardealRusso / fakepng.sh
Created November 29, 2023 16:24
Create a png with a false thumbnail
#!/bin/sh
# Create a png with a false thumbnail;
# looks different when you view it full res.
high="$1" # High image (full-size original view)
low="$2" # Low image (thumbnail) (should be the same size)
output="output.png"
[ ! -z "$3" ] && output="$3" # Output image
@CardealRusso
CardealRusso / 4chandl.sh
Created September 28, 2023 21:54
simple 4chan webm downloader
url_parts=$(echo "$1" | sed 's/.*\/\([^/]*\)\/thread\/\([0-9]*\)\/.*/\1 \2/')
board=$(echo "$url_parts" | cut -d ' ' -f 1)
thread=$(echo "$url_parts" | cut -d ' ' -f 2)
curl -s "https://a.4cdn.org/$board/thread/$thread.json" | jq -r '.posts[] | select(.ext==".webm") | "https://is2.4chan.org/'"$board"'/\(.tim).webm"' | xargs -n 1 -P 5 curl -O
@CardealRusso
CardealRusso / tk2dl.sh
Last active September 20, 2023 15:24
tk2dl mass downloader/watcher
clear
printf "\e]2;TK2DL Farmer\a"
[ ! -d "tk2dl_farm" ] && mkdir "tk2dl_farm"
while :; do
values=$(curl -s https://tk2dl.com/t/recent.html | grep -o 'value="[^"]*"' | cut -d'"' -f2)
for x in $values; do
if ls -1 tk2dl_farm/*.mp4 | awk '{ print $2 }' | grep $x >/dev/null; then continue; fi
du -ah tk2dl_farm | awk 'END {printf "%d - %s\r", NR-1, $1}'
response=$(curl -s -X POST -d "x=$x" -H "Referer: https://tk2dl.com/t/recent.html" https://tk2dl.com/t/playtw.html)
@CardealRusso
CardealRusso / patchelf_bulk.sh
Last active August 22, 2023 10:40
recursive patchelf
find . -type f -exec sh -c 'ldd "$1" | grep -q "/lib64/" && echo "$1 atualizado" && patchelf --set-interpreter /lib/ld-linux-x86-64.so.2 "$1"' sh {} \; 2>/dev/null
@CardealRusso
CardealRusso / basic_anim.c
Last active March 2, 2024 13:25 — forked from AlecsFerra/animated_wallpaper.c
basic animated wallpapers in Xorg https://youtu.be/guchbe-gKis?t=257
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <X11/Xlib.h>
#include <Imlib2.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
if (argc < 4 || argc > 5) {
fprintf(stderr, "Usage: %s <image_folder> <frame_delay> <screen_number> [loop]\n", argv[0]);
@CardealRusso
CardealRusso / FindAdDup.js
Last active February 24, 2023 12:01
Find adjacent duplicates in js (for basic flood protection)
const test = "imbecile kkk imbecile kkk imebicle kkk";
const results = {};
for (let i = 0; i < test.length; i++) {
for (let j = i + 1; j <= test.length; j++) {
const sequence = test.slice(i, j);
if (sequence === test.slice(j, j + sequence.length)) {
if (sequence in results) {
results[sequence]++;
} else {
results[sequence] = 1;