Skip to content

Instantly share code, notes, and snippets.

View kmod-midori's full-sized avatar
🏳️‍⚧️
It works!

Midori Kochiya kmod-midori

🏳️‍⚧️
It works!
  • Beijing University of Posts and Telecommunications
  • Chengdu,China
  • 14:38 (UTC +08:00)
  • X @enp39s0
View GitHub Profile
@kmod-midori
kmod-midori / flv.hexpat
Created September 6, 2024 09:20
ImHex pattern for FLV files
#pragma endian big
struct Header {
char signature[3];
u8 version;
u8 flags;
u32 data_offset;
};
struct ScriptDataString {
@kmod-midori
kmod-midori / xfs_vdev.hexpat
Created August 9, 2024 08:51
ImHex Pattern for ZFS Vdev
#pragma endian big
#define VDEV_PAD_SIZE (8 << 10)
#define VDEV_PHYS_SIZE (112 << 10)
#define VDEV_UBERBLOCK_RING (128 << 10)
import std.mem;
enum nvpair_data_type_t: u32 {
boolean = 1,
@kmod-midori
kmod-midori / simplex.py
Created May 15, 2022 11:19
Solving linear programming problems using simplex method
from fractions import Fraction
def to_frac(item):
if isinstance(item, (int, float)) and not isinstance(item, bool):
return Fraction(item)
elif isinstance(item, tuple):
(num, denom) = item
return Fraction(num, denom)
else:
raise TypeError("Invalid type for fraction")
use std::io::prelude::*;
use std::{fs::File, path::PathBuf};
use encoding_rs::GB18030;
fn main() -> std::io::Result<()> {
let mut input_path = std::env::args().skip(1).next().map(PathBuf::from).unwrap();
let mut in_file = File::open(&input_path)?;
let mut src = String::new();
@kmod-midori
kmod-midori / git-credential-kwallet.py
Created March 30, 2020 07:49
KWallet wrapper for git credential helper
#!/usr/bin/env python3
from sys import stdin, argv
import subprocess
import json
if len(argv) != 2:
print("Usage: " + argv[0] + " <action: get|store>")
exit(1)
action = argv[1]
version: '3.3'
services:
db:
image: mariadb:10.1
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
11-13 14:56:38.067 1787 1787 E AndroidRuntime: at org.mokee.mkparts.stats.ReportingServiceManager.setAlarm(ReportingServiceManager.java:67)
11-13 14:56:38.067 1787 1787 E AndroidRuntime: at org.mokee.mkparts.stats.ReportingServiceManager.launchService(ReportingServiceManager.java:107)
.. More than 40k lines of the same log above ..
11-13 14:58:52.098 3309 3309 D AndroidRuntime: Shutting down VM
11-13 14:58:52.099 3309 3309 E AndroidRuntime: FATAL EXCEPTION: main
11-13 14:58:52.099 3309 3309 E AndroidRuntime: Process: com.android.dialer, PID: 3309
11-13 14:58:52.099 3309 3309 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference
11-13 14:58:52.099 3309 3309 E AndroidRuntime: at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:445)
11-13 14:58:52.099 3309 3309 E AndroidRuntime: at android.widget.ArrayAdapter.getView(ArrayAdapter.java:407)
@kmod-midori
kmod-midori / logcat.log
Created February 18, 2018 04:51
logcat
02-18 12:48:27.673 20791 20791 W DataUsageController: Failed to open stats session
02-18 12:48:27.673 20791 20791 W DataUsageController: java.lang.IllegalStateException: Bandwidth module disabled
02-18 12:48:27.673 20791 20791 W DataUsageController: at android.os.Parcel.readException(Parcel.java:2012)
02-18 12:48:27.673 20791 20791 W DataUsageController: at android.os.Parcel.readException(Parcel.java:1950)
02-18 12:48:27.673 20791 20791 W DataUsageController: at android.net.INetworkStatsService$Stub$Proxy.openSession(INetworkStatsService.java:229)
02-18 12:48:27.673 20791 20791 W DataUsageController: at com.android.settingslib.net.DataUsageController.getSession(DataUsageController.java:92)
02-18 12:48:27.673 20791 20791 W DataUsageController: at com.android.settingslib.net.DataUsageController.getDataUsageInfo(DataUsageController.java:128)
02-18 12:48:27.673 20791 20791 W DataUsageController: at com.android.settings.datausage.DataUsagePreference.setTemplate(DataUsagePreference.java:44)
02-18 12:48:
Sun Jul 09 01:53:12 2017
Windows-8-6.2.9200
Ren'Py 6.99.12.4.2187
Bootstrap to the start of init.init took 0.10s
Early init took 0.03s
Loader init took 0.04s
Loading error handling took 0.03s
Loading script took 0.63s
upstream soundcloud_main {
server 54.192.9.210:443;
server 54.192.27.193:443;
server 54.192.27.35:443;
server 54.192.27.27:443;
server 54.192.27.133:443;
server 54.192.27.150:443;
server 54.192.27.212:443;
}