Skip to content

Instantly share code, notes, and snippets.

@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(-)
@ungeskriptet
ungeskriptet / AMB681AZ01.xml
Created March 15, 2024 15:58
S24U AMB681AZ01 panel XML file extracted from DisplayDxe
<?xml version="1.0" encoding="utf-8"?>
<PanelName>AMB681AZ01</PanelName>
<PanelDescription>LSI Single DSI Command Mode DSC Panel (1440x3120 24bpp)</PanelDescription>
<Group id="Active Timing">
<HorizontalActive units="Dot Clocks">1440</HorizontalActive>
<HorizontalFrontPorch units="Dot Clocks">28</HorizontalFrontPorch>
<HorizontalBackPorch units="Dot Clocks">28</HorizontalBackPorch>
<HorizontalSyncPulse units="Dot Clocks">28</HorizontalSyncPulse>
<HorizontalSyncSkew units="Dot Clocks">0</HorizontalSyncSkew>
<HorizontalLeftBorder units="Dot Clocks">0</HorizontalLeftBorder>
@ungeskriptet
ungeskriptet / command.txt
Created February 12, 2024 19:10
Dump regulators from Android with root
cd /sys/class/regulator; for i in $(ls); do cat $i/name; [ -f "$i/max_microvolts" ] && echo "$i/name" || echo "$i/name\n"; [ -f "$i/min_microvolts" ] && cat $i/min_microvolts && echo "$i/min_microvolts"; [ -f $i/max_microvolts ] && cat $i/max_microvolts && echo "$i/max_microvolts\n"; done