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 / 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
@ChronoMonochrome
ChronoMonochrome / pm-3.1.txt
Created October 9, 2018 16:18
Bisect log for LK 3.0-3.1 PM subsystem changes
git bisect start
# bad: [c3b92c8787367a8bb53d57d9789b558f1295cc96] Linux 3.1
git bisect bad c3b92c8787367a8bb53d57d9789b558f1295cc96
# good: [02f8c6aee8df3cdc935e9bdd4f2d020306035dbe] Linux 3.0
git bisect good 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe
# bad: [138051659902da7e6a09d379fee5dade2a80fcfd] Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
git bisect bad 138051659902da7e6a09d379fee5dade2a80fcfd
# bad: [9d1c02135516866cbbb2f80e20cfb65c63a3ce40] Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs
git bisect bad 9d1c02135516866cbbb2f80e20cfb65c63a3ce40
# good: [61b8013a114cb041db2c56f747953cac69637f26] stmmac: Allow SOCs to use Store forward mode eventhough tx_coe is 0. (V2)
@ChronoMonochrome
ChronoMonochrome / avito_ads_block.user.js
Last active October 20, 2018 15:41
Avito Advertisements block
// ==UserScript==
// @name Avito ads block
// @description Test
// @author Chrono
// @license MIT
// @version 0.1
// @include *://*/*
// ==/UserScript==
// for a cross-browser compatibility (opera, ie)
(function (window, undefined) {
@ChronoMonochrome
ChronoMonochrome / cpboot.c
Last active November 29, 2018 13:35
cpboot daemon
void __fastcall start(int a1, int a2, int a3, int a4, int a5)
{
((void (__fastcall *)(_DWORD, _DWORD, _DWORD, _DWORD))sub_1B738)(&a5, 0, &main, &off_8100);
JUMPOUT(0);
}
signed int __fastcall main(int a1, _DWORD *a2)
{
int v2; // r2@1
int v3; // r3@1
@ChronoMonochrome
ChronoMonochrome / FontService_hack.diff
Created January 8, 2019 03:24
Kernel hacks for EMFILE (too many opened files) error caused by MicroG / FontService
diff --git a/fs/fcntl.c b/fs/fcntl.c
index 1e72c866ddc..73aeea07be5 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -72,8 +72,12 @@ SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
if (unlikely(!file))
goto Ebadf;
if (unlikely(err < 0)) {
- if (err == -EMFILE)
+ if (err == -EMFILE) {
@ChronoMonochrome
ChronoMonochrome / build_los.sh
Last active January 21, 2019 07:03
LineageOS 14.1 build script for low performance systems
export USE_NINJA=false
#export ANDROID_COMPILE_WITH_JACK=true
#export ANDROID_JACK_VM_ARGS="-Xmx3560m -Xms512m -Dfile.encoding=UTF-8 -XX:+TieredCompilation"
export ANDROID_JACK_VM_ARGS="-Xmx2g -Dfile.encoding=UTF-8 -XX:+TieredCompilation"
export USE_CCACHE=true
export CCACHE_DIR=/home/chrono/coldstorage/root/cm14_ccache
export _JAVA_OPTIONS="-Xms64m -Xmx2048m -XX:ParallelGCThreads=1"
. build/envsetup.sh
lunch lineage_i9300-userdebug
@ChronoMonochrome
ChronoMonochrome / akm.c
Created February 8, 2019 06:04
AKM sensors for Galaxy S3
#define LOG_TAG "AkmSensor"
#include <hardware/sensors.h>
#include <fcntl.h>
#include <errno.h>
#include <dirent.h>
#include <math.h>
#include <poll.h>
#include <pthread.h>
#include <linux/input.h>
diff --git a/arch/arm/mach-exynos/cpufreq-4x12.c b/arch/arm/mach-exynos/cpufreq-4x12.c
index b9c37f988a7e..acc5fd6eb687 100644
--- a/arch/arm/mach-exynos/cpufreq-4x12.c
+++ b/arch/arm/mach-exynos/cpufreq-4x12.c
-#ifdef CONFIG_MACH_T0
static const unsigned int asv_voltage_step_12_5_rev2[CPUFREQ_LEVEL_END][13] = {
- /* ASV0, ASV1, ASV2, ASV3, ASV4, ASV5, ASV6, ASV7, ASV8, ASV9, ASV10, ASV11 */
- { 1475000, 1475000, 1475000, 1475000, 1475000, 1475000, 1475000, 1475000, 1475000, 1475000, 1475000, 1475000 }, /* 2000MHz */
- { 1475000, 1475000, 1475000, 1475000, 1475000, 1475000, 1475000, 1475000, 1475000, 1475000, 1475000, 1475000 }, /* 1902MHz */
- { 1475000, 1475000, 1475000, 1475000, 1475000, 1450000, 1450000, 1450000, 1450000, 1437500, 1425000, 1412500 }, /* 1800MHz */
@ChronoMonochrome
ChronoMonochrome / log.txt
Created March 2, 2019 20:42
S3 camera debug
03-02 23:41:15.219 2082 3789 E exynos_camera: exynos_camera_capture_thread: tid=3789: capture_mutex lock
03-02 23:41:15.289 2082 3762 E exynos_camera: exynos_camera_cancel_auto_focus(0x41ea3360)
03-02 23:41:15.289 2082 3762 D exynos_camera: exynos_camera_auto_focus_stop()
03-02 23:41:15.290 2082 2082 E exynos_camera: exynos_camera_get_parameters(0x41ea3360)
03-02 23:41:15.290 2082 2082 E exynos_camera: exynos_camera_put_parameters(0x41ea3360)
03-02 23:41:15.292 2082 2737 E exynos_camera: exynos_camera_set_parameters(0x41ea3360, antibanding=auto;antibanding-values=off,auto,50hz,60hz;auto-exposure-lock=false;auto-exposure-lock-supported=true;auto-whitebalance-lock=false;auto-whitebalance-lock-supported=true;effect=none;effect-values=none,mono,negative,sepia,solarize,posterize,washed,vintage-warm,vintage-cold,point-blue,point-red-yellow,point-green;exposure-compensation=0;exposure-compensation-step=0.5;flash-mode=off;flash-mode-values=off,auto,on,torch;focal-length=3.7;focus-areas=(0,0,0,0,0);focus-d