2022年9月16日

Find and Replace in Vim / Vi

摘要: Find and Replace in Vim / Vi 命令格式 :[range]s/{pattern}/{string}/[flags] [count] 可以在normal 模式下输入 :help substitute 查看帮助文档 | 示例 | 释义 | | | | | :s/Foo/bar/ 阅读全文

posted @ 2022-09-16 15:35 明天有风吹 阅读(36) 评论(0) 推荐(0) 编辑

2022年9月13日

github codespace quickly setup a ladder(ssserver)

摘要: #!/usr/bin/env bash gh cs ssh --codespace your-repository-temporary-xxxx "/home/codespace/.cargo/bin/ssserver -d -c /workspaces/your-ssserver-director 阅读全文

posted @ 2022-09-13 16:07 明天有风吹 阅读(53) 评论(0) 推荐(0) 编辑

2022年9月10日

some learning resource

摘要: interesting blogs https://johanhelsing.studio/ https://gafferongames.com/ https://wizardzines.com/ https://margin.re/blog/ https://web.stanford.edu/cl 阅读全文

posted @ 2022-09-10 23:00 明天有风吹 阅读(11) 评论(0) 推荐(0) 编辑

2022年9月1日

在博客园的博客文章中自动播放插入的 asciinema

摘要: 需求 我的文章中都是用 Markdown 写的,所以嵌入的 asciinema 只能通过 Embed image link 的方式,这就导致打开文章页面后只有一个 asciinema 的预览图,点击图片后会跳转到 asciinema 网页。我希望不需要跳转,而是直接可以在文章页面播放 asciine 阅读全文

posted @ 2022-09-01 16:12 明天有风吹 阅读(81) 评论(1) 推荐(0) 编辑

First plugin for vim

