VPS安装Bluesky PDS

Bluesky是一个去中心化的分散式社交系统,与 Mastodon (长毛象) 相似,不过Bluesky 自行开发的AT Protocol协议无法与 Mastodon 的 ActivityPub 互通。 同样是可自行架设的社交平台,比较特别的是 Bluesky 并不像 Mastodon 一样包含了前端网页(web),它只有提供API功能,需要专门的前端来进行登录管理。 自行部署的Bluesky服务器被称为个人数据服务器 (Personal Data Server, PDS),使用者可以在 bsky.app 网页版或 iOS、Android客户端中登录自行部署的pds服务。 pds推荐主机配置 操作系统 Ubuntu 22.04 内存 (RAM) 1 GB CPU核心 1 CPU构架 amd64, arm64 硬盘 20 GB SSD 可服务账号数 20 VPS部署PDS实例 域名设置 以pds.p9.pub为例,服务器IP为195.192.118.6 将pds.p9.pub和*.pds.p9.pub的A记录修改为195.192.118.6 安装pds 通过以下命令下载安装脚本 wget https://raw.githubusercontent.com/bluesky-social/pds/main/installer.sh 然后运行bash ./installer.sh来开始安装 bash ./installer.sh * Detected supported distribution Debian 12 --------------------------------------- Add DNS Record for Public IP --------------------------------------- From your DNS provider's control panel, create the required DNS record with the value of your server's public IP address. + Any DNS name that can be resolved on the public internet will work. + Replace example.com below with any valid domain name you control. + A TTL of 600 seconds (10 minutes) is recommended. Example DNS record: NAME TYPE VALUE ---- ---- ----- example.com A 195.192.118.6 *.example.com A 195.192.118.6 **IMPORTANT** It's recommended to wait 3-5 minutes after creating a new DNS record before attempting to use it. This will allow time for the DNS record to be fully updated. ## 输入域名和管理员邮箱 Enter your public DNS address (e.g. example.com): pds.p9.pub Enter an admin email address (e.g. [email protected]): [email protected] Hit:1 http://security.debian.org/debian-security bookworm-security InRelease Hit:2 http://deb.debian.org/debian bookworm InRelease Hit:3 http://deb.debian.org/debian bookworm-updates InRelease Hit:4 https://download.docker.com/linux/debian bookworm InRelease Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done ca-certificates is already the newest version (20230311). curl is already the newest version (7.88.1-10+deb12u7). lsb-release is already the newest version (12.0-1). lsb-release set to manually installed. openssl is already the newest version (3.0.14-1~deb12u2). openssl set to manually installed. The following additional packages will be installed: dirmngr gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm libassuan0 libjq1 libksba8 libnpth0 libonig5 pinentry-curses Suggested packages: pinentry-gnome3 tor parcimonie xloadimage scdaemon pinentry-doc sqlite3-doc The following NEW packages will be installed: dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm jq libassuan0 libjq1 libksba8 libnpth0 libonig5 pinentry-curses sqlite3 xxd 0 upgraded, 19 newly installed, 0 to remove and 0 not upgraded. Need to get 8,706 kB of archives. After this operation, 17.8 MB of additional disk space will be used. Get:1 http://deb.debian.org/debian bookworm/main amd64 libassuan0 amd64 2.5.5-5 [48.5 kB] Get:2 http://deb.debian.org/debian bookworm/main amd64 gpgconf amd64 2.2.40-1.1 [564 kB] Get:3 http://deb.debian.org/debian bookworm/main amd64 libksba8 amd64 1.6.3-2 [128 kB] Get:4 http://deb.debian.org/debian bookworm/main amd64 libnpth0 amd64 1.6-3 [19.0 kB] Get:5 http://deb.debian.org/debian bookworm/main amd64 dirmngr amd64 2.2.40-1.1 [792 kB] Get:6 http://deb.debian.org/debian bookworm/main amd64 gnupg-l10n all 2.2.40-1.1 [1,093 kB] Get:7 http://deb.debian.org/debian bookworm/main amd64 gnupg-utils amd64 2.2.40-1.1 [927 kB] Get:8 http://deb.debian.org/debian bookworm/main amd64 gpg amd64 2.2.40-1.1 [949 kB] Get:9 http://deb.debian.org/debian bookworm/main amd64 pinentry-curses amd64 1.2.1-1 [77.4 kB] Get:10 http://deb.debian.org/debian bookworm/main amd64 gpg-agent amd64 2.2.40-1.1 [695 kB] Get:11 http://deb.debian.org/debian bookworm/main amd64 gpg-wks-client amd64 2.2.40-1.1 [541 kB] Get:12 http://deb.debian.org/debian bookworm/main amd64 gpg-wks-server amd64 2.2.40-1.1 [531 kB] Get:13 http://deb.debian.org/debian bookworm/main amd64 gpgsm amd64 2.2.40-1.1 [671 kB] Get:14 http://deb.debian.org/debian bookworm/main amd64 gnupg all 2.2.40-1.1 [846 kB] Get:15 http://deb.debian.org/debian bookworm/main amd64 libonig5 amd64 6.9.8-1 [188 kB] Get:16 http://deb.debian.org/debian bookworm/main amd64 libjq1 amd64 1.6-2.1 [135 kB] Get:17 http://deb.debian.org/debian bookworm/main amd64 jq amd64 1.6-2.1 [64.9 kB] Get:18 http://deb.debian.org/debian bookworm/main amd64 sqlite3 amd64 3.40.1-2 [353 kB] Get:19 http://deb.debian.org/debian bookworm/main amd64 xxd amd64 2:9.0.1378-2 [83.7 kB] Fetched 8,706 kB in 0s (36.3 MB/s) Selecting previously unselected package libassuan0:amd64. (Reading database ... 36657 files and directories currently installed.) Preparing to unpack .../00-libassuan0_2.5.5-5_amd64.deb ... Unpacking libassuan0:amd64 (2.5.5-5) ... Selecting previously unselected package gpgconf. Preparing to unpack .../01-gpgconf_2.2.40-1.1_amd64.deb ... Unpacking gpgconf (2.2.40-1.1) ... Selecting previously unselected package libksba8:amd64. Preparing to unpack .../02-libksba8_1.6.3-2_amd64.deb ... Unpacking libksba8:amd64 (1.6.3-2) ... Selecting previously unselected package libnpth0:amd64. Preparing to unpack .../03-libnpth0_1.6-3_amd64.deb ... Unpacking libnpth0:amd64 (1.6-3) ... Selecting previously unselected package dirmngr. Preparing to unpack .../04-dirmngr_2.2.40-1.1_amd64.deb ... Unpacking dirmngr (2.2.40-1.1) ... Selecting previously unselected package gnupg-l10n. Preparing to unpack .../05-gnupg-l10n_2.2.40-1.1_all.deb ... Unpacking gnupg-l10n (2.2.40-1.1) ... Selecting previously unselected package gnupg-utils. Preparing to unpack .../06-gnupg-utils_2.2.40-1.1_amd64.deb ... Unpacking gnupg-utils (2.2.40-1.1) ... Selecting previously unselected package gpg. Preparing to unpack .../07-gpg_2.2.40-1.1_amd64.deb ... Unpacking gpg (2.2.40-1.1) ... Selecting previously unselected package pinentry-curses. Preparing to unpack .../08-pinentry-curses_1.2.1-1_amd64.deb ... Unpacking pinentry-curses (1.2.1-1) ... Selecting previously unselected package gpg-agent. Preparing to unpack .../09-gpg-agent_2.2.40-1.1_amd64.deb ... Unpacking gpg-agent (2.2.40-1.1) ... Selecting previously unselected package gpg-wks-client. Preparing to unpack .../10-gpg-wks-client_2.2.40-1.1_amd64.deb ... Unpacking gpg-wks-client (2.2.40-1.1) ... Selecting previously unselected package gpg-wks-server. Preparing to unpack .../11-gpg-wks-server_2.2.40-1.1_amd64.deb ... Unpacking gpg-wks-server (2.2.40-1.1) ... Selecting previously unselected package gpgsm. Preparing to unpack .../12-gpgsm_2.2.40-1.1_amd64.deb ... Unpacking gpgsm (2.2.40-1.1) ... Selecting previously unselected package gnupg. Preparing to unpack .../13-gnupg_2.2.40-1.1_all.deb ... Unpacking gnupg (2.2.40-1.1) ... Selecting previously unselected package libonig5:amd64. Preparing to unpack .../14-libonig5_6.9.8-1_amd64.deb ... Unpacking libonig5:amd64 (6.9.8-1) ... Selecting previously unselected package libjq1:amd64. Preparing to unpack .../15-libjq1_1.6-2.1_amd64.deb ... Unpacking libjq1:amd64 (1.6-2.1) ... Selecting previously unselected package jq. Preparing to unpack .../16-jq_1.6-2.1_amd64.deb ... Unpacking jq (1.6-2.1) ... Selecting previously unselected package sqlite3. Preparing to unpack .../17-sqlite3_3.40.1-2_amd64.deb ... Unpacking sqlite3 (3.40.1-2) ... Selecting previously unselected package xxd. Preparing to unpack .../18-xxd_2%3a9.0.1378-2_amd64.deb ... Unpacking xxd (2:9.0.1378-2) ... Setting up libksba8:amd64 (1.6.3-2) ... Setting up libnpth0:amd64 (1.6-3) ... Setting up libassuan0:amd64 (2.5.5-5) ... Setting up xxd (2:9.0.1378-2) ... Setting up gnupg-l10n (2.2.40-1.1) ... Setting up gpgconf (2.2.40-1.1) ... Setting up libonig5:amd64 (6.9.8-1) ... Setting up sqlite3 (3.40.1-2) ... Setting up gpg (2.2.40-1.1) ... Setting up gnupg-utils (2.2.40-1.1) ... Setting up pinentry-curses (1.2.1-1) ... Setting up gpg-agent (2.2.40-1.1) ... Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-browser.socket → /usr/lib/systemd/user/gpg-agent-browser.socket. Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-extra.socket → /usr/lib/systemd/user/gpg-agent-extra.socket. Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-ssh.socket → /usr/lib/systemd/user/gpg-agent-ssh.socket. Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent.socket → /usr/lib/systemd/user/gpg-agent.socket. Setting up libjq1:amd64 (1.6-2.1) ... Setting up gpgsm (2.2.40-1.1) ... Setting up dirmngr (2.2.40-1.1) ... Created symlink /etc/systemd/user/sockets.target.wants/dirmngr.socket → /usr/lib/systemd/user/dirmngr.socket. Setting up gpg-wks-server (2.2.40-1.1) ... Setting up jq (1.6-2.1) ... Setting up gpg-wks-client (2.2.40-1.1) ... Setting up gnupg (2.2.40-1.1) ... Processing triggers for man-db (2.11.2-2) ... Processing triggers for libc-bin (2.36-9+deb12u8) ... * Configuring Docker daemon * Creating data directory /pds * Creating Caddy data directory * Creating Caddy config directory * Creating Caddy config file * Downloading PDS compose file * Starting the pds systemd service Created symlink /etc/systemd/system/default.target.wants/pds.service → /etc/systemd/system/pds.service. * Downloading pdsadmin ======================================================================== PDS installation successful! ------------------------------------------------------------------------ Check service status : sudo systemctl status pds Watch service logs : sudo docker logs -f pds Backup service data : /pds PDS Admin command : pdsadmin Required Firewall Ports ------------------------------------------------------------------------ Service Direction Port Protocol Source ------- --------- ---- -------- ---------------------- HTTP TLS verification Inbound 80 TCP Any HTTP Control Panel Inbound 443 TCP Any Required DNS entries ------------------------------------------------------------------------ Name Type Value ------- --------- --------------- pds.p9.pub A 195.192.118.6 *.pds.p9.pub A 195.192.118.6 Detected public IP of this server: 195.192.118.6 To see pdsadmin commands, run "pdsadmin help" ======================================================================== ### 是否添加账号,这里选择y开始设置账号,选择n的话后期可以通过pdsadmin account create来添加账号 Create a PDS user account? (y/N): y ## 设置邮箱 Enter an email address (e.g. [email protected]): [email protected] ## 设置账号名,注意格式jqx.pds.p9.pub Enter a handle (e.g. alice.pds.p9.pub): jqx.pds.p9.pub ## 账号添加完成 Account created successfully! ----------------------------- Handle : jqx.pds.p9.pub DID : did:plc:dgsdfgas34dfpqilzhutwbtvkg Password : qNiugTBUQ*******x7Bdwt ----------------------------- Save this password, it will not be displayed again. 验证PDS ...

