Ubuntu24上安装Claude-Code用QWen3和魔搭社区 系统带的npm,nodejs版本低,需安装nvm,npm和codejs curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash export NVM_DIR="$HOME/.nvm" source "$NVM_DIR/nvm.sh" export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" nvm install --lts nvm use 22.18.0 npm install -g npm@11.5.2 nvm alias default 22.18.0 安装Claude Code npm install @anthropic-ai/claude-code -g claude --version 安装claude-code-router npm install @musistudio/claude-code-router@latest -g 安装魔搭平台的配置文件插件 npm install @leason/claude-code-config -g 魔搭社区平台获取一个API KEY https://modelscope.cn/my/overview 使用claude-code,第一次登陆会提示输入魔搭社区API key ccr ui ccr restart ccr code 安装qwen-cli npm install @qwen-code/qwen-code@latest -g qwen --version 登录qwen-cli,走完登录流程,选QWen OAuth qwen 下载这个文件:qwen-cli.js,放到~/.claude-code-router/plugins目录下,下载地址: https://gist.githubusercontent.com/musistudio/f5a67841ced39912fd99e42200d5ca8b/raw/8513fcb1b47d02f5c564867ca28a1c4f71c65075/qwen-cli.js ...
Linux上github国内加速方法
加速 GitHub 的 SSH clone 操作 GitHub 支持通过 443 端口走 SSH,适合被防火墙限制 22 端口的网络环境。 修改 ~/.ssh/config 文件,添加以下内容: Host github.com HostName ssh.github.com Port 443 User git IdentityFile ~/.ssh/id_rsa 然后测试连接: ssh -T git@github.com 用fastgithub加速 GitHub 的 http/https clone 操作 下载FastGithub Linux版安装包到opt目录。 sudo wget -c -O /opt/fastgithub_linux-x64.zip https://gitee.com/chcrazy/FastGithub/releases/download/2.1.4/fastgithub_linux-x64.zip 解压 sudo unzip -d /opt /opt/fastgithub_linux-x64.zip 安装服务到systemd sudo /opt/fastgithub_linux-x64/fastgithub start 卸载服务 sudo /opt/fastgithub_linux-x64/fastgithub stop systemd启停服务 sudo systemctl start fastgithub sudo systemctl stop fastgithub sudo systemctl status fastgithub 手动启停 sudo /opt/fastgithub_linux-x64/fastgithub 使用http/https代理 export http_proxy=http://127.0.0.1:38457 export https_proxy=http://127.0.0.1:38457 证书验证 如果git操作提示SSL certificate problem 需要关闭git的证书验证:git config --global http.sslverify false
一个奇怪问题-新版ssh客户端无法连接到老的ssh服务器
新版ssh客户端无法连接到老的ssh服务器 问题描述 用ssh命令连接到一些老的server,出现超时错误,现象像防火墙问题,但实际上防火墙没有打开。 ssh -vvv的输出如下。 ssh -vvv 172.18.2.28 OpenSSH_9.3p2, LibreSSL 3.3.6 debug1: Reading configuration data /Users/me/.ssh/config debug1: /Users/me/.ssh/config line 1: Applying options for 172.18.2.28 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files debug1: /etc/ssh/ssh_config line 54: Applying options for * debug2: resolve_canonicalize: hostname 172.18.2.28 is address debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/me/.ssh/known_hosts' debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/me/.ssh/known_hosts2' debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling debug3: ssh_connect_direct: entering debug1: Connecting to 172.18.2.28 [172.18.2.28] port 22. debug3: set_sock_tos: set socket 3 IP_TOS 0x48 debug1: connect to address 172.18.2.28 port 22: Operation timed out ssh: connect to host 172.18.2.28 port 22: Operation timed out 解决方法 尝试运行ssh -o IPQoS=none 172.18.2.28,如果能解决这个问题,可以在配置文件~/.ssh/config中添加如下内容。 ...
一个sshuttle连接错误问题的解决
问题描述 运行sshuttle时在设置完iptables之后,立即出现“client_loop: send disconnect: Broken pipe”的错误。 sudo sshuttle -r root@152.69.200.24 0/0 -x 172.28.0.0/20 --dns -v ... fw: setting up. ... fw: iptables -w -t nat -A sshuttle-12300 -j RETURN --dest 127.0.0.1/32 -p tcp fw: iptables -w -t nat -A sshuttle-12300 -j REDIRECT --dest 0.0.0.0/0 -p tcp --to-ports 12300 client_loop: send disconnect: Broken pipe fw: undoing changes. fw: ip6tables -w -t nat -D OUTPUT -j sshuttle-12300 fw: ip6tables -w -t nat -D PREROUTING -j sshuttle-12300 fw: ip6tables -w -t nat -F sshuttle-12300 fw: ip6tables -w -t nat -X sshuttle-12300 fw: iptables -w -t nat -D OUTPUT -j sshuttle-12300 fw: iptables -w -t nat -D PREROUTING -j sshuttle-12300 fw: iptables -w -t nat -F sshuttle-12300 fw: iptables -w -t nat -X sshuttle-12300 c : fatal: ssh connection to server (pid 2211) exited with returncode 255 解决方案 把SSH的server地址加在-x option后即可解决该问题。 ...
Archlinux中安装SageMath
安装 Sage 使用以下命令安装即可。 sudo pacman -S sagemath 安装JupyterLab 使用以下命令安装即可。 sudo pacman -S jupyterlab 安装导出PDF需要的xelatex包 sudo pacman -S texlive-xetex sudo pacman -S texlive-fontsrecommended sudo pacman -S texlive-plaingeneric sudo pacman -S texlive-latexextra 安装中文包 可以用yay命令来安装JupyterLab的中文包,yay的安装可以参看[[在wsl2中安装archlinux]]。 ...