Skip to content

Instantly share code, notes, and snippets.

View ChronoMonochrome's full-sized avatar

Victor Shilin ChronoMonochrome

  • Russian Federation, Stavropol
View GitHub Profile
@ChronoMonochrome
ChronoMonochrome / .gitignore
Last active October 20, 2016 17:56
Visual novels database parser
*.c
*.pyc
*.html
*.o
*.so
build
@ChronoMonochrome
ChronoMonochrome / Videograbber.py
Last active August 10, 2017 17:25
Video grabber
#!/usr/bin/python
import os, sys, errno, time
class Logger(object):
def __init__(self, log):
self.stdout = sys.stdout
self.stderr = sys.stderr
self.log = open(log, "wb")
self.log_file = log
@ChronoMonochrome
ChronoMonochrome / LK_headers.py
Last active May 9, 2018 03:25
A script to produce an unique list of the Linux kernel headers used by the given source files.
""" The purpose of this script is to produce an unique list of the Linux kernel headers used by the given source files."""
import os.path
class Header:
bLocal = False
sLocalPath = ""
incPath = ""
pathMap = {"asm": "asm-generic"}
specialChars = ["\"", "<", ">"]
--------- beginning of main
04-02 16:19:34.976 1843 1843 I : debuggerd: starting
--------- beginning of system
04-02 16:19:35.087 1844 1844 I vold : Vold 3.0 (the awakening) firing up
04-02 16:19:35.088 1844 1844 V vold : Detected support for: exfat ext4 f2fs ntfs vfat
04-02 16:19:35.117 1844 1847 V vold : /system/bin/sgdisk
04-02 16:19:35.117 1844 1847 V vold : --android-dump
04-02 16:19:35.117 1844 1847 V vold : /dev/block/vold/disk:179_96
04-02 16:19:35.129 1844 1898 D vold : e4crypt_init_user0
04-02 16:19:35.129 1844 1898 D vold : e4crypt_prepare_user_storage for volume null, user 0, serial 0, flags 1
@ChronoMonochrome
ChronoMonochrome / iptables-redsocks.sh
Last active May 12, 2024 15:58
RedSocks proxy for Linux
#!/bin/bash
# Create new chain
sudo iptables -t nat -N REDSOCKS
# Ignore LANs and some other reserved addresses.
sudo iptables -t nat -A REDSOCKS -d 0.0.0.0/8 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 10.0.0.0/8 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 127.0.0.0/8 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 169.254.0.0/16 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 172.16.0.0/12 -j RETURN
@ChronoMonochrome
ChronoMonochrome / updater-script
Created October 25, 2017 19:32
LineageOS 15.0 updater-script
ui_print("Target: samsung/lineage_codina/codina:8.0.0/OPR6.170623.012/9606e8824d:userdebug/test-keys");
ifelse(is_mounted("/system"), unmount("/system"));
show_progress(0.750000, 0);
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("install", "/tmp");
run_program("/sbin/busybox", "chmod", "755", "/tmp/wipe.sh");
run_program("/sbin/sh", "/tmp/wipe.sh");
package_extract_dir("recovery", "/system");
package_extract_dir("system", "/system");
symlink("/system/lib/libbluetooth_jni.so", "/system/app/Bluetooth/lib/arm/libbluetooth_jni.so");
@ChronoMonochrome
ChronoMonochrome / transocks_proxy.sh
Last active May 17, 2019 09:47
Socks5 proxy over SSH using transocks_ev
#!/bin/bash
#set -x
SSH_SERVER=itunnel
SOCKS_PORT=1080
TRANSOCKS_PORT=4445
USE_BLACKLIST=0
#
# Function that starts the daemon/service
#
@ChronoMonochrome
ChronoMonochrome / README.md
Last active February 16, 2018 19:06
A simple scripts to save / restore Android sources tree revisions

HOW TO:

To produce a bash script containing commands to restore repositories' revisions:

  1. make sure you are running the following from a top of an Android source tree, e.g. /path/to/your/sources/tree/LOS15.1

  2. run: python2 get_tree.py .repo/manifests/default.xml .repo/manifests/snippets/lineage.xml .repo/manifests/local_manifest.xml > update.sh

#!/bin/bash
TOP=/media/system1/root/CM14
SOURCE=$TOP/kernel/lge/msm8226
OUT=$TOP/out/target/product/w7
OBJ=$OUT/obj/KERNEL_OBJ
GCC=/media/system1/root/l90/gcc-prebuilts/bin/arm-gnu-linux-androideabi-
do_kern_build() {
JOB_NUM=8
@ChronoMonochrome
ChronoMonochrome / docx2csv.py
Last active May 23, 2018 09:40
Convert DOCX tables to CSV format
import os
from docx import Document
def print_tables(path):
doc = Document(path)
for ntable, table in enumerate(doc.tables):
buf = u""
start_row = 0
if ntable > 0:
start_row = 2