Skip to content

Instantly share code, notes, and snippets.

View yjlcoder's full-sized avatar

Yang Liu yjlcoder

View GitHub Profile
@yjlcoder
yjlcoder / README.md
Last active February 19, 2024 18:14
Setup Wacom tablet for multi displays

This script configured wacom tablet to confine it in a sinle display

# pip install plexapi
import glob
import os
import re
import sys
from typing import List
from plexapi.library import ShowSection
from plexapi.server import PlexServer
@yjlcoder
yjlcoder / bbb_download.py
Created April 4, 2021 19:39
Download Big Buck Bunny Lossless 1080P Video
#! /usr/bin/env python3
"""
This script is to download Big Buck Bunny lossless 1080P version
The video is 1920x1080 24 FPS as a sequence of PNG files.
Video Source: https://media.xiph.org/BBB/BBB-1080-png/
Author: Yang Liu
Date: 2021-04-04
@yjlcoder
yjlcoder / userstyle.css
Created February 14, 2021 20:32
Joplin Markdown CSS
/* For styling the rendered Markdown */
/* This style is based on the style post by davidpoza in https://discourse.joplinapp.org/t/share-your-css/1730/23 */
body {
font-family: "sf pro text", "Segoe UI",Helvetica,Arial,sans-serif;
}
h1 {
margin-top: 0 !important;
@yjlcoder
yjlcoder / Controller-Photoshop-8bitdo
Last active February 6, 2021 15:52
Controller settings for photoshop digital painting
#Persistent
; This script is for 8BitDo Lite to use shortcuts of photoshop
; The main purpose is to do digital painting
JOY_STICK_NUMBER = 2
JOY_STICK_PREFIX = %JOY_STICK_NUMBER%Joy
ButtonB = 1
ButtonA = 2
@yjlcoder
yjlcoder / Lib versions
Last active March 17, 2020 17:51
Git patch to port qpsnr to ubuntu 18.04 (Used on bsv9/qpsnr, commit 131275c)
Package: libavformat-dev
Version: 7:4.2.2-0york0~18.04
Package: libavcodec-dev
Version: 7:4.2.2-0york0~18.04
Package: libswscale-dev
Version: 7:4.2.2-0york0~18.04
@yjlcoder
yjlcoder / JNI.patch
Last active July 14, 2022 07:49
Android file access monitoring and control system
diff --git a/ojluni/src/main/native/FileInputStream.c b/ojluni/src/main/native/FileInputStream.c
index 2418c5d..8439f81 100644
--- a/ojluni/src/main/native/FileInputStream.c
+++ b/ojluni/src/main/native/FileInputStream.c
@@ -43,6 +43,13 @@
#include "io_util_md.h"
#include <nativehelper/JNIHelp.h>
+#include <dirent.h>
+#include <time.h>
@yjlcoder
yjlcoder / start-live-stream-ffmpeg.sh
Created April 11, 2019 21:33
FFmpeg DASH live video streaming (MPD file + M4S files)
# Change <INPUT FILE> to the input video file
# 3 video qualities: <1> 1920x1080, 4800kbps. <2> 1280x720, 2400kbps. <3> 640x360, 800kbps.
# 2 audio qualities: <1> origin audio. <2> audio sample rate: 22050 [low quality]
ffmpeg -re -stream_loop 1 -i <INPUT FILE> -map 0 -map 0 -map 0:v -acodec libfdk_aac -vcodec libx264 -preset veryfast \
-b:v:0 4800k -s:v:0 1920x1080 -profile:v:0 high \
-b:v:1 2400k -s:v:1 1280x720 -profile:v:1 main \
-b:v:2 800k -s:v:2 640x360 -profile:v:2 baseline \
-bf 1 -keyint_min 120 -g 60 -sc_threshold 0 -b_strategy 0 -ar:a:1 22050 \
-use_timeline 1 -use_template 1 -window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" \
@yjlcoder
yjlcoder / Topo.py
Last active February 1, 2019 16:56
A simple mininet topology
from mininet.topo import Topo
from mininet.link import TCLink
from mininet.log import info
from mininet.net import Mininet
from mininet.cli import CLI
from mininet.node import RemoteController
def main():
net = Mininet(link=TCLink)
@yjlcoder
yjlcoder / get_ip.sh
Created July 5, 2018 03:30
Get IP address from shell
echo `ifconfig eth1 2>/dev/null|awk '/inet addr:/ {print $2}'|sed 's/addr://'`