Repo of my blog → Welcome visit :)
saltbo / blog Goto Github PK
View Code? Open in Web Editor NEWRepo of my blog
Home Page: https://saltbo.cn
License: MIT License
Repo of my blog
Home Page: https://saltbo.cn
License: MIT License
Repo of my blog → Welcome visit :)
需要一个识别纯印刷数字的功能,找了一圈没找到开源的,只有阿里云市场上有卖,价格不低。
听说IFTTT很厉害,试一下
监听GitHub,有更新则自动打包,打包结束自动部署到目标网络
cleos set account permission contract.eos setcode '{"threshold":1,"keys":[],"accounts":[{"permission":{"actor":"autoset.eos","permission":"eosio.code"},"weight":1}]}'
cleos set action permission contract.eos eosio setcode setcode
合约账号:contract.eos
部署账号:autoset.eos
专为markdown类博客服务的编辑器
微信云开发的控制台是数据库类的,实际使用中还是需要自行开发一个cms后台。
采用headless-cms的思路开发一款为小程序云开发使用的headless-cms。
初创企业野蛮生长,未来死了也无所谓,一旦成长起来,初期的混乱将为以后带来极大的麻烦。
psh login
psh ipsw.sh
// ipsw.sh是自己的写的脚本
可以一键执行一些快捷脚本,官方也会收录一些快捷脚本。
经常需要切换两个本地ip,每次都是打开网络设置改太麻烦了,想要写个脚本一键切换。
networksetup -setmanual "Ethernet" 192.168.128.54 255.255.255.0 192.168.128.1
#!/bin/bash
ips=("192.168.130.167" "192.168.143.242")
gate="192.168.143.254"
next_ip=${ips[0]}
current_ip=(`ipconfig getifaddr en0`)
if [ "${current_ip}" == ${next_ip} ]; then next_ip=${ips[1]}; fi
networksetup -setmanual "Wi-Fi" ${next_ip} 255.255.255.0 ${gate}
echo "${current_ip} => ${next_ip}"
仓库地址:https://github.com/saltbo/devenv/blob/master/shell/ipsw.sh
阿里云OSS针对js文件的gzip只对mime-type是application/javascript才有效。
在uptoc中使用了Golang的mime包,在本地测试时发现js对应的是application/javascript没有问题,但是在GitHubAction中却是text/javascript
经过排查发现,在Golang 1.14版本中已经将application/javascript替换成了text/javascript,具体详见golang/go@99df76f#diff-bbab6cb33189f1aa348f52c5ad910da8
排查过程中受到一个回答的误导,见https://cloud.tencent.com/developer/ask/52563
里面有人说text/javascript 已过时
,但实际情况是按照最新的HTML标准,即将废弃的是application/javascript,以后都应该使用text/javascript
1.0版本使用Vmess协议实现,保留接口后续有必要的话可以自行设计一套新的协议。
install.sh应该是一个普遍需求,搜了一圈没有找到通用的工具。
输入仓库地址即可为该仓库生成一个install.sh,使用者使用该install.sh即可完成安装操作
公司的VPN将所有的内网网段都加到了VPN的路由列表,导致连接VPN后无法调试本地网络。
给本地网段创建单独路由,强制不走VPN
ip route add 192.168.50.0 dev en1 scope link
使用GPG签名后每天提交总有几次需要输入密码,神烦。
为什么并不是每次提交都需要密码呢,实际上他有个默认的缓存时间,但是很短,所以我们可以把它改长。
# gpg-agent.conf
max-cache-ttl 60480000
default-cache-ttl 60480000
修改pinentry-program,mac下的pinentry-mac支持保存密码
# gpg-agent.conf
pinentry-program /usr/local/bin/pinentry-mac
pinentry-mac可能需要单独安装
可能也可以通过预设密码来解决,但是我试的时候总是报不支持,放弃
https://wiki.archlinux.org/index.php/GnuPG#Configuration
最近程序在docker里运行时,signal.Notify(sigChannel, syscall.SIGINT, syscall.SIGTERM)收不到信号了,导致发版时程序不能优雅关闭。
调查发现最忌的改动是把Dockerfile里的CMD由原先的bin文件改为了shell脚本。如下图:
经过搜索了解到,Docker stop的signal只会发给1号进程,CMD启动的就是1号进程。在本次案例中,本来CMD直接启动Bin文件,所以是可以直接收到Signal的。而改为Shell脚本后,Shell脚本是1号进程,由Shell脚本启动的Bin变成了x号进程。所以我们需要让Shell脚本收到的Signal转发给x号进程。
#!/bin/bash
prep_term()
{
unset term_child_pid
unset term_kill_needed
trap 'handle_term' TERM INT
}
handle_term()
{
if [ "${term_child_pid}" ]; then
kill -TERM "${term_child_pid}" 2>/dev/null
else
term_kill_needed="yes"
fi
}
wait_term()
{
term_child_pid=$!
if [ "${term_kill_needed}" ]; then
kill -TERM "${term_child_pid}" 2>/dev/null
fi
wait ${term_child_pid}
trap - TERM INT
wait ${term_child_pid}
}
run() {
./bin/server -mode cluster &
}
run_with_ddns() {
./launcher -name zt-ddgw-internal -port 8088 ./bin/server -mode cluster &
}
prep_term
if [ $RUN_WITH_DDNS ]; then
run_with_ddns
else
run
fi
wait_term
把日常查询翻译过的单词收集起来。
基于这个单词收集库,开发一个浏览器插件,每日随机时间弹出要求回答单词的含义(类似多邻国的答题)
能否设计一个完全插件化的私人云系统,类似梅林的软件中心。
解决程序员们总想开发个什么东西,但每次都得从头开始的问题
RT
一个启动器(通过os.exec来启动另一个进程)收到signal后需要进行一个处理逻辑再结束掉子进程,但是默认情况下父子进程同时收到了信号。
cmd.SysProcAttr = &syscall.SysProcAttr{
Setpgid: true,
}
*nix环境中, 由exec.command开启的子进程的进程组ID默认为为父进程ID,需设置子进程的进程组ID为子进程自身ID
The workflow main.yml is referencing action actions/checkout using references v1. However this reference is missing the commit a6747255bd19d7a757dbdda8c654a9f84db19839 which may contain fix to the some vulnerability.
The vulnerability fix that is missing by actions version could be related to:
(1) CVE fix
(2) upgrade of vulnerable dependency
(3) fix to secret leak and others.
Please consider to update the reference to the action.
莫名其妙突然不能使用快捷键复制粘贴了,cmd+c输出çççç,cmd+v输出√√√√
cmd和alt键的功能发生了互换导致。互换的原因可能有很多,我遇到的是因为我按了fn+f12,这个组合键在我的机械键盘上的就是将cmd和alt的功能互换。
test
需要输出一个百分比进度,但是百分号是作为占位符的。经过测试发现%并不可行。
使用双百分号%%
即可输出%
仅实现rust标准库没有的。
rust标准库已有,但是和golang用法不一致的情况,原则上不再重复实现,仅做备注提示。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.