Skip to content

Instantly share code, notes, and snippets.

View TheRainstorm's full-sized avatar
👾
On School

Fuyan Yuan TheRainstorm

👾
On School
  • Chongqing University
  • {Jiangxi, Chongqing, Hefei}, China
  • 18:34 (UTC +08:00)
View GitHub Profile
Read SEQ1M Q8T1: (g=0): rw=read, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T) 1024KiB-1024KiB, ioengine=libaio, iodepth=8
Read RND4K Q32T1: (g=1): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=32
Read RND4K Q1T1: (g=2): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1
Write SEQ1M Q8T1: (g=3): rw=write, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T) 1024KiB-1024KiB, ioengine=libaio, iodepth=8
Write RND4K Q32T1: (g=4): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=32
Write RND4K Q1T1: (g=5): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1
fio-3.16
Starting 6 processes
Read SEQ1M Q8T1: Laying out IO file (1 file / 4096MiB)
Jobs: 1 (f=1): [_(5),w(1)][58.8%][w=14.7MiB/s][w=3752 IOPS][eta 02m:27s]
@TheRainstorm
TheRainstorm / gist:df6e5ceb3c99c037eb13eb951d9aaf59
Last active September 21, 2024 19:36
ZFS raid10 (3TBx2+3x2+2x2) fio Test
root@ryzen-pve ➜ ~ fio --filename=/mnt/Disk1/test.fio /root/scripts/fio/fio_CrystalDiskMark.ini
Read SEQ1M Q8T1: (g=0): rw=read, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T) 1024KiB-1024KiB, ioengine=libaio, iodepth=8
Read SEQ1M Q1T1: (g=1): rw=read, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T) 1024KiB-1024KiB, ioengine=libaio, iodepth=1
Read RND4K Q32T1: (g=2): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=32
Read RND4K Q1T1: (g=3): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1
Write SEQ1M Q8T1: (g=4): rw=write, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T) 1024KiB-1024KiB, ioengine=libaio, iodepth=8
Write SEQ1M Q1T1: (g=5): rw=write, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T) 1024KiB-1024KiB, ioengine=libaio, iodepth=1
Write RND4K Q32T1: (g=6): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=32
Write RND4K Q1T1: (g=7): rw=randwrite, bs=(R) 4096B-4096B,
@TheRainstorm
TheRainstorm / log
Last active May 24, 2024 12:24
ask for help
➜ Movie /bin/ffmpeg -threads 1 -autorotate 0 -re -i "City.Hunter.2024.1080p.NF.WEB-DL.DUAL.DDP5.1.Atmos.H.264-FLUX.mkv" -t 600 -filter_complex "format=yuv420p,subtitles=City.Hunter.2024.1080p.NF.WEB-DL.DUAL.DDP5.1.Atmos.H.264-FLUX.mkv:si=0" -c:v h264_nvenc -preset:v medium -rc:v vbr -b:v 8M -maxrate:v 10M -bufsize:v 20M -g 60 -keyint_min 60 -sc_threshold 0 -c:a aac -b:a 256k -ac 2 -f flv rtmp://localhost/live/stream
Input #0, matroska,webm, from 'City.Hunter.2024.1080p.NF.WEB-DL.DUAL.DDP5.1.Atmos.H.264-FLUX.mkv':
Metadata:
encoder : libebml v1.4.5 + libmatroska v1.7.1
Duration: 01:44:03.00, start: 0.000000, bitrate: 6204 kb/s
Stream #0:0(jpn): Video: h264 (Main), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn, 48 tbc (default) (original)
Metadata:
BPS : 4791086
DURATION : 01:44:03.000000000
import logging
import os
import argparse
import re
import subprocess
import time
import ffmpeg
import uuid
def get_duration(file_path):
@TheRainstorm
TheRainstorm / 10-route-update4
Created April 3, 2024 07:30
openwrt通过hotplug机制自动设置wan口源进源出。
# /etc/hotplug.d/iface/10-route-update4
. /lib/functions/network.sh
network_flush_cache
NET_IF="wan"
if [ "${INTERFACE}" != "${NET_IF}" ]
then exit 0
fi
if [ "${ACTION}" != "ifup" ] \
@TheRainstorm
TheRainstorm / test_malloc.c
Last active November 2, 2021 15:07
[malloc maxium] get the maxium memory allocated by malloc #CA #malloc
#include<stdio.h>
#include<stdlib.h>
int main(){
unsigned int maximum = 0;
unsigned int blocksize[] = {1024*1024, 1024, 1};
for(int i=0; i<3; i++){
for(int count=1; ; count++){
void *block = malloc(maximum + blocksize[i]*count);