MIME: Multipurpose Internet Mail Extension(多用途因特网邮件扩展)
https://blog.csdn.net/qq_26711103/article/details/81116900
https://www.bnxb.com/nginx/27092.html
https://blog.csdn.net/Leon_Jinhai_Sun/article/details/121048008
vim /> 新买的云,状的是centos8系统,使用起来发现文件内中文乱码。这个得解决。
一步一步往下走
查看你的语言是什么
echo $LANG
# 结果
zh_CN.UTF-8
**继续 **
localectl status
# 结果
System Locale: LANG=en_US.UTF-8
VC Keymap: us
X11 Layout: us
发现系统缺少中文包。弄起来。
yum search Chinese
# 结果
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 3:04:20 ago on Thu Aug 25 10:58:01 2022.
========================================== Name & Summary Matched: chinese ===========================================
ibus-table-chinese.noarch : Chinese input tables for IBus
=============================================== Name Matched: chinese ================================================
ibus-table-chinese-array.noarch : Array input methods
ibus-table-chinese-cangjie.noarch : Cangjie based input methods
ibus-table-chinese-cantonese.noarch : Cantonese input methods
ibus-table-chinese-easy.noarch : Easy input method
ibus-table-chinese-erbi.noarch : Erbi input method
ibus-table-chinese-quick.noarch : Quick-to-learn input methods
ibus-table-chinese-scj.noarch : Smart Cangjie
ibus-table-chinese-stroke5.noarch : Stroke 5 input method
ibus-table-chinese-wu.noarch : Wu pronunciation input method
ibus-table-chinese-wubi-haifeng.noarch : Haifeng Wubi input method
ibus-table-chinese-wubi-jidian.noarch : Jidian Wubi 86 input method, JiShuang 6.0
ibus-table-chinese-yong.noarch : YongMa input method
============================================== Summary Matched: chinese ==============================================
autocorr-zh.noarch : Chinese auto-correction rules
langpacks-zh_CN.noarch : Simplified Chinese langpacks meta-package
langpacks-zh_TW.noarch : Traditional Chinese langpacks meta-package
texlive-arphic.noarch : Arphic (Chinese) font packages
wqy-microhei-fonts.noarch : Compact Chinese fonts derived from Droid
那么,就装个中文包。
dnf install langpacks-zh_CN.noarch
修改本地语言环境。
vim /etc/locale.conf
# 填入
LANG=zh_CN.UTF-8
# 使生效
source /etc/locale.conf
某些场景,需要用户的 openid 以及 unionid,如何获取和转换就很有必要。获取公众号所有用户的 openid,通过公众号 openid 获取用户的 unionid。
获取公众号 openid
https://developers.weixin.qq.com/doc/offiaccount/User_Management/Getting_a_User_List.html
# 正常结果 json_decode 下的结构如下
{
"total":23000,
"count":10000,
"data":{"
openid":[
"OPENID1",
"OPENID2",
...,
"OPENID10000"
]
},
"next_openid":"OPENID10000"
}
通过 openid 获取用户的 unionid
有些时候,对于并发,我们只想执行一次。多次并发请求就打破了你的想。这里我们用 redis 来弄就好。
操作一波
这里以 laravel 为例
use Illuminate\Support\Facades\Redis;
$time = 60;
$key = 'mimi' . $user->id;
// 如果不存在就 set 值,返回 0 或 1,set 成了返回 1,否则返回 0(表示已经锁住了,不要进去了)
$res = Redis::setnx($key, $user->id);
if ($res) {
# 设置 redis 过期(锁的时间秒)
Redis::expire($key, $time);
# 你的业务
xxxxxx
}
laravel 并发处理,php 并发处理
zsh启动时需手动source ~/.zshrc的解决方法
vim ~/.zprofile
# 添加下边的命令,保存退出即可
source ~/.zshrc
LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443 处理
LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443 出这个错误。这么干:
git config --global --unset http.proxy
然后就好了。