Files
obsidian/dev-env-setup.md

224 lines
4.4 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## tools
https://next-ai-drawio.jiang.jp
## check list
### proxy
```bash
proxyOn() {
p="http://ipads:ipads123@202.120.40.82:11235"
p="http://gahow:Jiahao_4465_proxy@47.83.188.3:9118"
p="http://127.0.0.1:7890"
export https_proxy=$p http_proxy=$p all_proxy=$p
}
proxyOff() {
unset https_proxy http_proxy all_proxy
}
```
```bash
sudo apt update && sudo apt install autossh -y
nohup autossh -M 0 -N proxy > /tmp/ssh-proxy.log 2>&1 &
```
### nvim
`wget https://github.com/neovim/neovim/releases/download/v0.11.4/nvim-linux-x86_64.tar.gz`
add `.config/nvim/init.lua`
### tmux
```
bind-key b send-prefix
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
set -g status-right ""
unbind '%'
bind '|' split-window -h -c "#{pane_current_path}"
unbind '"'
bind '_' split-window -v -c "#{pane_current_path}"
bind -r m resize-pane -Z
set -g base-index 1
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection
unbind -T copy-mode-vi MouseDragEnd1Pane
```
### uv
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
export UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
export UV_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
```
### codex
```bash
cd "$HOME/.vscode-server/extensions/openai.chatgpt-0.4.15/bin/linux-x86_64"
# keep the original
mv codex codex.real
# wrapper that forces a proxy and then calls the original
cat > codex <<'EOF'
#!/usr/bin/env bash
export HTTPS_PROXY="http://ipads:ipads123@127.0.0.1:11235"
export HTTP_PROXY="http://ipads:ipads123@127.0.0.1:11235"
export NO_PROXY="http://ipads:ipads123@127.0.0.1:11235"
# ------------------------------------------------
HERE="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
exec "$HERE/codex.real" "$@"
EOF
chmod +x codex
```
### vllm
```bash
VLLM_USE_PRECOMPILED=1 uv pip install --editable . [--prerelease=allow]
```
```
ray start --head --port 6379 --num-gpus 8
ray start --address=172.27.21.64:6379 --num-gpus 8
```
### Rust
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
### trojan
server:
```yaml
run-type: server
local-addr: 0.0.0.0
local-port: 12358
remote-addr: 127.0.0.1
remote-port: 80
password:
- Jiahao_13387_trojan_proxy
ssl:
cert: /root/ca/certificate.crt
key: /root/ca/privkey.key
sni: your-domain-name.com
```
client:
```yaml
run-type: client
local-addr: 127.0.0.1
local-port: 1080
remote-addr: 47.245.13.144
remote-port: 12358
password:
- Jiahao_13387_trojan_proxy
ssl:
verify: false
sni: your-domain-name.com
mux:
enabled: true
```
use subscription:
```yaml
run-type: client
local-addr: 127.0.0.1
local-port: 1080
remote-addr: oss-cn-shanghai.solidigm-qwer.com
remote-port: 20032
password:
- 1AF767FB-A9B4-805B-7EF7-ABBA76044B77
ssl:
verify: false
sni: cos.ap-shanghai.myqcloud.com
```
`./trojan-go -config config.yaml`
## mac
```
sudo pmset -a sleep 0
Password:
pmset -g
System-wide power settings:
SleepDisabled 1
DestroyFVKeyOnStandby 0
Currently in use:
standby 1
Sleep On Power Button 1
hibernatefile /var/vm/sleepimage
powernap 1
networkoversleep 0
disksleep 10
sleep 0
hibernatemode 0
ttyskeepawake 1
displaysleep 30
tcpkeepalive 1
lowpowermode 0
womp 1
```
# Prompts
`codex -a never -s workspace-write`
```md
请使用第一性原理思考。你不能总是假设我非常清楚自己想要什么和该怎么得到。请保持审慎,从原始需求和问题出发,如果动机和目标不清晰,停下来和我讨论。如果目标清晰但是路径不是最短,告诉我,并且建议更好的办法
```
```md
**Use first-principles reasoning.**
Do not assume that I always have a precise understanding of the problem, the objective, or the best way to achieve it.
Start from the underlying problem and constraints rather than from my proposed solution.
- If the **goal, motivation, or constraints are unclear**, pause and ask clarifying questions.
- If my approach is **suboptimal, inefficient, or based on incorrect assumptions**, explain why and suggest better alternatives.
- Challenge hidden assumptions when necessary.
Your role is not just to execute instructions, but to **help identify the correct problem and the most effective path to solving it**.
```