Hugo常用命令 Li.023

本篇文章属于Hugo学习路线Li.028一部分 Hugo 常用命令. 官网参考地址 # 查询所有命令 hugo -h # 创建Hugo 静态网站 hugo new site mywebsite # 创建文章, 当前必须mywebsite下才可创建文章 # 创建的文章存放在 mywebsite/content/p/test.md下 # 使用命令创建的hogo可以监控到, 实时显示到预览上 hugo new p/test.md # 启动服务, 必须在mywebsite文件夹下启动 hugo server # 草稿也预览, -D 参数, 必须在mywebsite文件夹下启动 hugo -D server # 指定预览的主题, 必须在mywebsite文件夹下启动 # papermod是在themes文件夹下的主题名称 hugo -D server --theme=papermod # 指定预览的端口 hugo -D server --port=1313 # 指定服务绑定在哪个端口, 比如你想在手机预览, 电脑手机同一局域网时 # 电脑ip 192.168.1.20, 手机访问192.168.1.20就能看到预览 hugo -D server --bind="192.168.1.20" --port=80 # 指定预览的默认地址, http://192.168.1.20:1313 错误示例 hugo -D server --baseUrl="http://192.168.1.20/" --port=1313 # 访问不到, 没有绑定ip, 访问http://192.168.1.20:1313失败, 访问localhost:1313则显示 # 访问任意链接被定位到http://192.168.1.20:1313上 正确做法,绑定当前ip,提醒baseUrl最后结尾必须是'/' hugo -D server --baseUrl="http://192.168.1.20/" --port=1313 --bind="192.168.1.20" # 指定配置文件 hugo -D server --config=config.yml # 指定输出静态博客网站的目录lizicai.com, 再次提醒baseUrl最后一位是/ hugo --theme=papermod --baseUrl="https://lizicai.com/" --destination="lizicai.com" --config=config.yml

July 31, 2021 · 1 分钟 · Lizicai

RSS和一些RSS订阅网站 Li.022

1. RSS是什么 RSS 全称是Really Simple Syndication 简易信息聚合, 在一个软件中可以看到所有订阅网址更新内容. 2. 为什么会有RSS 没有RSS, 如果你要A B C D网站信息, 需要一个个上去看看有没有更新, 这样无疑很费时 如果有软件能订阅你感兴趣的A B C D网站, 只用在一个软件查看就看到4个网站的更新内容, 这就是RSS重要作用了 3. 苹果iPhone 和 安卓Android RSS 应用. iPhone Netnewswire (不需要的默认订阅可以删除) Android Read 4. 一些RSS订阅网站, 写独立博客人变少了… 阮一峰 https://www.ruanyifeng.com/blog/ https://feeds.feedburner.com/ruanyifeng 陈浩 coolshell.cn https://coolshell.cn/feed 少数派 sspai.com https://sspai.com/feed

July 29, 2021 · 1 分钟 · Lizicai

ZV-E10索尼2021年7月27日22点发布的新机 Li.019

SONY ZV-E10 1. ZV-E10 使用APS-C传感器, 作为对比ZV 1使用1英寸传感器. 尺寸大了3倍, APS-C(23.6mm*15.6mm)/1英寸(13.2mm*8.8mm)=3.17 ZV-E10 对比 ZV 1传感器尺寸 2. ZV-E10镜头使用E卡口, 意味超过60组原厂镜头可用, 副厂也有适马腾龙 3. ZV-E10使用与全画幅一样的数字音频热靴Mi接口, 直接使用ECM-W2BT麦克风 4. ZV-E10支持S-Log3 5. 可以用作视频会议, 支持USB type c接口. 6. 其他改进    更好的肤色表现    更好的麦克风, 防风性能更好    改进的产品展示功    表现更好的电子视频防抖

July 27, 2021 · 1 分钟 · Lizicai

acme.sh命令 Li.018

