Skip to content

Instantly share code, notes, and snippets.

View hfziu's full-sized avatar
🎯
Focusing

HF C hfziu

🎯
Focusing
View GitHub Profile
@hfziu
hfziu / keybase.md
Created October 24, 2023 02:41
kyebase.md

Keybase proof

I hereby claim:

  • I am hfziu on github.
  • I am essethon (https://keybase.io/essethon) on keybase.
  • I have a public key whose fingerprint is 0DA1 55F8 64E2 605C 67FF 9021 EB40 D90B 1D28 E872

To claim this, I am signing this object:

@hfziu
hfziu / dropbox_ignore_auxiliary_files.ps1
Created March 28, 2023 07:35
Set all LaTeX auxiliary files in the current directory (recursively) to be ignored by Dropbox (zsh and PowerShell scripts)
# use Get-ChildItem to find all auxiliary files with extension .aux, .fls, .synctex.gz, .log, .ldb_latexmk and .xdv recursively
Get-ChildItem -Path $pwd\* -Recurse -Include *.aux, *.fls, *.synctex.gz, *.log, *.ldb_latexmk, *.xdv | ForEach-Object {
# set the file to be ignored by Dropbox
Set-Content -Path $_.FullName -Stream com.dropbox.ignored -Value 1
}
@hfziu
hfziu / Microsoft.PowerShell_profile.ps1
Last active November 19, 2022 12:04
PowerShell related config snippets
$ThemesPath = Join-Path -Path (Split-Path $PROFILE) -ChildPath Themes
# oh-my-posh Theme
# oh-my-posh can be installed from Microsoft Store (recommended)
# https://ohmyposh.dev/
oh-my-posh init pwsh --config "$ThemesPath\powerlevel10k_lean_custom.json" | Invoke-Expression
$env:POSH_GIT_ENABLED = $true
# PSReadLine settings
# -------------------
@hfziu
hfziu / pub_key.asc
Created June 2, 2021 07:09
GPG Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFnoKNwBEADSxEtWpL/QERpRUTxXSSIwHoWYQ82kj6Dcd3HaeQv79B16PbrF
WE0VIdqEW6uEc9DQ6WIz8bXvGvIcg6jZDwaupth+5CMoURun6O4a8PBRAZHcgaBT
PoTKYHk6zOCUvKqNcQSD/lf1i2wkXz1BOtfIQ3m+3JHzl5y/we4W24XSrIy8rA0Y
dxjfwuU3KQqsYvli78Nb9By+yZtF3UbG08eaOPNxUnjnBuHtYPNMoyBXzjkkVoWo
0EcwvUQTih3gvBEsLcazk9i1a/e4woCozl3hqNf5l4dYYkNHxDSJl85sKZOQ6j6v
4bEg1waXkKFcRMuBwFSKY2CQzPoWieh17SBcVvlb9McdZcephDL3jjsqv9d/TPRp
lSa94ZPfRuaK/8DYBBlZp8rKtVYvjQtKkVkG79TABPGjLJwzP4kRmSanLRRSWgi+
HywcClt+GoD58kS1vshgq63SFGJmJBvvuVc7sL6+do+gDOiHyVHBm7PwX+o8LwLI
import numpy as np
import cvxpy as cp
# Consider the Prisoner's Dilemma https://en.wikipedia.org/wiki/Prisoner%27s_dilemma
# Variable v is prisoner A's payoff in the worst case (minimum)
v = cp.Variable() # expected utility of prisoner A
c = cp.Variable(nonneg=True) # probability that A cooperates
d = cp.Variable(nonneg=True) # probability that A defects
@hfziu
hfziu / .zshrc
Created November 27, 2019 02:37 — forked from mengyy212/.zshrc
Install Oh my zsh and plugins
# ...
plugins=(git
zsh-syntax-highlighting
zsh-autosuggestions
zsh-completions
osx)
autoload -U compinit && compinit
# ...
[proxy_all]
[bypass_list]
# Internal IPs and Tsinghua IPs
192.168.0.0/16
10.0.0.0/8
59.66.0.0/16
101.5.0.0/16
101.6.0.0/16
106.120.132.0/22
@hfziu
hfziu / docker-compose.yml
Last active June 14, 2019 10:59
Docker compose file for WordPress and Tiny Tiny RSS website. TTRSS 部分改自:https://github.com/HenryQW/Awesome-TTRSS
version: '2.1'
services:
database.postgres:
image: sameersbn/postgresql:latest
container_name: postgres
environment:
- PG_PASSWORD=password # please change the password
- DB_EXTENSION=pg_trgm
volumes:
@hfziu
hfziu / trrprefs.md
Created September 18, 2018 01:50 — forked from bagder/trrprefs.md
trr prefs

Preferences

All preferences for the DNS-over-HTTPS functionality in Firefox are located under the "network.trr" prefix (TRR == Trusted Recursive Resolver). The support for these are targeted for shipping in release Firefox 62.

network.trr.mode

set which resolver mode you want.

0 - Off (default). use standard native resolving only (don't use TRR at all)

1 - Race native against TRR. Do them both in parallel and go with the one that returns a result first.

@hfziu
hfziu / ipv6-hosts-temp
Created April 24, 2017 02:27
人肉收集的 ipv6-hosts
2001:5a0:3604:1:64:86:243:181 chat.freenode.net
2001:5a0:3604:1:64:86:243:181 irc.freenode.net
2001:630:12:500:219:bbff:fe39:8aba openstreetmap.org
2001:630:12:500:219:bbff:fe39:3d9e www.openstreetmap.org
2400:cb00:2048:1::681b:9b6b v2ray.com
2400:cb00:2048:1::681b:9b6b www.v2ray.com
2620:104:c000:8193::112 ieeexplore.ieee.org