Skip to content

Instantly share code, notes, and snippets.

View vitezfh's full-sized avatar

S. V. vitezfh

View GitHub Profile
@vitezfh
vitezfh / scdl
Last active January 26, 2024 13:30
run scdl from flyingrub in docker. Just add to path!
#!/bin/bash
# scdl runner that builds a whole container first
echo Running docker build first...
docker build --tag scdl - <<EOF
FROM alpine AS unzipper
WORKDIR /zip
RUN wget 'https://github.com/flyingrub/scdl/archive/refs/tags/v2.7.3.zip' && \
unzip 'v2.7.3.zip' && mv scdl-2.7.3 scdl
@vitezfh
vitezfh / list-manually-installed.sh
Created June 11, 2021 11:03
Lists Void Linux / voidlinux (xbps) packages that were manually installed (without trailing "-VERSION" suffix)
#! /bin/bash
while read -r package ; do
echo "${package%-*}"
done < <(xbps-query -lm)
@vitezfh
vitezfh / switch
Created March 11, 2021 12:03
USB Switch using usbip
#!/bin/bash
set -x
# This is a tool that emulates a usb switch by leveraging usbip
# The script is needed on two machines
# PC: 1 PC: 2
# ############### ##############
# # # -- ./switch --> # #
# # SERVER # # CLIENT #
#! /bin/bash
# Bash gumroad downloader based on a python script from user gatekeepr:
# https://gist.github.com/gatekeepr/97d6244dc074280b32f505443fbd7fe6
# Easily extendable with GNU Parallel! (if you have the download capacity :)
# TODO: Could use a fancy bar or download counter...
url="https://gumroad.com/d/a795646b9ddc4a496c6cab5e3fa179b5"
cookies_path="./cookies.txt"
download_path="./"
@vitezfh
vitezfh / scrape-ch
Last active January 26, 2024 13:31
scrape-ch is a simple command line tool for scraping media (webm, jpg, png) from a 4ch thread. Useful for fetching wallpapers
#! /bin/bash
directory="4ch_pictures"
directory_named=0
url=""
for arg in "$@"; do
if [ "$arg" == "--help" ] || [ "$arg" == "-h" ]; then
echo "Scrapes all media from a 4ch thread;
Usage:
@vitezfh
vitezfh / create-pi.sh
Last active March 6, 2024 20:22
Void Linux on the Raspberry Pi - SD-card install script for Headless use! Only tested on Zero W
#!/bin/bash
# This makes a readily bootable Voidlinux SD-Card for the raspberrypi
# Sets up some configs, making the Pi connect to wifi and sshd
#
# First boot up takes a very long time (5+ mins even) on a Zero W. Really give it time.
# For remedy on subsequent booting see:
# https://wiki.voidlinux.org/Raspberry_Pi#Enabling_hardware_RNG_device
# SD-Card:
device="/dev/mmcblk0"
#! /bin/bash
url="https://gumroad.com/d/7b65cbcb5004935ce63bdd4cdd22ccba"
button_links=$(curl -c ./cookies-gumroad-com.txt -b ./cookies-gumroad-com.txt $url -L -Ss | grep '"download_click" data-url="' | awk '{print $7}' | cut -d '"' -f2)
# Possible replacement: button_links=$(curl -c ./cookies-gumroad-com.txt -b ./cookies-gumroad-com.txt $url -L -Ss | grep -oP '(?<=download_click" data-url=").*?(?=")')
for link in $button_links; do
curl --limit-rate 4000k -C - "gumroad.com$link" -L -c ./cookies-gumroad-com.txt -b ./cookies-gumroad-com.txt \