国内安装ohmyzsh的方法

REMOTE=https://gitee.com/mirrors/oh-my-zsh.git sh install.sh 首先安装zsh apt update&&apt ugprade -y apt install zsh -y 如果能够正常访问github.com和githubusercontent.com,那么使用如下命令即可安装ohmyzsh $ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" 如果无法访问github.com,那就建议使用gitee提供的国内镜像来安装,方法如下: git clone https://gitee.com/mirrors/oh-my-zsh.git cd oh-my-zsh/tools vi ./install.sh 找到install.sh中的REMOTE=${REMOTE:-https://github.com/${REPO}.git},将其修改为REMOTE=${REMOTE:-https://gitee.com/mirrors/oh-my-zsh.git},保存即可。 使用以下命令可便携修改: sed -i 's%https://github.com/ohmyzsh/ohmyzsh.git%https://gitee.com/mirrors/oh-my-zsh.git%g' oh-my-zsh/tools/install.sh 最后执行./install.sh就可以使用gitee镜像来安装ohmyzsh。 ➜ ~ neofetch _,met$$$$$gg. root@vmd ,g$$$$$$$$$$$$$$$P. -------- ,g$$P" """Y$$.". OS: Debian GNU/Linux 12 (bookworm) x86_64 ,$$P' `$$$. Host: Virtual Machine 7.0 ',$$P ,ggs. `$$b: Kernel: 6.1.0-37-amd64 `d$$' ,$P"' . $$$ Uptime: 1 hour, 31 mins $$P d$' , $$P Packages: 588 (dpkg) $$: $$. - ,d$$' Shell: zsh 5.9 $$; Y$b._ _,d$P' Resolution: 1024x768 Y$$. `.`"Y$$$$P"' Terminal: /dev/pts/1 `$$b "-.__ CPU: Intel i5-4310M (1) @ 2.693GHz `Y$$ GPU: 00:08.0 Microsoft Corporation Hyper-V virtual VGA `Y$$. Memory: 356MiB / 681MiB `$$b. `Y$$b. `"Y$b._ `""" ➜ ~

2020年11月1日 · bbq

Github Actions自动生成Hugo站点并部署到Github Pages

使用hugo建立建立个人网站可以参考使用hugo建立静态个人网站 使用github pages来部署个人网站可以参考GithubPages部署免费网站 下面将会介绍如何通过Github Actions来将以上两个操作关联在一起并自动化完成! github建立Repositories 建立一个0x8/ghsource.git属性为私有(private)的用来放置Hugo源码,然后再建一个0x8/0x8.github.io.git属性为公有(public)并设置Github Pages服务。 github设置Deploy keys与Secrets 使用ssh-keygen命令来生成私钥与公钥。 $ ssh-keygen.exe -t rsa -b 4096 -C "alairs@live.cn" #邮箱自定义 Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/alair/.ssh/id_rsa): #存放目录,可自定义 Created directory '/c/Users/alair/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /c/Users/alair/.ssh/id_rsa #私钥 Your public key has been saved in /c/Users/alair/.ssh/id_rsa.pub #公钥 The key fingerprint is: SHA256:ZiNPDGtAKC6MA alairs@live.cn The key's randomart image is: +---[RSA 4096]----+ | .. +o. | | . . o.. | | . + .... . | |o+ o o = .o . | |+EO o = S . . | |o B . % + . | | .o .oB * | | ...++ B | | ... .. o | +----[SHA256]-----+ 在0x8/0x8.gihub.io.git的设置中将公钥内容添加至Deploy keys,名称自定义,并勾选allow write access。 ...

2020年10月25日 · bbq

根据A列按格式聚合B列

原表如下内容: 需要输出为以下格式表格: 方法如下: 将A列升序排列,C2单元格写入=IF(A2=A1,B2&"/"&C1,B2),D2单元格写入=LEN(C2),结果如下: D列降序排列,数据->删除重复值->按名称去重,如下图: 完成后即可得到所需要的结果:

2020年10月16日 · bbq

网络文件系统SSHFS使用实例