1. acme.sh 常见命令 # 查询所有命令 acme.sh -h # acme.sh更改申请证书机构 acme.sh --set-default-ca --server letsencrypt # http方式申请证书, lizicai.com域名, --webroot指定访问文件夹 acme.sh --issue -d lizicai.com --webroot /root/test/ # 手动dns申请证书 acme.sh --issue --dns -d lizicai.com # 使用dns提供接口, 自动dns申请证书, 以阿里云为例 export Ali_Key="Ali_Key" export Ali_Secret="Ali_Secret" acme.sh --issue --dns dns_ali -d lizicai.com # Cloudflare 为例 export CF_Key="你的Global API Key" export CF_Email="注册Cloudflare邮箱" acme.sh --issue --dns dns_cf -d \*.lizicai.com # 检查并更新所有证书 acme.sh --cron # 设置更新证书通知, 以钉钉 dingtalk通知为例 export DINGTALK_WEBHOOK='复制的Webhook' export DINGTALK_KEYWORD=acme acme.sh --set-notify --notify-hook dingtalk # 设置通知级别 # --notify-level <0|1|2|3> # Set the notification level: Default value is 2. # 0: disabled, no notification will be sent. 没有通知 # 1: send notifications only when there is an error. 有错误时才通知 # 2: send notifications when a cert is successfully renewed, or there is an error. 证书更新成功或错误才通知. # 3: send notifications when a cert is skipped, renewed, or error. 跳过证书, 更新证书, 错误都有通知. export NOTIFY_LEVEL='3' # 设置acme.sh 自动升级 acme.sh --upgrade --auto-upgrade 1 # 卸载acme.sh, 并删除所有acme.sh添加crontab任务. acme.sh --uninstall # 证书key和fullchain另存, 在获取证书时一起使用 --key-file /root/cert/lizicai.com/private.key --fullchain-file /root/cert/lizicai.com/fullchain.pem # 获取证书时使用, 可执行的一些命令 --reloadcmd "/usr/sbin/nginx -s reload" # 重新获取证书, 获取证书时使用 -r, --renew # 强制 -f 2. 具体使用可 参考acme.sh获取证书crontab更新及更新通知

July 27, 2021&nbsp;·&nbsp;1 分钟&nbsp;·&nbsp;Lizicai

acme.sh获取证书 设置crontab定时检查更新及更新通知 Li.017

1. acme.sh 是什么 1.1 一个纯粹用Shell(Unix shell)语言编写的ACME协议客户端. 支持shell就能安装. 1.2 支持非盈利证书颁发机构 letsencrypt.org , 可以自由获取免费证书. 1.3 可以自动更新证书. 1.4 支持主流的DNS服务商(DNSPod.cn(腾讯旗下) 阿里云 Cloudflare GoDaddy Amazon), 可申请通配符的证书. 全部DNS服务商支持列表 1.5 支持每次更新证书时发送通知, 支持主流QQ Dingtalk钉钉 Telegram Email Slack, 完整支持列表 2. 安装acme.sh, 设置默认证书分发机构为letsencrypt.org. 2.1 安装acme.sh curl https://get.acme.sh | sh -s [email protected] 2.2 设置默认证书分发机构为letsencrypt.org, 原因非盈利机构letsencrypt目前为止比较安全. ZeroSSL则是商业机构. 更多解释 . acme.sh --set-default-ca --server letsencrypt 3. 申请证书常用方式. http和dns方式. 3.1 http方式, 特点简单易操作.    以Nginx为例, 配置的文件夹/root/test/ 在default.conf增加配置 server{ listen 80; server_name lizicai.com; location / { root /root/test/; index index.html index.htm; } }    确认lizicai.com 解析a记录指向服务器ip 在域名服务商或DNS服务商增加lizicai.com指向服务ip的a记录. ...

July 26, 2021&nbsp;·&nbsp;2 分钟&nbsp;·&nbsp;Lizicai

SQL基本用法二 Li.016

1. 创建表 create table if not exists usrinfo( id INT(11), number INT(11), name VARCHAR(255), birthday DATE ); 2. 查询表结构 show full columns from usrinfo; desc usrinfo; describe usrinfo; 3. 查询创建表的语句 show create table usrinfo; 4. 插入数据 4.1 插入单选数据 insert into usrinfo values (12123123,"hello","1990-02-15"); 4.2 插入多行数据 insert into usrinfo values (12123123,"hello","1990-02-15"), (12123123,"cc","1991-03-01"); 4.3 插入某些列 insert into usrinfo(number,name) values (121234123,"eefef"); 4.4 插入某些列多行 insert into usrinfo(number,name) values (121234123,"eefef"), (121234123,"eefef"); 5. 查询某一列不重复的值 select distinct number from usrinfo; 6. 增加新的列 6.1 增加新列 alter table usrinfo add id int(11); 6.2 并给修改新列的属性 alter table usrinfo change id id int not null auto_increment primary key; 6.3 更改新加列的排序: 把id这列,放到第1列 ...

July 26, 2021&nbsp;·&nbsp;6 分钟&nbsp;·&nbsp;Lizicai

SQL基本用法一 Li.015

