Skip to content

Instantly share code, notes, and snippets.

@qzydustin
qzydustin / macOS-input-method-killer.sh
Last active October 22, 2023 14:29
Resolving macOS Chinese Input Lag Issue
#!/bin/sh
# This script aims to address the problem of input lag that can occur when using the Chinese input method on macOS.
# It provides a simple and effective solution by terminating the SCIM process, which is often the cause of the lag.
# To use the script, follow these steps:
# 1. Open the Terminal application (located in "Applications/Utilities/Terminal").
# 2. Copy and paste the script into the Terminal window.
# 3. Press Enter to execute the script.
@b1ghawk
b1ghawk / v2ray-unblock-netflix.md
Created April 12, 2023 09:27 — forked from phlinhng/v2ray-unblock-netflix.md
利用 v2ray-core / xray-core 的任意門協議解鎖流媒體

V2Ray 白話文教學介紹了如何利用 V2Ray 的路由功能將特定網站(例如 Netflix)的流量經過 Shadowsocks 轉到另一台機器上,達成解鎖流媒體的方法。 事實上,可以利用 V2Ray 的任意門協議直接將流量轉發到落地機上,進一步減少使用代理協議產生的開銷,以下為做法。

假設不能看奈飛的機器為 VPS A,可以看奈飛的機器為 VPS B。

基本配置

  • VPS A: 開兩個 freedom outbound,一個給 80 端口,一個給 443 端口,並配置對應的路由規則
  • VPS B: 開兩個 dokodemo-door inbound,一個給 80 端口,一個給 443 端口,兩個 inbound 都要設置 sniffing,並配置對應的路由規則

VPS A 設置

{
  "outbounds": [

为什么关心 AS

因特网上的一个 IP 必定属于某个 AS,也就是一个自治系统。一般一个 AS 里的 IP 具有共性,比如网络质量较高或者较差,欺诈风险较高或者较低。 在使用 mtr 或者 traceroute 查看路由时,通过确认中间路由节点 IP 的 AS,可以确认路由质量。 举例说明,对于常见的 CN2 线路,通过 mtr 看到有经过 59.43.138.70,使用 whois 命令查看 IP 信息如下

~$ whois 59.43.138.70
route:          59.43.0.0/16
descr:          Chinatelecom Next Carrying Network backbone
origin:         AS4809
mnt-by: MAINT-CHINANET
@phlinhng
phlinhng / v2ray-unblock-netflix.md
Last active February 22, 2024 07:33
利用 v2ray-core / xray-core 的任意門協議解鎖流媒體

V2Ray 白話文教學介紹了如何利用 V2Ray 的路由功能將特定網站(例如 Netflix)的流量經過 Shadowsocks 轉到另一台機器上,達成解鎖流媒體的方法。 事實上,可以利用 V2Ray 的任意門協議直接將流量轉發到落地機上,進一步減少使用代理協議產生的開銷,以下為做法。

假設不能看奈飛的機器為 VPS A,可以看奈飛的機器為 VPS B。

基本配置

  • VPS A: 開兩個 freedom outbound,一個給 80 端口,一個給 443 端口,並配置對應的路由規則
  • VPS B: 開兩個 dokodemo-door inbound,一個給 80 端口,一個給 443 端口,兩個 inbound 都要設置 sniffing,並配置對應的路由規則

VPS A 設置

{
  "outbounds": [
先说解决方式:
Windows TZ环境变量设置:
TZ=CST-8:00
以下为一些心得:
MySQL的system_time_zone读取错误的问题,会导致以下类似命令出现Warning:
show variables like '%time_zone%';
show variables like '%char%';
@maboloshi
maboloshi / README.md
Last active July 21, 2024 01:30
[Mac下配置Aria2] #macOS #aria2

Mac下配置Aria2

安装和设置 Aria2

# 使用 Homebrew 安装 aria2
brew install aria2

# 创建配置文件aria2.conf和空对话文件aria2.session
mkdir ~/.aria2 && cd ~/.aria2
touch aria2.conf
@svrnm
svrnm / globalSearch.js
Last active December 19, 2023 07:06
Global Search on the window object
function globalSearch(value, max = 100000) {
var stack = (function () {
iframe = document.createElement('iframe');
document.body.appendChild(iframe);
var results = Object.getOwnPropertyNames(window).filter(p => !iframe.contentWindow.hasOwnProperty(p)).map(p => {return {type: typeof window[p], name: p, value: window[p]}}).reduce((c,p) => {
c.push([p.value, 'window.' + p.name]);
return c;
}, []);
document.body.removeChild(iframe);
@leobrines
leobrines / aptsources-debian.sh
Created April 19, 2019 16:23
Apt Repositories And Install Programs Debian Example
#!/bin/bash
apt install curl
#
# Writes sources.list in order to add non-free repository
#
DEBIAN_RELEASE=`cat /etc/*-release 2> /dev/null | grep PRETTY_NAME | awk -F "=" {'print $2'} | awk -F "(" {'print $2'} | awk -F ")" {'print $1'}`
sourcesListFile=/etc/apt/sources.list
@jyukutyo
jyukutyo / CMakeLists.txt
Last active May 13, 2022 17:11
Build OpenJDK on CLion
cmake_minimum_required(VERSION 3.7)
project(hotspot)
include_directories(
src/hotspot/cpu
src/hotspot/os
src/hotspot/os_cpu
src/hotspot/share
src/hotspot/share/precompiled
src/hotspot/share/include
src/java.base/unix/native/include
@ygrenzinger
ygrenzinger / MonadExs.hs
Last active December 14, 2022 07:39
Functor -> Applicative -> Monad typeclasses
-- Two datatypes
data Optional a = Some a | Empty deriving (Eq, Show)
data Or a b = A a | B b deriving (Eq, Show)
-- functor instances
instance Functor Optional where
fmap f (Some a) = Some (f a)
fmap _ Empty = Empty
instance Functor (Or a) where