什么是SSHFS? SSHFS是一个通过SSH连接到服务器的网络文件系统客户端。 SSHFS允许您使用SFTP挂载远程文件系统。 大多数VPS SSH服务器默认情况下都支持并启用此SFTP访问,因此SSHFS使用非常简单,无需在服务器端执行任何操作。 项目当前状态 SSHFS由所有主要的Linux发行版本提供,并且已经在多种系统上投入生产使用多年。 但是,目前SSHFS没有任何活动的常规贡献者,并且存在许多已知问题(请参阅Bugtracker)。 当前的维护者继续应用拉取请求并进行定期发布,但是不幸的是,除了解决高影响力的问题之外,它没有能力进行任何开发。 报告错误时,请理解,除非您包含拉取请求或报告严重问题,否则您可能不会得到响应。 安装SSHFS 首先,从https://github.com/libfuse/sshfs/releases下载最新的SSHFS版本。 在Linux和BSD上,您还需要安装libfuse 3.1.0或更高版本。 在macOS上,您需要OSXFUSE。 最后,您需要带有开发标头的Glib库(应该可以从操作系统的程序包管理器中获得)。 构建和安装,我们建议使用Meson(0.38版或更高版本)和Ninja。 解压缩sshfs tarball之后,创建一个(临时)构建目录并运行Meson: $ mkdir build; cd build $ meson .. 通常,默认的构建选项可以正常工作。 但是,如果您要调整它们,可以使用mesonconf命令进行: $ mesonconf # list options $ mesonconf -D strip=true # set an option 构建,测试和安装SSHFS,请使用Ninja(运行测试需要py.test Python模块): $ ninja $ python3 -m pytest test/ # optional, but recommended $ sudo ninja install CentOS安装sshfs简单方法 yum install -y epel-release yum -y install fuse-sshfs 使用SSHFS 安装了sshfs后,运行它就非常简单: sshfs [user@]hostname:[directory] mountpoint 建议以普通用户(而不是root)身份运行SSHFS。 为此,mountpoint必须归用户所有。 如果省略用户名,SSHFS将使用本地用户名。 如果省略目录,SSHFS将挂载(远程)主目录。 如果您需要输入密码,sshfs会要求您输入密码(实际上,它只是运行ssh,如果需要,它会要求输入密码)。 ...

2020年9月26日 · bbq

V2ray配置实例[最新v2fly]

Linux下推使用V2rayA,安装使用可参考V2rayA客户端使用实例 说明: 从V2Ray 4.27.0开始,请使用新版安装脚本,旧版安装配置实例仅供参考。 新版安装配置实例 服务端安装 下载安装脚本 ➜ ~ curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh 执行安装脚本 ➜ ~ bash ./install-release.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 98k 100 98k 0 0 495k 0 --:--:-- --:--:-- --:--:-- 495k info: Installing V2Ray v4.27.5 for x86_64 Downloading V2Ray archive: https://github.com/v2fly/v2ray-core/releases/download/v4.27.5/v2ray-linux-64.zip % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 644 100 644 0 0 5457 0 --:--:-- --:--:-- --:--:-- 5457 100 12.6M 100 12.6M 0 0 8316k 0 0:00:01 0:00:01 --:--:-- 10.2M Downloading verification file for V2Ray archive: https://github.com/v2fly/v2ray-core/releases/download/v4.27.5/v2ray-linux-64.zip.dgst % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 649 100 649 0 0 2368 0 --:--:-- --:--:-- --:--:-- 2368 100 590 100 590 0 0 1053 0 --:--:-- --:--:-- --:--:-- 1053 info: Extract the V2Ray package to /tmp/tmp.gWzZRTMMij and prepare it for installation. installed: /usr/local/bin/v2ray installed: /usr/local/bin/v2ctl installed: /usr/local/share/v2ray/geoip.dat installed: /usr/local/share/v2ray/geosite.dat installed: /usr/local/etc/v2ray/config.json installed: /var/log/v2ray/ installed: /var/log/v2ray/access.log installed: /var/log/v2ray/error.log installed: /etc/systemd/system/v2ray.service installed: /etc/systemd/system/v2ray@.service removed: /tmp/tmp.gWzZRTMMij info: V2Ray v4.27.5 is installed. //安装完成 You may need to execute a command to remove dependent software: dnf remove curl unzip Please execute the command: systemctl enable v2ray; systemctl start v2ray 配置systemd服务 ➜ ~ systemctl enable v2ray //添加systemd服务模块 Created symlink /etc/systemd/system/multi-user.target.wants/v2ray.service → /etc/systemd/system/v2ray.service. ➜ ~ systemctl start v2ray //开启v2ray服务 ➜ ~ service v2ray status //检查v2ray服务状态 Redirecting to /bin/systemctl status v2ray.service ● v2ray.service - V2Ray Service Loaded: loaded (/etc/systemd/system/v2ray.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2020-09-07 11:16:13 CST; 8s ago Main PID: 25897 (v2ray) Tasks: 6 (limit: 4566) Memory: 4.7M CGroup: /system.slice/v2ray.service └─25897 /usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json Sep 07 11:16:13 bwgcn2 systemd[1]: Started V2Ray Service. Sep 07 11:16:13 bwgcn2 v2ray[25897]: V2Ray 4.27.5 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.14.7 linux/amd64) Sep 07 11:16:13 bwgcn2 v2ray[25897]: A unified platform for anti-censorship. Sep 07 11:16:13 bwgcn2 v2ray[25897]: 2020/09/07 11:16:13 [Info] v2ray.com/core/common/platform/ctlcmd: <v2ctl message> Sep 07 11:16:13 bwgcn2 v2ray[25897]: v2ctl> Read config: /usr/local/etc/v2ray/config.json Sep 07 11:16:13 bwgcn2 v2ray[25897]: 2020/09/07 11:16:13 [Warning] v2ray.com/core: V2Ray 4.27.5 started 服务端配置 默认安装完成后,启用配置文件为/usr/local/etc/v2ray/config.json,但这个默认配置为空,因此需要自定义服务端配置。 ...

2020年9月7日 · bbq