linux(ubuntu)下运行shadowsocks客户端

最终一键脚本:ssc-1key-linux

系统: Ubuntu 22.04

shadowsocks相关

  1. 将系统更新到最新版
  2. 安装shadowsocks及必要组件
    pip install https://github.com/shadowsocks/shadowsocks/archive/master.zip -U
    sudo apt-get install -y libsodium*
  3. 配置shadowsocks client
    sudo vi /etc/shadowsocks.json
{
  "server": "您服务器地址",
  "server_port": 9999,
  "local_address": "127.0.0.1",
  "local_port": 1080,
  "password": "密码",
  "timeout": 600,
  "method": "aes-256-cfb"
}
  1. 解决sodium库问题
    sudo ln -s /usr/lib/x86_64-linux-gnu/libsodium.a /usr/lib/x86_64-linux-gnu/liblibsodium.a

  2. 设置路径权限
    sudo chmod 777 /var/log
    sudo chmod 777 /var/run

  3. shadowsocks 开机自启动
    sudo vim /etc/systemd/system/shadowsocks.service:

    Description=Shadowsocks Client Service
    After=network.target
    [Service]
    Type=simple
    User=root
    ExecStart=/usr/local/bin/sslocal -c /etc/shadowsocks.json restart
    [Install]
    WantedBy=multi-user.target

    systemctl enable shadowsocks.service

HTTP全局代理

实现全局代理,我们可以使用polipo

  1. polipo 安装
    wget http://archive.ubuntu.com/ubuntu/pool/universe/p/polipo/polipo_1.1.1-8_amd64.deb
    安装 sudo dpkg -i polipo_1.1.1-8_amd64.deb
    配置 vi /etc/polipo/config

    logSyslog = true
    logFile = /var/log/polipo/polipo.log
    proxyAddress = "0.0.0.0"
    socksParentProxy = "127.0.0.1:1080"
    socksProxyType = socks5
    chunkHighMark = 50331648
    objectHighMark = 16384
    serverMaxSlots = 64
    serverSlots = 16
    serverSlots1 = 32

    polipo安装后会自动运行。

  2. 通过polipo设置本地http代理

    export http_proxy=http://127.0.0.1:8123
    export https_proxy=http://127.0.0.1:8123

    取消代理
    unset http_proxy
    unset https_proxy

pac代理

如果想使用http下的pac机制,可以考虑用provoxy替换polipo

  1. provoxy 安装
    安装:sudo apt-get install -y privoxy
    cp /etc/privoxy/config /etc/privoxy/config.bak
    vim /etc/privoxy/config
    确保 listen-address 127.0.0.1:8118 打开
    在/etc/profile, ~/.bashrc,~/.bash_profile 中添加:

    proxy="http://127.0.0.1:8118"
    export https_proxy=$proxy
    export http_proxy=$proxy
    export ftp_proxy=$proxy

    systemctl enable privoxy
    systemctl restart privoxy

  2. GFWList2Privoxy 制作pac条目
    pip install gfwlist2privoxy
    添加自定义域名:在生成的gfwlist.action文件中添加需要通过proxy访问的域名
    使pac生效:在/etc/privoxy/config文件中加上actionsfile gfwlist.action,然后重启privoxy服务

issue shooting:

  1. AttributeError: module 'collections' has no attribute 'MutableMapping'
    解决:/home/zcj/.local/lib/python3.10/site-packages/shadowsocks/lru_cache.py 34行 MutableMapping前面加上abc.
  2. [Errno 2] No such file or directory: b'liblibsodium.a'
    解决:sudo ln -s /usr/lib/x86_64-linux-gnu/libsodium.a /usr/lib/x86_64-linux-gnu/liblibsodium.a

参考:

  1. https://github.com/enpenguc/linux-backup/blob/master/doc/Ubuntu%20Server%E5%AE%89%E8%A3%85shadowsocks%E5%AE%A2%E6%88%B7%E7%AB%AF.md

燕尾蝶