1. 建立表 4个表关系 1.学生表 Student(s_id,s_name,s_birth,s_sex) –学生编号,学生姓名, 出生年月,学生性别 2.课程表 Course(c_id,c_name,t_id) – –课程编号, 课程名称, 教师编号 3.教师表 Teacher(t_id,t_name) –教师编号,教师姓名 4.成绩表 Score(s_id,c_id,s_s_score) –学生编号,课程编号,分数 -- 学生表 CREATE TABLE Student( s_id VARCHAR(20), s_name VARCHAR(20) NOT NULL DEFAULT '', s_birth VARCHAR(20) NOT NULL DEFAULT '', s_sex VARCHAR(10) NOT NULL DEFAULT '', PRIMARY KEY(s_id) ); -- 课程表 CREATE TABLE Course( c_id VARCHAR(20), c_name VARCHAR(20) NOT NULL DEFAULT '', t_id VARCHAR(20) NOT NULL, PRIMARY KEY(c_id) ); -- 教师表 CREATE TABLE Teacher( t_id VARCHAR(20), t_name VARCHAR(20) NOT NULL DEFAULT '', PRIMARY KEY(t_id) ); -- 成绩表 CREATE TABLE `Score`( s_id VARCHAR(20), c_id VARCHAR(20), s_score INT(3), PRIMARY KEY(s_id,c_id) ); 1.1 插入对应的数据 -- 插入学生表测试数据 insert into Student values('01' , '赵雷' , '1990-01-01' , '男'); insert into Student values('02' , '钱电' , '1990-12-21' , '男'); insert into Student values('03' , '孙风' , '1990-05-20' , '男'); insert into Student values('04' , '李云' , '1990-08-06' , '男'); insert into Student values('05' , '周梅' , '1991-12-01' , '女'); insert into Student values('06' , '吴兰' , '1992-03-01' , '女'); insert into Student values('07' , '郑竹' , '1989-07-01' , '女'); insert into Student values('08' , '王菊' , '1990-01-20' , '女'); insert into Student values('09' , '如花' , '1991-02-15' , '女'); -- 课程表测试数据 insert into Course values('01' , '语文' , '02'); insert into Course values('02' , '数学' , '01'); insert into Course values('03' , '英语' , '03'); insert into Course values('04' , '体育' , '01'); -- 教师表测试数据 insert into Teacher values('01' , '张三'); insert into Teacher values('02' , '李四'); insert into Teacher values('03' , '王五'); -- 成绩表测试数据 insert into Score values('01' , '01' , 80); insert into Score values('01' , '02' , 90); insert into Score values('01' , '03' , 99); insert into Score values('02' , '01' , 70); insert into Score values('02' , '02' , 60); insert into Score values('02' , '03' , 80); insert into Score values('03' , '01' , 80); insert into Score values('03' , '02' , 80); insert into Score values('03' , '03' , 80); insert into Score values('04' , '01' , 50); insert into Score values('04' , '02' , 30); insert into Score values('04' , '03' , 20); insert into Score values('05' , '01' , 76); insert into Score values('05' , '02' , 87); insert into Score values('06' , '01' , 31); insert into Score values('06' , '03' , 34); insert into Score values('07' , '02' , 89); insert into Score values('07' , '03' , 98); insert into Score values('09', '01', 50); insert into Score values('09', '02', 40); insert into Score values('09', '03', 90); insert into Score values('09', '04', 99); 2. SQL练习 查询姓"张"老师的个数 select count(t_id) from Teacher where t_name like "张%"; 查询1990年出生的学生名单 select s_id, s_name from Student where year(s_birth)=1990; 查询课程编号为"02"的总成绩 select c_id,sum(s_score) as '总成绩' from Score where c_id=02; 查询选了课程的学生人数 思路学生唯一, 然后再计算总数 select count(distinct s_id) as "选课人数" from Score; 查询各科成绩最高和最低的分: 以如下的形式显示: 课程ID, 最高分, 最低分 select c_id as 课程ID, max(s_score) as 最高分, min(s_score) as 最低分 from Score group by c_id; 查询每门课程被选修的学生数 select c_id, count(s_id) from Score group by c_id; 查询男生,女生人数 select s_sex as 性别, count(s_id) as 人数 from Student group by s_sex; 查询平均成绩大于60分的学生的学号和平均成绩 学号与平均成绩都在Score表中可以获取到 ...

July 26, 2021&nbsp;·&nbsp;8 分钟&nbsp;·&nbsp;Lizicai

MariaDB MySQL连接的2种常见错误 Li.014

1. 常见MySQL Mariadb连接的2种错误 1.1 错误一 ERROR 1045 (28000): Access denied for user 'usera'@'localhost' (using password:YES) 1.2 错误二 ERROR 1045 (28000): Access denied for user 'usera'@'localhost' (using password:NO). 2. 错误一 常见错误是密码错误 重置密码即可 3. 错误二 输入账号密码时没有输入密码. 3.1 命令行中没有-p进行无密码登录 3.2 如果是IDE中的yaml文件确定password的缩进正确 cat application.yaml spring: datasource: driver-class-name: org.mariadb.jdbc.Driver url: jdbc:mariadb://localhost:3306/admin username: admin password: 123456 上面的password缩进错误, 就会提示(using password:No) 正确的是 spring: datasource: driver-class-name: org.mariadb.jdbc.Driver url: jdbc:mariadb://localhost:3306/admin username: admin password: 123456

July 25, 2021&nbsp;·&nbsp;1 分钟&nbsp;·&nbsp;Lizicai