摘要: [![asciicast](https://asciinema.org/a/XaxNciASzfa7i0mht6PKTDBZ5.svg)](https://asciinema.org/a/XaxNciASzfa7i0mht6PKTDBZ5) 阅读全文

posted @ 2022-09-01 14:22 明天有风吹 阅读(18) 评论(0) 推荐(0) 编辑

2022年8月31日

map, noremap, nmap, nnoremap in vim

摘要: What is the difference between the remap, noremap, nnoremap and vnoremap mapping commands in Vim? :help map 阅读全文

posted @ 2022-08-31 17:58 明天有风吹 阅读(83) 评论(0) 推荐(0) 编辑

2022年7月21日

Rust find an available tcp port 获取一个可用的 TCP 端口

摘要: fn get_available_port() -> u16 { std::net::TcpListener::bind("0.0.0.0:0") .unwrap() .local_addr() .unwrap() .port() } TcpListener::bind() 函数内部会调用 c::b 阅读全文

posted @ 2022-07-21 18:41 明天有风吹 阅读(398) 评论(0) 推荐(1) 编辑

2022年7月9日

让 prost 生成的 Rust 代码支持 Serialize/Deserialize 到 JSON

摘要: Telegram Bot API 返回的都是 JSON 数据,比如 访问 https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe 返回一个 User 我想把这个 JSON 转换成 Rust 中的结构,方便 阅读全文

posted @ 2022-07-09 17:10 明天有风吹 阅读(1083) 评论(0) 推荐(0) 编辑

2022年6月22日

Rust 关于 let 语句中以下划线变量名需要注意的一个点, _, _var, var 三者在生命周期上的区别

摘要: 以单纯的下划线 _ 接收的变量会在当前语句结束后立即被 drop 掉(不会等到走出当前代码块) 以下划线开头形如 _var 的变量,生命周期跟普通变量的生命周期规则一致 #[derive(Debug)] struct Foo { name: &'static str, } impl Foo { fn 阅读全文

posted @ 2022-06-22 15:02 明天有风吹 阅读(470) 评论(0) 推荐(0) 编辑

2022年6月14日

Async Rust: What is a runtime? Here is how tokio works under the hood

摘要: Async Rust: What is a runtime? Here is how tokio works under the hood 阅读全文

posted @ 2022-06-14 23:04 明天有风吹 阅读(21) 评论(0) 推荐(0) 编辑

Arenas in Rust

摘要: Arenas in Rust Bump, Arena Allocators Allocating Less: Really Thin Rust Cloud Apps 阅读全文

posted @ 2022-06-14 22:47 明天有风吹 阅读(46) 评论(0) 推荐(0) 编辑

Rust Tokio Chat Server 用 Rust 写一个聊天服务器有多简单

摘要: [Creating a Chat Server with async Rust and Tokio](https://youtu.be/Iapc-qGTEBQ) ### Simple Chat Room ```rust use tokio::{ io::{AsyncBufReadExt, Async 阅读全文

posted @ 2022-06-14 21:08 明天有风吹 阅读(619) 评论(0) 推荐(0) 编辑

Common Rust Lifetime Misconceptions 常见的对 Rust 生命周期的误解

摘要: Common Rust Lifetime Misconceptions Intro Phrase Shorthand for T 1) 所有类型的集合(包括 T, &T, &mut T) 或者2) 改集合中的某些类型 owned type 非引用类型, e.g. i32, String, Vec, 阅读全文

posted @ 2022-06-14 19:27 明天有风吹 阅读(73) 评论(0) 推荐(0) 编辑

2022年6月6日

Rc<T>, Box<T>, RefCell<T>, Cell<T>

摘要: https://doc.rust-lang.org/book/ch15-05-interior-mutability.html#enforcing-borrowing-rules-at-runtime-with-refcellt Rc enables multiple owners of the s 阅读全文

posted @ 2022-06-06 16:33 明天有风吹 阅读(35) 评论(0) 推荐(0) 编辑

Rust 临时变量的生命周期

摘要: https://doc.rust-lang.org/book/ch20-02-multithreaded.html Rust 关于 let 语句中以下划线变量名需要注意的一个点, _, _var, var 三者在生命周期上的区别 The Rust Programming Language 的第 20 阅读全文

posted @ 2022-06-06 00:12 明天有风吹 阅读(220) 评论(0) 推荐(0) 编辑

2022年5月25日

mitmproxy 安装与证书配置

摘要: 官网 https://mitmproxy.org/ 安装 brew install mitmproxy pip3 install mitmproxy 启动 mitmweb mitmweb 会自动打开 web 界面 配置手机的 http 代理 默认的 proxy 端口是 8080,IP 地址换成运行 阅读全文

posted @ 2022-05-25 17:01 明天有风吹 阅读(3678) 评论(0) 推荐(0) 编辑

2022年5月21日

Rust 学习笔记

摘要: https://doc.rust-lang.org/std/keyword.ref.html https://www.bilibili.com/video/BV19b4y1o7Lt https://tyrchen.github.io/rust-training/rust-training-all-i 阅读全文

posted @ 2022-05-21 15:03 明天有风吹 阅读(58) 评论(0) 推荐(0) 编辑

2022年5月19日

hello asciinema

摘要: 阅读全文

posted @ 2022-05-19 14:57 明天有风吹 阅读(20) 评论(0) 推荐(0) 编辑

2022年5月18日

第一个 VSCode 插件

摘要: https://code.visualstudio.com/api/get-started/your-first-extension 首先安装必要的工具 npm install -g yo generator-code 然后创建一个 插件 yo code 然后可以用 VSCode 编辑了,F5 运行 阅读全文

posted @ 2022-05-18 18:37 明天有风吹 阅读(32) 评论(0) 推荐(0) 编辑

2022年5月10日

sublime text 3 sidebar color, Open all with current extension as ..

摘要: https://stackoverflow.com/a/46463891/1936057 Preferences → Theme → Adaptive.sublime-them VSCode shift + cmd/ctrl + p change language mode configure fi 阅读全文

posted @ 2022-05-10 15:12 明天有风吹 阅读(35) 评论(0) 推荐(0) 编辑

2022年1月26日

ubuntu coredump file location !!

摘要: ulimit -c unlimited cat /var/log/apport.log ls -al /var/lib/apport/coredump/ https://askubuntu.com/a/1374285 阅读全文

posted @ 2022-01-26 16:10 明天有风吹 阅读(114) 评论(0) 推荐(0) 编辑

2021年12月28日

How to test your code on a machine with big-endian architecture 如何在大端机器上测试你的代码

摘要: How to test your code on a machine with big-endian architecture sudo apt-get install gcc-multilib-mips-linux-gnu gcc-mips-linux-gnu qemu-user sudo apt 阅读全文

posted @ 2021-12-28 21:30 明天有风吹 阅读(23) 评论(0) 推荐(0) 编辑

python struct.pack('5sI', b'abc\x00', 1) 字节顺序,大小和对齐方式

摘要: 今天在 python 里面手动构造 C 的 struct 时,惊奇的发现 struct.pack('5sI', b'abc\x00', 1) 返回结果的长度是 12 ! 而 struct.pack('5s') + struct.pack('I', 1) 跟预想结果一致,是 9 看文档: 字节顺序,大 阅读全文

posted @ 2021-12-28 21:03 明天有风吹 阅读(467) 评论(0) 推荐(0) 编辑

2021年12月25日

aliyundrive-webdav rclone fuse

摘要: ```bash $ python3 -m pip install aliyundrive-webdav $ aliyundrive-webdav --host 127.0.0.1 --refresh-token xxxxx $ curl https://rclone.org/install.sh | 阅读全文

posted @ 2021-12-25 01:11 明天有风吹 阅读(804) 评论(0) 推荐(0) 编辑

2021年12月17日

Amazon DynamoDB Limits

摘要: 先放几个链接: 开发人员指南 Developer Guide API Reference Service, Account, and Table Quotas in Amazon DynamoDB How Amazon DynamoDB adaptive capacity accommodates 阅读全文

posted @ 2021-12-17 23:11 明天有风吹 阅读(132) 评论(0) 推荐(0) 编辑

2021年12月8日

hopper disassembler 微信多开

摘要: 图中我已经把 0x2 改成了 0x8,然后 #!/bin/bash open -n /Applications/WeChat.app # nohup /Applications/WeChat.app/Contents/MacOS/WeChat > /dev/null 2>&1 & exit 可以再整 阅读全文

posted @ 2021-12-08 19:40 明天有风吹 阅读(63) 评论(0) 推荐(0) 编辑

2021年11月27日

深入学习MySQL事务:ACID特性的实现原理

摘要: 深入学习MySQL事务:ACID特性的实现原理 定义 持久性是指事务一旦提交,它对数据库的改变就应该是永久性的。接下来的其他操作或故障不应该对其有任何影响。 实现原理:redo log redo log和undo log都属于InnoDB的事务日志。下面先聊一下redo log存在的背景。 Inno 阅读全文

posted @ 2021-11-27 20:47 明天有风吹 阅读(106) 评论(0) 推荐(0) 编辑

2021年11月19日

c++ std::move std::forward

摘要: What's the difference between stdmove and stdforward C++ Rvalue References Explained Modern C++ Tutorial: C++11/14/17/20 On the Fly std::move Long sto 阅读全文

posted @ 2021-11-19 23:42 明天有风吹 阅读(36) 评论(0) 推荐(0) 编辑

2021年8月11日

leetcode 正则表达式匹配

摘要: 10. 正则表达式匹配 以确定性的字符串为分界,分而治之。 比如 p = "a*.*c*abcd*e*c*."; s = "ijpqabcxyz";,其中 abc 即为确定性字符串,找到目标字符串 s 中的 abc 出现的位置 也就是把 isMatch("ijpqabcxyz", "a*.*c*ab 阅读全文

posted @ 2021-08-11 22:26 明天有风吹 阅读(76) 评论(0) 推荐(0) 编辑

2021年8月6日

图解最长回文子串「Manacher 算法」,基础思路感性上的解析

摘要: 问题描述: 给你一个字符串 s,找到 s 中最长的回文子串。 链接:https://leetcode-cn.com/problems/longest-palindromic-substring #「Manacher 算法」的整体思路是:基于回文字符串的对称性,缓存前面字符的「臂长」信息,以便后面复用 阅读全文

posted @ 2021-08-06 16:31 明天有风吹 阅读(231) 评论(0) 推荐(0) 编辑

2021年7月15日

DNS重新绑定攻击

摘要: 来自微信外挂的安全风险 DNS重新绑定攻击 DDNS 动态域名设置 阅读全文

posted @ 2021-07-15 14:19 明天有风吹 阅读(50) 评论(0) 推荐(0) 编辑

2021年7月12日

Mac OS ssh 禁用密码登陆

摘要: $ sudo vim /etc/ssh/sshd_config PubkeyAuthentication yes PasswordAuthentication no UsePAM no then: $ sudo launchctl stop com.openssh.sshd $ sudo launc 阅读全文

posted @ 2021-07-12 20:26 明天有风吹 阅读(450) 评论(0) 推荐(1) 编辑

2021年7月9日

华为路由器端口映射

摘要: 华为路由器默认后台地址 http://192.168.100.1/ root/adminHW 如果设置无效,记得要换一下「外部端口号」,多尝试几次。我一开始给外部端口号配的 8080,是无法访问的。80 也不行 阅读全文

posted @ 2021-07-09 20:46 明天有风吹 阅读(1290) 评论(0) 推荐(0) 编辑

2021年6月30日

You have mail in /var/mail/xxx

摘要: 因为配置 DDNS, 我添加了个 crontab 定时任务,每隔 1 分钟执行一段 python 脚本 然后就发现 terminal 经常提示 'You have mail in /var/mail/xxx' 打开一看,里面都是 python 脚本中 print 的东西,只要不再 print 就不会 阅读全文

posted @ 2021-06-30 21:10 明天有风吹 阅读(391) 评论(0) 推荐(0) 编辑

2021年6月27日

cloudflare/DNSPod DDNS 动态域名设置

摘要: 所谓动态域名,就是当你的服务器 IP 地址发生变化的时候,自动地修改你在「域名解析服务商」那里的域名记录值 怎么操作?看官方文档 Use dynamic IP address Update DNS Record DNSPod用户API文档 cloudflare #!/usr/bin/env pyth 阅读全文

posted @ 2021-06-27 23:41 明天有风吹 阅读(1138) 评论(0) 推荐(0) 编辑

2021年6月21日

Reinforcement Learning 强化学习入门

摘要: https://www.zhihu.com/question/277325426 https://github.com/jinglescode/reinforcement-learning-tic-tac-toe/blob/master/README.md Intuition After a lon 阅读全文

posted @ 2021-06-21 18:00 明天有风吹 阅读(101) 评论(0) 推荐(0) 编辑

2021年6月16日

git clone 设置临时的 proxy

摘要: ss.sh #!/bin/env bash BASEDIR=$(dirname "$0") cd $BASEDIR disable_proxy() { git config --global --unset https.proxy } trap disable_proxy INT git confi 阅读全文

posted @ 2021-06-16 15:41 明天有风吹 阅读(1411) 评论(0) 推荐(0) 编辑

2021年2月8日

sublime text 的 Ctrl + P「模糊搜索算法」

摘要: Reverse Engineering Sublime Text’s Fuzzy Match 这是我能 google 到的最早的一篇关于 Sublime Text 的模糊搜索的文章。 https://github.com/forrestthewoods/lib_fts/blob/master/doc 阅读全文

posted @ 2021-02-08 15:11 明天有风吹 阅读(989) 评论(0) 推荐(0) 编辑

2020年12月18日

python 逆序按行读取文件

摘要: How to read a file in reverse order? import os def readlines_reverse(filename): with open(filename) as qfile: qfile.seek(0, os.SEEK_END) position = qf 阅读全文

posted @ 2020-12-18 15:07 明天有风吹 阅读(2801) 评论(0) 推荐(0) 编辑

2020年12月9日

python 暴力破解压缩文件 zip 密码

摘要: 暴力破解压缩文件 zip 密码 阅读全文

posted @ 2020-12-09 14:14 明天有风吹 阅读(725) 评论(0) 推荐(0) 编辑

导航

+V atob('d2h5X251bGw=')

请备注:from博客园