XiaoFeng | 筱枫

tar Command Notes

Original link: https://hsiaofeng.com/archives/197.html A memo about the tar command. -c 压缩-x 解压-z 有gzip属性的-f 后跟档案名 tar -czf name.tar.gz path/* tar -xzf name.tar.gz This article is reproduced from: https://hsiaofeng.com/archives/197.html This site is for inclusion only, and the copyright belongs to the original author.

Let’s Encrypt Certificate Migration

Original link: https://hsiaofeng.com/archives/195.html Packaging the certificate on the origin server cd /etc/letsencrypt tar zcf letsencrypt.tar.gz archive live renewal Release the certificate on the new server cd /etc/letsencrypt tar zxf letsencrypt.tar.gz This article is reproduced from: https://hsiaofeng.com/archives/195.html This site is for inclusion only, and the copyright belongs to the original author.

Entr detects and modifies auto-execute commands

Original link: https://hsiaofeng.com/archives/192.html screen ls * | entr bash build.sh To leave Screen, press Ctrl+A followed by Ctrl+D . Go back to Screen, use screen -ls screen -r xxx This article is reproduced from: https://hsiaofeng.com/archives/192.html This site is for inclusion only, and the copyright belongs to the original author.

Convert to WebP with FFmpeg

Original link: https://hsiaofeng.com/archives/191.html use case ffmpeg -i “t.jpg” -compression_level 0 -quality 80 -preset photo “[email protected]” Batch: 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” official …

Convert to WebP with FFmpeg Read More »

Easy Python Tutorial

Original link: https://hsiaofeng.com/archives/190.html This is a tutorial for coping with the middle school exam. It aims to quickly learn some basic Python operations and cope with the exam. Take a simple math problem as an example: A bottle of Coke costs 3 yuan, and Xiao Ming bought 2 bottles. How much does he have to …

Easy Python Tutorial Read More »

What exactly is the garbled SSH connection failure?

Original link: https://hsiaofeng.com/archives/186.html connect to the server, prompt ssh: Could not resolve hostname xxx.xyz: \262\273\326\252\265\300\325\342\321\371\265\304\326\367\273\372\241\243 Preliminary conversion with Python print(“\262\273\326\252\265\300\325\342\321\371\265\304\326\367\273\372\241\243″) get string ²»ÖªµÀÕâÑùµÄÖ÷»ú¡£ Check the table below, it belongs to “symbol code”, it may be ISO-8859-1 code now. Store it in ISO-8859-1 encoding with VSCode, then open it with GBK, and finally get the string …

What exactly is the garbled SSH connection failure? Read More »

Jinja2 UTF-8 garbled solution

Original link: https://hsiaofeng.com/archives/185.html original code with open(f”file.j2″,’w+’) as fout: content = template.render() fout.write(content) solution Change w+ at open() to wb , and call encode(‘utf-8′) after template.render() ). with open(f”file.j2″,’wb’) as fout: content = template.render().encode(‘utf-8’) fout.write(content) This article is reproduced from: https://hsiaofeng.com/archives/185.html This site is for inclusion only, and the copyright belongs to the original author.

Debian configuration tutorial collection

Original link: https://hsiaofeng.com/archives/184.html LNMP https://www.vultr.com/docs/how-to-install-nginx-mariadb–php-lemp-on-debian-11-99568 WWW Jump https://www.vultr.com/docs/nginx-redirects-for-non-www-sub-domains-to-www This article is reproduced from: https://hsiaofeng.com/archives/184.html This site is for inclusion only, and the copyright belongs to the original author.