Skip to content

Instantly share code, notes, and snippets.

View lyc8503's full-sized avatar

lyc8503

View GitHub Profile
@lyc8503
lyc8503 / absmouse.c
Created November 4, 2024 15:29
Android absolute mouse
/*
* Android (and Linux X11) can't handle absolute position HID events from mouse
* https://www.codeproject.com/Articles/1001891/A-USB-HID-Keyboard-Mouse-Touchscreen-emulator-with
*
* This program read these ABS_X & ABS_Y events from /dev/input/eventX, and emulate a touchscreen/stylus via linux uinput, so an "absolute" mouse can work.
* Example of "absolute" mouse: PiKVM, or some other mouse-emulating hardware (e.g. https://detail.tmall.com/item.htm?id=684263217981)
*/
#include <linux/uinput.h>
#include <stdio.h>
@lyc8503
lyc8503 / aggregator.chart.py
Last active July 14, 2024 13:43
Netdata plugin for aggregating multiple metrics into one graph, mainly for custom dashboard
# -*- coding: utf-8 -*-
# Put this in /usr/libexec/netdata/python.d/
from bases.FrameworkServices.SimpleService import SimpleService
import requests
def fetch_latest():
return requests.get("http://192.168.1.10:19999/api/v1/allmetrics?filter=cgroup*&format=json").json()
NETDATA_UPDATE_EVERY = 1
priority = 1000
@lyc8503
lyc8503 / aliyun_ddns.py
Last active November 3, 2023 10:28
阿里云 DDNS Python
#!/usr/bin/python3
import json
from hashlib import sha1
import hmac
import base64
import datetime
import urllib.parse
from urllib.error import HTTPError
from urllib.request import urlopen
import os
@lyc8503
lyc8503 / Bilibili共享大会员.user.js
Last active November 17, 2024 19:47
和朋友共享 Bilibili 大会员账号 (主要自用, 不对该脚本提供任何技术支持, 请勿询问我与此脚本有关的任何问题. 仅限和朋友分享账号, 请勿用于商业用途.)
// ==UserScript==
// @name Bilibili VIP
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 不给叔叔送钱
// @author You
// @match *://www.bilibili.com/bangumi/play/*
// @match *://www.bilibili.com/video/*
// @connect api.bilibili.com
// @icon https://www.bilibili.com/favicon.ico
// ==UserScript==
// @name 签到脚本lite
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 自动签到插件
// @author lyc8503
// @match *
// @connect *
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant GM_xmlhttpRequest
aliddns_ak="xxx"
aliddns_sk="xxx"
domain="xxx.example.com"
timestamp=$(date -u "+%Y-%m-%dT%H%%3A%M%%3A%SZ")
ip=$(ip route get 2001::8888 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}')
urlencode() {
# urlencode <string>
@lyc8503
lyc8503 / clash_config.yml
Last active June 28, 2024 01:56
~~自用的 clash 分流.~~ 现在是 Clash Meta 啦, 简洁优雅++
mode: rule
ipv6: true
log-level: info
allow-lan: false
mixed-port: 7890
unified-delay: false
tcp-concurrent: true
external-controller: 127.0.0.1:9091
external-ui: ui