Skip to content

Instantly share code, notes, and snippets.

@ungeskriptet
ungeskriptet / ia-check.py
Last active November 21, 2024 07:09
Python script to skip already uploaded files in an item on archive.org
#!/usr/bin/python
from internetarchive import upload
from random import randint
from requests import get
import hashlib
import sys
def info(text): print(f"\033[94mINFO: \033[00m{text}")
def warning(text): print(f"\033[93mWARNING: \033[00m{text}")
@ungeskriptet
ungeskriptet / termux-url-opener
Created November 20, 2024 08:45
My personal termux-url-opener script
#!/data/data/com.termux/files/usr/bin/bash
function init() {
yes | pkg update
pkg upgrade -y
pkg install -y ffmpeg jq python-pip termux-api which vim
pip install yt-dlp
while [ ! -d "/data/data/com.termux/files/home/storage/pictures" ]; do
echo "Waiting for permissions to be granted"
termux-setup-storage
@ungeskriptet
ungeskriptet / cidr-to-ipv4.py
Created October 9, 2024 10:24
Python CIDR to IPv4 address converter
#!/usr/bin/python
import sys
cidr = sys.argv[1:][0]
octetts = ["0"] * 32
ip_dec = []
for i in range(int(cidr)):
octetts[i] = "1"
#!/bin/bash
AUDIO=AUDIO.LA.9.0.r1-07400-lanai.0
CAMERA=CAMERA.LA.4.0.r2-07000-lanai.0
CV=CV.LA.2.0.r1-04800-lanai.0
DISPLAY=DISPLAY.LA.4.0.r2-07600-lanai.0
GRAPHICS=GRAPHICS.LA.14.0.r1-07700-lanai.0
VENDOR=LA.VENDOR.14.3.0.r1-17300-lanai.QSSI15.0
VIDEO=VIDEO.LA.4.0.r2-06100-lanai.0
@ungeskriptet
ungeskriptet / samfirm.py
Last active October 8, 2024 06:33
Samsung firmware downloader (warning! code quality isn't very good!)
#!/usr/bin/python -u
# Based on:
# https://github.com/DavidArsene/samfirm.js
# https://github.com/martinetd/samloader
# https://github.com/ysfchn/easyfirmware
from Cryptodome.Cipher import AES
from Cryptodome.Util.Padding import pad
from Cryptodome.Util.Padding import unpad
import base64
import hashlib
@ungeskriptet
ungeskriptet / README.md
Created August 17, 2024 13:13
WireGuard configs to bypass CGNAT

WireGuard configs to bypass CGNAT

This set of files will help you to connect to a network behind carrier-grade NAT using WireGuard. You'll be able to access the LAN of the WireGuard peer behind the CGNAT and route your entire internet traffic to it.

Setup

  • wireguard-hub.conf: This config is intended for the WireGuard peer that has access to a public IP address, e.g. VPS
  • openwrt.conf: This config is intended for the WireGuard peer behind the CGNAT, e.g. OpenWrt router or Raspberry Pi
  • client.conf: This config is inteded for a WireGuard peer that wants to access the LAN of the device behind the CGNAT and route its entire internet traffic to it, e.g. computer or mobile phone

Generating keys

#!/data/data/com.termux/files/usr/bin/bash
# Convert videos or GIFs into Telegram sticker compatible webm files
rm -rf $HOME/storage/downloads/output.webm
ffmpeg -y -i $1 -r 30 -t 2.99 -an -c:v libvpx-vp9 -pix_fmt yuva420p -vf 'scale=512:512:force_original_aspect_ratio=decrease' -b:v 400K $HOME/storage/downloads/output.webm
@ungeskriptet
ungeskriptet / archinstall.md
Last active November 13, 2024 12:10
My personal Arch Linux installation guide for an UEFI install UKI and optionally secure boot (archinstall.md)

David's personal Arch Linux installation guide

Note

This guide is meant for my personal use. If you're installing Arch Linux for the first time, please follow the official installation guide instead.

1. Flashing the ISO

  1. Download the latest ISO file from https://ftp.halifax.rwth-aachen.de/archlinux/iso/latest/archlinux-x86_64.iso
    • $ curl https://ftp.halifax.rwth-aachen.de/archlinux/iso/latest/archlinux-x86_64.iso -O
  2. Flash the ISO
    • $ cat archlinux-x86_64.iso | sudo tee /dev/sdX > /dev/null
  3. Verify the flashed image on the USB drive (optional)
@ungeskriptet
ungeskriptet / APKBUILD
Created April 1, 2024 07:01
Zmod Simply Love ITGmania theme APKBUILD for Alpine Linux
# Maintainer: David Wronek <[email protected]>
pkgname=itgmania-theme-zmod-simplylove
pkgver=0_git20240331
pkgrel=0
arch="noarch"
url="https://github.com/zarzob/Simply-Love-SM5"
pkgdesc="Zmod fork of Simply Love for ITGmania with BoogieStats integration"
license="GPL-3.0"
depends="itgmania"
_commit="108e06ec2f48023ad8e4b185e866fc3eb723a98c"
@ungeskriptet
ungeskriptet / 0001-Remove-__assert_fail-declaration.patch
Last active June 6, 2024 16:39
ITGmania APKBUILD for Alpine Linux
From 118daae7b4c50ec95f0a713521c2dec57993252c Mon Sep 17 00:00:00 2001
From: David Wronek <[email protected]>
Date: Sat, 30 Mar 2024 19:51:00 +0100
Subject: [PATCH 1/3] Remove __assert_fail declaration
This functions causes errors when building on Alpine Linux.
---
src/archutils/Unix/AssertionHandler.cpp | 22 ----------------------
1 file changed, 22 deletions(-)