Linux 配置 ssh-agent 自动运行
发现每次连接 GitHub 出现 SSH 错误,缘由是 ssh-agent 未运行。
枫茶舍
这里筱枫~
发现每次连接 GitHub 出现 SSH 错误,缘由是 ssh-agent 未运行。
screen
ls * | entr bash build.sh
离开 Screen ,按下Ctrl+A
后按下Ctrl+D
。
回到 Screen ,使用
screen -ls
screen -r xxx
ffmpeg -i "t.jpg" -compression_level 0 -quality 80 -preset photo "t@80.webp"
批处理:
for /f "tokens=1 delims=." %%a in ('dir /B *.png') do ffmpeg -y -i "%%a.png" -compression_level 0 -preset picture "%%a.webp"
for /f "tokens=1 delims=." %%a in ('dir /B *.jpg') do ffmpeg -y -i "%%a.jpg" -compression_level 0 -preset picture "%%a.webp"
https://ffmpeg.org/ffmpeg-codecs.html#libwebp
-lossless boolean
Enables/Disables use of lossless mode. Default is 0.
-compression_level integer
For lossy, this is a quality/speed tradeoff. Higher values give better quality for a given size at the cost of increased encoding time. For lossless, this is a size/speed tradeoff. Higher values give smaller size at the cost of increased encoding time. More specifically, it controls the number of extra algorithms and compression tools used, and varies the combination of these tools. This maps to the method option in libwebp. The valid range is 0 to 6. Default is 4.
-quality float
For lossy encoding, this controls image quality. For lossless encoding, this controls the effort and time spent in compression. Range is 0 to 100. Default is 75.
-preset type
Configuration preset. This does some automatic settings based on the general type of the image.
none
Do not use a preset.
default
Use the encoder default.
picture
Digital picture, like portrait, inner shot
photo
Outdoor photograph, with natural lighting
drawing
Hand or line drawing, with high-contrast details
icon
Small-sized colorful images
text
Text-like
这是一篇应对中学阶段会考的教程,旨在快速学会一些基本的Python操作,应付考试。
近日连接服务器,偶有提示错误,系一串三位数八进制字符代码组成的字符串,意义不明。特进行译码。
生成的文件以 GBK 方式编码,但期望以 UTF-8 读取,导致乱码。
一些配置 Debian 服务器的实用步骤。
显示错误:
adduser: command not found
编辑配置文件的 Port
:
vi /etc/ssh/sshd_config
放行端口:
iptables -A INPUT -p tcp --dport 端口号 -j ACCEPT
保存并重启 SSH 服务:
iptables-save > /etc/iptables.up.rules
/etc/init.d/ssh restart
在面板申请 Let's Encrypt 证书后,虽然显示申请成功,但常常会出现并没有被正确添加的情况。其实已经申请完毕,只是没有被面板识别到,此时可以手动添加证书文件。
打开服务器目录
/www/server/panel/vhost/letsencrypt/
找到以域名命名的文件夹,进入后找到privkey.pem
和fullchain.pem
两个文件,复制其内容。
在站点修改 SSL 的窗口中,选“其他证书”,在“密钥(KEY)”粘入privkey.pem
的内容,在“证书(PEM格式)”粘入fullchain.pem
的内容,保存即可。
调整字体大小,使用自定义CSS:
.MathJax span {
font-size: 20px
}
有时需要导航栏对当前页面所述栏目高亮,可在 Jinja2 中使用下述方法。
在模板页base.j2.html
写入导航栏的基本情况:
{% set nav_bar = [
('/', 'index', '主页'),
('/price', 'price', '价格'),
('/about', 'about', '关于')
] -%}
{% set active_page = active_page|default('index') -%}
{# 设置 active_page 变量的默认值是 index,即不指定高亮页面的情况下主页高亮 #}
...
<div class="navbar-nav">
{% for href, id, caption in nav_bar %}
<a class="nav-link{% if id == active_page %} active{% endif %}" aria-current="page" href="{{ href|e }}">{{ caption|e }}</a>
{% endfor %}
</div>
随后在指定页面设置变量即可。
{% set active_page = 'price' %}