十月 28, 2024 · JQX

完全删除Docker

在使用了docker一段时间后,会发现系统上各种容器乱七八糟,启动的,未启动的,正常运行的,异常的,搞得人不胜其烦。 下面是一次完全删除docker容器并删除docker本身的实例,可以完美解决以上问题。 查询并停止/删除当前运行容器 ➜ ~ docker ps -aq 80bb62721c12 # 停止当前运行容器 ➜ ~ docker stop $(docker ps -aq) 80bb62721c12 # 删除当前运行容器 ➜ ~ docker rm $(docker ps -aq) 80bb62721c12 删除所有image镜像 ➜ ~ docker rmi $(docker images -q) Untagged: traffmonetizer/cli_v2:latest Untagged: traffmonetizer/cli_v2@sha256:4fc48893746664471a1c386efabb5eba0537955fe5ecae871ed4a5e5c33ecf03 Deleted: sha256:3f82fd6f8f4f5ae49cf715a45db4abb3c0bef25be4d351ebe82e747f8641dd0b Deleted: sha256:d732b5c154d947acd46254d7c729eea712f5dd3e0518884a50cc4ada4da9706d Deleted: sha256:037fbfa145577a9bc6472afdf57979ff128102d42806eebc4dcdbc7eb0c91ff5 Deleted: sha256:e44bc785a3f33dea2990cff187bc1c2b7fea4fa9dfa24a6c3ad3e4c149e7aa80 Deleted: sha256:aa0a4b16279d7f4e301aa29ff8bb3fb2e5eaf2417e8119bd3c92f99da975d674 Deleted: sha256:54d0ead5d2a5dd2e830b333508445bc7e9cbed60b1ec4091d667c71349a9b31c Deleted: sha256:bd00ba4d604e3a30bba51756da10622d2242a8540dc03a46a07584575d736590 Deleted: sha256:d4fc045c9e3a848011de66f34b81f052d4f2c15a17bb196d637e526349601820 卸载docker ➜ ~ apt purge docker-ce Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: pigz Use 'apt autoremove' to remove it. The following packages will be REMOVED: docker-ce* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 109 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 64321 files and directories currently installed.) Removing docker-ce (5:27.2.0-1~debian.12~bookworm) ... (Reading database ... 64312 files and directories currently installed.) Purging configuration files for docker-ce (5:27.2.0-1~debian.12~bookworm) ... ➜ ~ apt purge docker-ce-cli Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: pigz Use 'apt autoremove' to remove it. The following packages will be REMOVED: docker-ce-cli* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 40.9 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 64310 files and directories currently installed.) Removing docker-ce-cli (5:27.2.0-1~debian.12~bookworm) ... Processing triggers for man-db (2.11.2-2) ... ➜ ~ apt purge docker-ce-rootless-extras docker-buildx-plugin Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: libslirp0 pigz slirp4netns Use 'apt autoremove' to remove them. The following packages will be REMOVED: docker-buildx-plugin* docker-ce-rootless-extras* 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. After this operation, 102 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 64111 files and directories currently installed.) Removing docker-buildx-plugin (0.16.2-1~debian.12~bookworm) ... Removing docker-ce-rootless-extras (5:27.2.0-1~debian.12~bookworm) ... ➜ ~ apt purge docker-compose-plugin Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: libslirp0 pigz slirp4netns Use 'apt autoremove' to remove them. The following packages will be REMOVED: docker-compose-plugin* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 63.3 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 64102 files and directories currently installed.) Removing docker-compose-plugin (2.29.2-1~debian.12~bookworm) ...

