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
--------- 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 / 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 / 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 / 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 / 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 = ["\"", "<", ">"]
@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
@ChronoMonochrome
ChronoMonochrome / shikimori_ratings.py
Last active June 12, 2018 21:56
Wilson score calculation for anime titles on shikimori.org
#!/usr/bin/env python
import operator
import json
from bs4 import BeautifulSoup
from urllib.request import urlopen
from functools import reduce, lru_cache
from math import sqrt
@ChronoMonochrome
ChronoMonochrome / channel_download.py
Last active September 22, 2018 19:02
A script to download all the media from the specified Telegram channel.
import os, sys
from telethon import TelegramClient, sync
import asyncio
# These example values won't work. You must get your own api_id and
# api_hash from https://my.telegram.org, under API Development.
API_ID = 12345
API_HASH = '0123456789abcdef0123456789abcdef'
count = 0