Skip to content

Instantly share code, notes, and snippets.

View fragtion's full-sized avatar

Dimitri Pappas fragtion

  • Johannesburg, South Africa
View GitHub Profile
@fragtion
fragtion / samsung-android-pack-repack.sh
Created January 11, 2022 21:10 — forked from nikiink/samsung-android-pack-repack.sh
Procedure to modify a product.img.lz4 used by Samsung Android phones with Android 10
ANDROID 10 SAMSUNG IMG PACK/REPACK - UBUNTU 18.10 COSMIC
[BOOTLOADER UNLOCKED IS REQUIRED - FIRST UNLOCK BOOTLOADER]
-----------------------------------------------------------
/etc/apt/sources.list
deb http://old-releases.ubuntu.com/ubuntu/ cosmic main universe restricted multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ cosmic main universe restricted multiverse
deb http://old-releases.ubuntu.com/ubuntu/ cosmic-security main universe restricted multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ cosmic-security main universe restricted multiverse
@fragtion
fragtion / upnphack.txt
Last active October 21, 2021 19:27
MikroTik RouterOS upnp hack
# RouterOS has a limitation where you can't run UPnP on the same interface for both internal and external (in order to DST-NAT from a LAN IP to another LAN IP on same interface/subnet)
# This hack lets you workaround this limitation
#
# In the following example, bridge1 has IP 192.168.0.2 and is the gateway for other some clients with uPnP needs
# The router's default gateway upstream, is another LAN device, eg 192.168.0.1
#
# How it works:
# 1. First we disable uPnP daemon
# 2. We define the intended internal uPnP interface as an external one for now
# 3. Enable uPnP
#Expand /tmp (if tmpfs)
mount -o remount,size=5G /tmp/
# Clone to multiple disks with progress
dd if=/dev/sda | pv -s $(blockdev --getsize64 /dev/sda) | tee >(dd of=/dev/sdb) | tee >(dd of=/dev/sdc) | dd of=/dev/sdd
# faster... and source can be image or device
pv /dev/sda | tee >(dd bs=64k of=/dev/sdb) >(dd bs=64k of=/dev/sdc) >(dd bs=64k of=/dev/sdd) | dd bs=64k of=/dev/sde
Let [tag] = any tag in upstream repo
git fetch upstream --tags
git push origin --tags
@fragtion
fragtion / stapi_mysql.txt
Last active August 29, 2019 09:28
sync low use mysql (myiasm) db's with syncthing api
###
# MySQL database replication (MyISAM only) using syncthing(+API)
# version 0.2
#
# You'll first want to set up syncthing folders for each /var/lib/mysql/x,y,z,.. mysql database you want to sync
# (and limit max conflicts per folder to 1 (or 0) to keep the db folders 'clean')
#
# Why? Does the job for my application; extremely easy multi-master deployment (slave too)
# Warning: at least 10 second 'margin of error' for potential data corruption ... use at own risk.
###