八月 29, 2024 · JQX

30个帮你提高效率的BASH别名

alias其实就是一个命令的快捷方式,为了将复杂的命令简化成简洁的样子。比如我们常用的ll命令其实就是ls -l命令的alias,这里的ll就是一个alias。 显示alias 使用alias显示当前所有别名,默认情况下将显示当前用户定义的所有alias $ alias alias ..='cd ..' alias ipython='winpty ipython.exe' alias ll='ls -l' alias ls='ls -F --color=auto --show-control-chars' alias ts='date +%s' 定义新的alias 定义新的alias方法如下: alias 名称=值 alias 名称='命令' alias 名称='命令 参数1 参数2' alias 名称='/路径/脚本' alias 名称='/路径/脚本.pl 参数1' 我们常用clear命令来清屏,但每次输入clear有点长,那么就可以为其定义一个简洁的alias。 alias c='clear' 通过以上操作,就为clear命令定义了一个名为c的alias,那么下次输入c命令就相当于执行了clear命令。 提示:可以将alias定义添加到~/.bashrc文件中以保证每次重启都会生效。 临时禁用alias 对于已经定义的alias可以使用以下方法临时禁用。 ## 命令完整目录 /usr/bin/clear ## 使用反斜杠忽略alias \c ## 使用/bin/ls命令并忽略ls的alias command ls 删除alias 想要删除已经定义的alias,就需要使用unalias命令,使用实例如下: ## 使用alias $ ll total 10 -rw-r--r-- 1 bbq 197121 411 Jun 10 2023 id_ed25519 -rw-r--r-- 1 bbq 197121 96 Jun 10 2023 id_ed25519.pub -rw-r--r-- 1 bbq 197121 1957 Aug 14 18:36 known_hosts -rw-r--r-- 1 bbq 197121 1109 Aug 6 15:23 known_hosts.old ## 删除alias $ unalias ll ## 提示alias不存在了 $ ll bash: ll: command not found 提示:如果你将alias添加到~/.bashrc文件中,记得也要删除。 ...