凭着些许的记忆,我找到了《燕尾蝶》,那是少年时的震撼,一直萦绕于心,趁这个春节有空,得以找到资源。重温后,却感觉些许的迷茫,一种破碎记忆的感觉,时间太久远了,记忆已经模糊,感觉就是印象中的故事,又感觉有些生疏,因为印象中没有这么多细节,我只记依稀得移民,黑社会,各种混杂的语言,昏暗的画面。。。

一时恍惚。

我又仔细搜索了下,着实找不到第二个能对的上记忆的影片,只能悻悻道,可能就是它吧。

人的记忆是会变的,趁年轻,多写些记忆吧。

如何在windows中模拟arm64安卓系统

quem efi:

https://releases.linaro.org/reference-platform/enterprise/17.12/uefi/release/qemu-aarch64/QEMU_EFI.fd

安卓 iso:

https://developers.google.cn/android/images?hl=zh-cn#crosshatch

quem

pacman 所需的msys2 安装

https://www.qemu.org/download/#windows

For 64 bit Windows 8.1 or above (in UCRT64):

pacman -S mingw-w64-ucrt-x86_64-qemu
qemu-img --version
qemu-img version 8.2.0
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers

qemu-system-aarch64

debian下安装docker后无法使用

安装后提示:
docker is already the newest version (1.5-2)

但是运行docker 命令提示找不到。

然后重新安装:
curl -sSL https://get.docker.com/ | sudo sh
提示:
The repository 'https://download.docker.com/linux/ubuntu bookworm Release' does not have a Release file.

cd /etc/apt/sources.list.d/

发现有个 archive_uri-https_download_docker_com_linux_ubuntu-bookworm.list

rm archive_uri-https_download_docker_com_linux_ubuntu-bookworm.list
删除后再执行,就正常了。

Client: Docker Engine - Community
 Version:           25.0.3
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        4debf41
 Built:             Tue Feb  6 21:14:25 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          25.0.3
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       f417435
  Built:            Tue Feb  6 21:14:25 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

gitlab配置

看日志:
gitlab-ctl tail

看运行状态:
gitlab-ctl status

配置:
vi /etc/gitlab/gitlab.rb
打开屏蔽,然后 gitlab-ctl reconfigure

网上的一份最简配置

external_url 'http://git.xxx.com'
gitlab_rails['time_zone'] = 'Asia/Shanghai'

# 关闭电子邮件相关功能
gitlab_rails['smtp_enable'] = false
gitlab_rails['gitlab_email_enabled'] = false
gitlab_rails['incoming_email_enabled'] = false

# Terraform
gitlab_rails['terraform_state_enabled'] = false

# Usage Statistics
gitlab_rails['usage_ping_enabled'] = false
gitlab_rails['sentry_enabled'] = false
grafana['reporting_enabled'] = false

# 关闭容器仓库功能
gitlab_rails['gitlab_default_projects_features_container_registry'] = false
gitlab_rails['registry_enabled'] = false
registry['enable'] = false
registry_nginx['enable'] = false

# 包仓库
gitlab_rails['packages_enabled'] = false
gitlab_rails['dependency_proxy_enabled'] = false

# GitLab KAS
gitlab_kas['enable'] = false
gitlab_rails['gitlab_kas_enabled'] = false

# Mattermost
mattermost['enable'] = false
mattermost_nginx['enable'] = false

# Kerberos
gitlab_rails['kerberos_enabled'] = false
sentinel['enable'] = false

# GitLab Pages
gitlab_pages['enable'] = false
pages_nginx['enable'] = false

# 禁用 PUMA 集群模式
puma['worker_processes'] = 0
puma['min_threads'] = 1
puma['max_threads'] = 2

# 降低后台守护进程并发数
sidekiq['max_concurrency'] = 5

gitlab_ci['gitlab_ci_all_broken_builds'] = false
gitlab_ci['gitlab_ci_add_pusher'] = false

# 关闭监控
prometheus_monitoring['enable'] = false
alertmanager['enable'] = false
node_exporter['enable'] = false
redis_exporter['enable'] = false
postgres_exporter['enable'] = false
pgbouncer_exporter['enable'] = false
gitlab_exporter['enable'] = false
grafana['enable'] = false
sidekiq['metrics_enabled'] = false