Skip to content

Instantly share code, notes, and snippets.

View wych42's full-sized avatar

Yuchi W wych42

  • Beijing, China
View GitHub Profile
module demo/mysqlperf
go 1.20
require github.com/go-sql-driver/mysql v1.7.1
-- DISPLAY FOCUS SWITCHING [[[2
-- Copy&Modified from: http://bezhermoso.github.io/2016/01/20/making-perfect-ramen-lua-os-x-automation-with-hammerspoon/
--One hotkey should just suffice for dual-display setups as it will naturally
--cycle through both.
--A second hotkey to reverse the direction of the focus-shift would be handy
--for setups with 3 or more displays.
--Bring focus to next display/screen
local application = require "hs.application"
hs.hotkey.bind({"alt"}, "`", function ()
@wych42
wych42 / error.log
Last active May 24, 2020 13:02
rss
[12:51:22/29] start
[12:51:22/29] running HOOK_FETCH_FEED handlers...
[12:51:22/29] feed data has not been modified by a plugin.
[12:51:22/29] local cache will not be used for this feed
[12:51:22/29] last unconditional update request: 2020-05-24 12:44:14
[12:51:22/29] stored last modified for conditional request:
[12:51:22/29] fetching [.../] (force_refetch: )...
[12:51:23/29] fetch done.
[12:51:23/29] source last modified:
[12:51:23/29] saving cache/feeds/faf6fdb889044c0c5c4b120e9e74220319fa1540.xml
@wych42
wych42 / clash.service
Last active February 5, 2024 05:39
Clash as transparent proxy(not totally transparent) on gateway box
[Unit]
Description=Clash service
After=network.target
[Service]
[Service]
Type=simple
StandardError=journal
User=clash
@wych42
wych42 / mi9-pro-eu-rom-magisk-charles.md
Last active November 8, 2023 12:43 — forked from maboloshi/README.MD
小米9 Pro 5G 刷入欧洲版MIU + Magisk + 信任用户证书可以使用 Charles 抓包 [on macOS]

小米9 Pro 5G 刷入欧洲版MIU + Magisk + 信任用户证书可以使用 Charles 抓包 [on macOS]

本教程不保证它的权威性和正确性,也不对任何实践中的错误、数据丢失等问题负责!
本教程平台为 macOS, 其他系统请酌情参考

准备工作

申请解锁权限

申请解锁: 解锁小米手机

@wych42
wych42 / pdf.js
Last active December 10, 2017 10:08
chrome headless print-to-pdf
'use strict';
const puppeteer = require('puppeteer');
const devices = require('puppeteer/DeviceDescriptors');
const [url, title] = process.argv.slice(-2,);
console.log('loading', title, url);
(async() => {

前提: 已经有 DNS server 配置好,并且在运行中。地址为: dns-a 和 dns-b。

配置

包依赖

aptitude install keepalived ipvsadm

virtual server(lvs router) 配置