blog icon indicating copy to clipboard operation
blog copied to clipboard

涵曦的博客

Results 94 blog issues
Sort by recently updated
recently updated
newest added

https://stackoverflow.com/questions/12919980/nohup-is-not-writing-log-to-output-file ``` export PYTHONUNBUFFERED=1 nohup ./cmd.py > cmd.log & ``` or ``` nohup python -u ./cmd.py > cmd.log & ``` https://docs.python.org/2/using/cmdline.html#cmdoption-u

1. download perl from http://strawberryperl.com/ and install. 2. download openssl source from https://www.openssl.org/source/ and unpress. 3. add `build.bat` file and run it. ``` set cur_dir=%~dp0 if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"...

## 起因 本来一直没想过还会在 windows 下开发的,但是一想到我的处理 Excel 的转表工具可能需要提供给策划本地使用,我就想方设法了,安装 mingw 的话应该更好解决,但是不了解发布版需不需要安装 mingw,而且刚好电脑已经安装好了 vs。所以就有了这篇文章。其实不用 nmake ,完全用 cl 和 link 命令也是可以的。只不过 nmake 和 make 一样,更适合管理。 ## 编译 Lua 为了能编译并使用扩展,需要在生成 `.dll` 的时候生成 `.lib` 文件。生成 DLL...

教程
Lua

copy from https://juejin.im/post/5aefeb6e6fb9a07aa43c20af ```js window.Clipboard = (function(window, document, navigator) { var textArea, copy; // 判断是不是ios端 function isOS() { return navigator.userAgent.match(/ipad|iphone/i); } //创建文本元素 function createTextArea(text) { textArea = document.createElement('textArea'); textArea.value =...

http://www.ruanyifeng.com/blog/2018/07/json_web_token-tutorial.html https://newsn.net/say/github-oauth-flow.html https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/

0. 关掉 T1 盒子和电视的电源 1. 同时按下T1遥控器(左)及(音量-)键,直至指示灯长亮 2. 按一下T1遥控器的(TV)键,跟着指示灯会闪烁,这个时候两个遥控器头对头(距离4-5CM就可以),长按电视遥控(开关)键,留意T1遥控器的指示灯会由闪烁>>长亮>>再闪烁>>熄灭,这个时候学习完成。 from https://www.right.com.cn/forum/forum.php?mod=viewthread&tid=265993&extra=page%3D1%26filter%3Dtypeid%26typeid%3D17

玩具

### JS ArrayBuff to Base64 ```js function _arrayBufferToBase64( buffer ) { var binary = ''; var bytes = new Uint8Array( buffer ); var len = bytes.byteLength; for (var i =...

Javescript
Python

使用 [wait-for-it](https://github.com/vishnubob/wait-for-it) 脚本,监听某个容器的端口. 比如: ```yaml version: '2' # ports: 2600 services: mongodb: image: mongo:3.4-xenial container_name: mongodb restart: always ports: - "27017:27017" volumes: - ../data/mongo/db:/data/db web: image: xxx command: ["/wait-for-it.sh", "mongodb:27017",...

Docker

## 读取配置文件 比如配置文件是这样的: ``` token=abcd enckey=xyz ``` ```bash function get_config() { echo $(awk -F "=" '/^'$1'/ {print $2}' $config) } token=$(get_config token) enckey=$(get_config enckey) ``` ## 输出多行字符串 ```bash function usage()...

Linux

应用场景: 用于复杂计算的服务,可伸缩的控制服务的数量,比如高峰期到来时开启更多的服务,高峰过后需要回收的服务。 这里只演示无状态的服务,有状态的服务处理更复杂。 1. 给一堆相同的无状态服务(calculate)用个管理器(calculate_mng)管理起来 2. calculate_mng 作为入口供其他服务器调用 3. calculate_mng 对 calculate 服务有生杀大权 ### 如何正确的退出服务? 这里有讲到退出服务的接口 [Skynet 服务的启动和退出](https://github.com/cloudwu/skynet/wiki/LuaAPI#%E6%9C%8D%E5%8A%A1%E7%9A%84%E5%90%AF%E5%8A%A8%E5%92%8C%E9%80%80%E5%87%BA) > skynet.exit() 用于退出当前的服务。skynet.exit 之后的代码都不会被运行。而且,当前服务被阻塞住的 coroutine 也会立刻中断退出。这些通常是一些 RPC 尚未收到回应。所以调用 skynet.exit() 请务必小心。 > skynet.kill(address)...

Skynet