Skip to content

Instantly share code, notes, and snippets.

View QuantumGhost's full-sized avatar
🇯🇵

QuantumGhost QuantumGhost

🇯🇵
  • 0xB29A14086516184D
  • 23:01 (UTC +08:00)
View GitHub Profile
@QuantumGhost
QuantumGhost / ssl.md
Created November 3, 2023 14:53 — forked from clowwindy/ssl.md
为什么不应该用 SSL 翻墙

SSL 设计目标:

  1. 防内容篡改
  2. 防冒充服务器身份
  3. 加密通信内容

而翻墙的目标:

  1. 不被检测出客户端在访问什么网站
  2. 不被检测出服务器在提供翻墙服务
@QuantumGhost
QuantumGhost / README.md
Created October 21, 2023 13:39
COS policy for restic with minimal permission.

COS Policy for Restic

适用于 Restic 腾讯云 COS 最小权限策略.

本策略只允许备份, 不允许删除备份 (但要注意恶意攻击者仍可把所有的备份文件替换为空文件).

变量:

  • $UID: 腾讯云 uid, 形如 uid/1250000000
  • $BUCKET: 存储桶名称, 形如 examplebucket-1250000000
@QuantumGhost
QuantumGhost / hosts
Last active September 27, 2023 07:09
# 中国移动
0.0.0.0 config.cmpassport.com
0.0.0.0 www.cmpassport.com
0.0.0.0 wap.cmpassport.com
0.0.0.0 onekey1.cmpassport.com
0.0.0.0 log1.cmpassport.com
0.0.0.0 smsks1.cmpassport.com
0.0.0.0 verify.cmpassport.com
# 中国联通
@QuantumGhost
QuantumGhost / style.css
Last active July 12, 2023 14:45
Humble New Tab Page Bing Wallpaper Style
.column {
background-color: rgba(238, 238, 238, 0.85);
border-radius: 1em;
margin: 1.5em;
}
body {
/**
The bing wallpaper service is provided by:
https://github.com/TimothyYe/bing-wallpaper.
@QuantumGhost
QuantumGhost / limit.maxfiles.plist
Last active August 10, 2022 09:29
Automatically increase maxfiles on macOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxfiles</string>
<key>ProgramArguments</key>
<array>
<string>launchctl</string>
<string>limit</string>

先开启开发者模式,并连接到 adb shell,然后在 adb shell 中执行下面的命令:

# 禁用腾讯小微语音搜索:(也会禁用搜索功能)
pm disable-user --user 0 com.sony.dtv.searchapp
# 禁用京东智能家居
pm disable-user --user 0 com.jd.smartservicetwo
# 禁用原装桌面(**执行前请务必确认已安装第三方桌面,否则可能无法使用遥控器控制电视**)
pm disable-user --user 0 com.dangbei.TVHomeLauncher
// Type your code here, or load an example.
class User {}
bool isUserList(Object value) {
return value is List<User>;
}
int main(List<String> args) {
print(isUserList(<User>[]));
print(isUserList(<bool>[]));
@QuantumGhost
QuantumGhost / README.md
Created August 12, 2021 03:14
Nix tricks

Some tricks for managing packages with Nix

{ pkgs, sumFile }:
with pkgs;
let
mod2prefix = path: version: hash:
let
fullpath = "${path}@${lib.strings.removeSuffix "/go.mod" version}";
manifest = runCommand "${fullpath}.manifest"
{
outputHashMode = "flat";
outputHashAlgo = "sha256";
@QuantumGhost
QuantumGhost / sudo.pam
Created June 21, 2021 02:50
use touch id for sudo
# Put the line below in /etc/pam.d/sudo, before other lines
auth sufficient pam_tid.so