Nginx 服务器配置子域名

添加域名解析 到腾讯云服务器控制台,添加需要解析的子域名,如下图。图中第一个参数“主机记录”即为子域名名称。 配置Nginx server { # 端口设置 listen 80; # 二级域名设置 server_name ling.comfluter.life; # 301重定向设置 return 301 http://47.102.150.182/; } 增加一项二级域名设置即可。

November 28, 2021 · 1 min · Andyliu

树莓派配置NAS

挂载NTFS格式磁盘 貌似树莓派OS能够自动挂载NTFS磁盘到/media/pi下。不用额外操作。 使用SAMBA协议提供校园网内文件服务 安装SAMBA 安装SAMBA:sudo apt-get update && sudo apt-get install -y samba 查看SAMBA版本: root@raspberrypi:/media/pi/4T存储# samba --version Version 4.13.13-Debian

November 28, 2021 · 1 min · Andyliu

Including Verilog Code Block in Latex

include packages for code block and coloring \usepackage{listings} \usepackage{xcolor} insert following codes for defining verilog code coloring tactic. It should be inserted at the head field of the latex file (before \begin{document}). % for verilog code coloring \definecolor{vgreen}{RGB}{104,180,104} \definecolor{vblue}{RGB}{49,49,255} \definecolor{vorange}{RGB}{255,143,102} \lstdefinestyle{verilog-style} { language=Verilog, basicstyle=\small\ttfamily, keywordstyle=\color{vblue}, identifierstyle=\color{black}, commentstyle=\color{vgreen}, numbers=left, numberstyle=\tiny\color{black}, numbersep=10pt, tabsize=8, moredelim=*[s][\colorIndex]{[}{]}, literate=*{:}{:}1 } \makeatletter \newcommand*\@lbracket{[} \newcommand*\@rbracket{]} \newcommand*\@colon{:} \newcommand*\colorIndex{% \edef\@temp{\the\lst@token}% \ifx\@temp\@lbracket \color{black}% \else\ifx\@temp\@rbracket \color{black}% \else\ifx\@temp\@colon \color{black}% \else \color{vorange}% \fi\fi\fi } \makeatother \usepackage{trace} Insert your verilog code block using following codes:...

November 26, 2021 · 1 min · Andyliu

Linux 学习随记

开启root账户并配置SSH登录 修改root密码 sudo passwd root 修改SSH配置 sudo vi /etc/ssh/sshd_config 找到选项PermitRootLogin,将其前面的#去掉,即可使用SSH登录。若将后面的prohibit-password改为yes则可使用密码登录。 如果不选择密码登录,还需要通过其他账户登录,将authorized_keys复制到root账户的.ssh文件夹/root/.ssh下 Minutiae 使用taskset命令限定Linux下CPU逻辑核的使用对象及个数 linux下如何查看多核负载情况 LINUX下查看CPU使用率的命令

November 25, 2021 · 1 min · Andyliu

博客评论功能搭建

在王凯师兄的推荐下,使用gitalk搭建博客评论功能。 Github上申请OAuth application 登录github 在Settings页面选择Developer settings选项。 在Developer settings选择OAuth Apps,然后会在页面右边有一个New OAuth App按钮,点击这个按钮就进入到新建OAuth application页面 填写新建OAuth application相关信息: Application name:新建应用的名称 Homepage URL:The full URL to your application homepage. eg.https://comfluter.life/ Application description:对新建应用的描述 Authorization callback URL:回调链接,与Homepage URL保持一致即可。 注:这些参数可以在以后修改 点击注册应用,就可以看到Client ID,可以新建一个Client Secret Hugo 配置 使用stack主题,在配置文件config.yaml中已经预留了相关字段。 复制填写刚生成的Client ID,Client Secret。 repo: 类型:字符串,必填,github上的仓库名字,用于存放Gitalk评论 owner: 类型:字符串,必填,github仓库的所有者的名字 admin: 类型:数组(元素是字符串),必填,github仓库的所有者和合作者 (对这个 repository 有写权限的用户)。如果仓库有多个人可以操作,那么在这里以数组形式写出:['someone'] Debugging Error: Not Found. 尝试了修改Homepage URL为github pages页面,发现并没有用。 解决:存放评论的repo不能为private属性. 应该是一个public的代码库才可以使用Gitalk! References Gitalk评论插件使用教程

November 25, 2021 · 1 min · Andyliu

Verilog with vscode

linting using vscode extension Verilog-HDL/SystemVerilog/Bluespec SystemVerilog. using iverilog go to extension settings and set verilog > linting : linter = iverilog then the linting function should work for verilog files. Notice: the dir to verilog file should not contain chinese characters and spaces. if you imported module from other file without include command, iverilog willl report an error. As it is always the case when using vivado, add -i to extention setting Verilog › Linting › Iverilog: Arguments to ignore this error....

November 24, 2021 · 1 min · Andyliu

服务器配置CPU版ToD-BERT环境

Conda 复制已有环境 由于服务器上本身已经有使用CUDA平台的ToD-BERT运行环境,仅需将此环境中所有使用GPU的库换为使用CPU的库即可:pytorch 查看已有环境 (base) dialogue@amax-13:/$ conda info --env # conda environments: # base * /media/HD1/dche/miniconda3 sum_env /media/HD1/dche/miniconda3/envs/sum_env tod_bert /media/HD1/dche/miniconda3/envs/tod_bert /media/HD1/miniconda3 创建新环境,并将原有环境中的所有包复制,并激活新建立的环境。 (base) dialogue@amax-13:/$ conda create -n tod_bert_cpu --clone tod_bert Source: /media/HD1/dche/miniconda3/envs/tod_bert Destination: /media/HD1/dche/miniconda3/envs/tod_bert_cpu Packages: 20 Files: 12683 Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate tod_bert_cpu # # To deactivate an active environment, use # # $ conda deactivate (base) dialogue@amax-13:/$ conda activate tod_bert_cpu (tod_bert_cpu) dialogue@amax-13:/$ Conda配置环境中的包(卸载GPU版本、安装CPU版本) Conda 查看环境中所有包的信息...

November 24, 2021 · 5 min · Andyliu

Git large file versioning

Download git-lfs on https://git-lfs.github.com/, and run the installation package for windows. Once downloaded and installed, set up Git LFS for your user account by running:git lfs install. You only need to run this once per user account. In each Git repository where you want to use Git LFS, select the file types you’d like Git LFS to manage (or directly edit your .gitattributes). You can configure additional file extensions at anytime....

November 22, 2021 · 1 min · Andyliu

Numpy 学习随记

数组切片 import numpy as np a = np.array([[11, 12, 13], [21, 22, 23]], [31, 32, 33]) 注意Numpy中元素编号从0开始,左侧包含右侧不包含 取单个元素x = a[1, 2],对应第0维的第1个元素4 切片x = a[0:2, 1:3],对应第0维的第0~1个元素,第1维的第1~2个元素[[12 13], [22 23]] 切片x = a[:2, 2:],对应对应第0维的最开始到第2(2-1)个元素,第1维的第2个及以后的所有元素[[13], [23]] 判断一个数组是否存在于另一个大数组内 直接使用==会逐数字判断元素是否存在: import numpy as np a = np.array([[1, 2, 3], [2, 3, 4]]) print(a == np.array([1, 2, 3])) 可以改为(a == np.array([1, 2, 3])).all(1).any()。y == z会将y的每一行与z的每个元素进行比较。 使用all(axis=1)可以获取所有元素匹配的行,并使用any()找出是否匹配。 import numpy as np a = np.array([[1, 2, 3], [2, 3, 4]]) print(a == np....

November 22, 2021 · 1 min · Andyliu

PlantUML 学习随记

PlantUML with VsCode Install PlantUML extension for vscode. following extension follow me document: install java JRE install Graphviz download the latest plantuml.jar specify the jar location with the extension setting plantuml.jar specify the GraphViz installation by defining the Windows environment variable GRAPHVIZ_DOT, e.g., c:\program files\graphviz\bin\dot.exe

November 22, 2021 · 1 min · Andyliu