Python3 + PyMySQL 的环境, 如果在数据库中写入中文, 会出现报错:
pymysql.err.InternalError: (1366, "Incorrect string value: '\\xE6\\xB5\\x8B\\xE8\\xAF\\x95' for column 'description' at row 1")
#!/bin/bash | |
# reference: https://stackoverflow.com/questions/4774054/reliable-way-for-a-bash-script-to-get-the-full-path-to-itself | |
currentDir=$( | |
cd $(dirname "$0") | |
pwd | |
) | |
echo -n "current " |
# reference https://stackoverflow.com/questions/6481005/how-to-obtain-the-number-of-cpus-cores-in-linux-from-the-command-line | |
cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l |
# listen ipv6 and ipv4 at the same time by gunicorn | |
# http://docs.gunicorn.org/en/stable/settings.html#bind | |
gunicorn -b 0.0.0.0:5000 -b '[::1]:5000' test:app |
// if you want to kill all processes match "pname" | |
ps aux | grep pname | grep -v grep | awk '{print $2}' | xargs kill |
git config --global core.sshCommand 'ssh -o ProxyCommand="nc -x 127.0.0.1:6489 %h %p"'
--unset
用法见文档, 未测试: https://git-scm.com/docs/git-config#git-config---unset
@mixin multiple-lines ($count) { | |
overflow: hidden; | |
text-overflow: ellipsis; | |
display: -webkit-box; | |
-webkit-line-clamp: $count; | |
/* autoprefixer: off */ | |
-webkit-box-orient: vertical; | |
/* autoprefixer: on */ | |
} |