Skip to content

Instantly share code, notes, and snippets.

@qzchenwl
qzchenwl / elasticsearch-docker-compose.yml
Created April 27, 2024 07:04
elasticsearch docker compose
services:
setup:
image: docker.elastic.co/elasticsearch/elasticsearch:8.13.0
user: "0"
command: >
bash -c '
if [ x${ELASTIC_PASSWORD} == x ]; then
echo "Set the ELASTIC_PASSWORD environment variable in the .env file";
exit 1;
elif [ x${KIBANA_PASSWORD} == x ]; then
@qzchenwl
qzchenwl / config.yaml
Last active November 17, 2023 14:52
合并多份clash订阅到一份中,支持复用规则、自定义规则。
# 基础订阅
subscribers:
nzl: &nzl !include https://path/to/your/subscription.yaml
mewu: &mewu !include https://path/to/your/another/subscription.yaml
proxies: &proxies !flatten
- !jq { object: *nzl, filter: '[.proxies[] | (.name += "-nzl")]' }
- !jq { object: *mewu, filter: '[.proxies[] | (.name += "-mewu")]' }
proxy-names: &all !jq { object: *proxies, filter: '[.[].name]' }
hk-proxy-names: &hk !jq { object: *all, filter: '[.[] | select(contains("香港"))]' }
tw-proxy-names: &tw !jq { object: *all, filter: '[.[] | select(contains("台湾"))]' }
@qzchenwl
qzchenwl / homebrew-gnubin.md
Created November 3, 2023 06:05 — forked from skyzyx/homebrew-gnubin.md
Using GNU command line tools in macOS instead of FreeBSD tools

macOS is a Unix, and not built on Linux.

I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.

Homebrew

Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.

All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.

@qzchenwl
qzchenwl / setup.sh
Last active March 29, 2021 06:42
k8s-master on centos7
# 0. SYSTEM INFO & CLUSTER ARCH
# CentOS 7
#
# +------------+ +-----------+
# | k8s-master |>192.168.99.20 -- 192.168.99.21<| k8s-node1 |
# +------------+ +-----------+
# v v
# internet internet
#
# /etc/hosts
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@qzchenwl
qzchenwl / packages.txt
Last active January 21, 2018 16:02
$ gcloud auth application-default login && cat ~/.config/gcloud/application_default_credentials.json
asn1crypto==0.23.0
bleach==1.5.0
cachetools==2.0.1
certifi==2017.11.5
cffi==1.11.2
chardet==3.0.4
click==6.7
conda==4.3.31
cryptography==2.1.4
decorator==4.2.1
@qzchenwl
qzchenwl / README.md
Created July 8, 2017 01:30
替换 Homebrew 源

替换 brew.git:

cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

替换 homebrew-core.git:

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <cassert>
#include <cmath>
using namespace std;
class BigInt
@qzchenwl
qzchenwl / minila2hhkb.xmodmap
Created December 21, 2015 02:45
xmodmap conf file to map minila to hhkb
!switch \| `~
keycode 0x31 = backslash bar backslash bar
keycode 0x33 = grave asciitilde grave asciitilde
!switch Super_L Alt_L
clear mod1
clear mod4
keycode 0x85 = Alt_L Meta_L Alt_L Meta_L
keycode 0x40 = Super_L NoSymbol Super_L
add mod1 = Alt_L Alt_R Meta_L
@qzchenwl
qzchenwl / Trigonometry Helper.markdown
Created November 25, 2015 02:56
Trigonometry Helper