八月 19, 2024 · JQX

nvtop – Linux下一款强大的GPU任务监视器

nvtop 命令是基于 ncurses(新的 curses 库,在终端中显示信息)的 GPU 状态查看器,用于 AMD、Intel 和 NVIDIA GPU。换言之,您可以将此交互式 GPU 进程查看器用于 Linux 上的以下 GPU: 使用 amdgpu 驱动程序的 AMD GPU。 使用 i915 Linux 驱动程序的 Intel 显卡。 使用 NVIDIA 驱动程序的 Nvidia GPU 以及从 GeForce 600、GeForce 800M 和后续产品开始的任何东西都应该可以正常工作。 Qualcomm 开发的 Adreno GPU Apple GPU(M 系列) 在Linux上安装nvtop Arch Linux sudo pacman -Syu nvtop Gentoo Linux sudo layman -a guru sudo emerge -av nvtop Ubuntu Impish (21.10), Debian buster (stable) sudo apt update sudo apt install nvtop Fedora Linux version 36+ ...

八月 18, 2024 · JQX

find命令使用实例

find按名称搜索文件 $ find ./ -name dis55.csv ./dis55.csv ./shell/dis55.csv find按扩展名搜索文件 $ find ./ -name "*.TAB" ./dis54.TAB ./dis55.TAB ./ltebaseinfo.TAB ./newsite_nr.TAB ./nrbaseinfo.TAB find查找最近第7天修改过的文件 $ find ./ -mtime 7 ./ST_DOC/netcare_20240805083230.png find查找最近7天内修改过的文件 $ find ./ -mtime -7 ./ST_DOC/netcare_20240807084933.png ./ST_DOC/netcare_20240808083619.png ./ST_DOC/netcare_20240811130038.png ./ST_DOC/netcare_20240812083054.png ./ST_DOC/OP_SiteList.xlsx ./ST_DOC/OP_SiteList0807.xlsx ./ST_DOC/OP_SiteList0808.xlsx find查找超过7天修改过的文件 $ find ./ -mtime +7 ./ST_DOC/netcare_20240726081508.png ./ST_DOC/netcare_20240729085021.png ./ST_DOC/netcare_20240730091007.png ./ST_DOC/netcare_20240731082438.png ./ST_DOC/netcare_20240801091744.png ./ST_DOC/netcare_20240802082300.png ./ST_DOC/OP_SiteList0719.xlsx ./ST_DOC/OP_SiteList0722.xlsx ./ST_DOC/OP_SiteList0724.xlsx find查找并删除文件 $ ls dis55.TAB dis55.TAB $ find ./ -name "dis55.TAB" -delete $ ls dis55.TAB ls: cannot access 'dis55.TAB': No such file or directory find查找空文件或文件夹 $ find ./ -empty ./.git/objects/info ./.git/refs/tags ./newsite_lte.txt ./shell/template_lte_b1.txt ./shell/template_lte_b3.txt ./shell/template_lte_b5.txt find查找大小超过5M的文件 $ find ./ -size +5M ./.git/objects/pack/pack-5801296dc7e415dcea25931abee82177cde60377.pack ./ltebaseinfo.txt find查找指定用户的文件 $ find ./ -user bbq ./ST_DOC/test_image.docx ./ST_DOC/~$OP_SiteList.xlsx ./Template_PrjPara_NR_XY.xlsx ./wknote.md ./zombie_site.xlsx ./~$20240812_1723428772_NR-BSL.xlsx ./~$20240812_1723428780_NBR_4G.xlsx ./~$20240812_1723428780_NBR_5G.xlsx ./~$nr_ct_xy.xlsx ./~$SA_V15.xlsx find查找大小小于1k的文件 find ./ -size -1k ./4G_TAC_XY/xy_psite_lte_tac_20230317 ./5G_TAC_XY ./5G_TAC_XY/NR_TAC_XY ./lstmmls ./lte800_prj ./mml_templates find查找大小5M的文件 $ find ./ -size 5M ./ltebaseinfo.xlsx find查找指定权限的文件 $ find ./ -perm 0644 ./wknote.md ./zombie_site.xlsx ./~$20240812_1723428772_NR-BSL.xlsx ./~$20240812_1723428780_NBR_4G.xlsx ./~$20240812_1723428780_NBR_5G.xlsx ./~$nr_ct_xy.xlsx ./~$SA_V15.xlsx find查找指定文件并执行命令(压缩特定文件) find ./ -name "*.txt" -exec gzip {} \; find查找空文件并删除 $ find ./ -type f -empty -exec rm {} \; find查找文件并打印内容 $ find ./ -type f -exec ls -lh {} \; find查找文件并排除指定目录 $ find ./ -path "./shell" -prune -o -name "*.config" -print find查找15分钟内修改过的文件 $ find ./ -mmin -15 ./ ./lsmml.txt ./SA_V15.xlsx find查找文件打包压缩 find ./ -name "*.jpg" | xargs tar -czvf jpgs.gz find查找链接文件 $ find /usr/bin/ -type l

八月 12, 2024 · JQX