上一页 1 2 3 4 5 6 ··· 8 下一页

2023年3月17日

Android Studio 的 Proxy 配置

摘要: 除了在 System Settings 的 HTTP Proxy 配置以外,还有一个 ~/.gradle/gradle.properties 文件要注意 阅读全文

posted @ 2023-03-17 14:49 明天有风吹 阅读(2051) 评论(0) 推荐(0)

2023年3月9日

excel 批量删除大量关键字

摘要: excel 自带的替换功能每次只能替换一个关键字,还不支持 regex,vba 我不会,也不想学,所以还是用 python 关键字按行写到 keyword.txt 中: hell\s*o av 讨厌 hate 然后是 py 脚本 excel_clear_word.py: #!/usr/bin/env 阅读全文

posted @ 2023-03-09 17:12 明天有风吹 阅读(465) 评论(0) 推荐(0)

2023年3月8日

excel 合并

摘要: 最近整理收钱吧的账单明细,因为收钱吧限制每次最多只能导出 1 个月的明细,所以我需要合并这些零零碎碎的表格,方便在 excel 中做统计筛选 https://openpyxl.readthedocs.io/en/stable/tutorial.html #!/usr/bin/env python3 阅读全文

posted @ 2023-03-08 20:12 明天有风吹 阅读(244) 评论(0) 推荐(0)

Simulate arrow keys on mobile phone 手机上模拟键盘的上下左右按钮

摘要: <textarea placeholder="test touchmove" ontouchstart="onTouchStart(event)" ontouchmove="onTouchMove(event)" ontouchend="onTouchEnd(event)"></textarea> 阅读全文

posted @ 2023-03-08 15:02 明天有风吹 阅读(88) 评论(0) 推荐(0)

2023年3月3日

html show modal dialog

摘要: <button onclick="showModalDialog()">show modal dialog</button> <dialog id="dialog" onclose="onModalClose(event)"> <header>This is a sample dialog</hea 阅读全文

posted @ 2023-03-03 18:13 明天有风吹 阅读(63) 评论(0) 推荐(0)

js 以 json 格式 post form data

摘要: 用 js 发起请求,以避免页面跳转 <form action="/hello" method="POST" onsubmit="submitFormData(event)"> <input type="text" name="name" required placeholder="username" 阅读全文

posted @ 2023-03-03 15:59 明天有风吹 阅读(570) 评论(0) 推荐(0)

2023年1月12日

Dotfiles Management

摘要: cd ~ mkdir .dotfiles cd .dotfiles git init --bare # initialise a bare git repo cd - echo "alias dotfiles='git --git-dir=/home/mx/.dotfiles --work-tree 阅读全文

posted @ 2023-01-12 14:09 明天有风吹 阅读(36) 评论(0) 推荐(0)

2023年1月11日

Reduce Depth of an Existing Git Repo 让 git 只保留最近 n 次的 commit 删除其余的

摘要: shallow clone git clone --depth=1 https://github.com/cloudwu/skynet.git git log --oneline | wc -l 1 du -hs .git 792K .git fully clone, and reduce the 阅读全文

posted @ 2023-01-11 15:49 明天有风吹 阅读(170) 评论(0) 推荐(0)

2023年1月8日

Xcode "There is not enough disk space available to install the product." with plenty of space.

摘要: 我的老 MacBook Pro (Retina, 13-inch, Mid 2014) 可用空间 41 GB,App Store 硬是死活不给装 Xcode,说我硬盘空间不够。 Xcode "There is not enough disk space available to install th 阅读全文

posted @ 2023-01-08 13:31 明天有风吹 阅读(87) 评论(0) 推荐(0)

2022年11月24日

s3 upload files with shell script

摘要: TL; DR #!/usr/bin/env bash # hangj.cnblogs.com s3_key="Q3AM3UQ867SPQQA43P2F" s3_secret="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" session_token="Secur 阅读全文

posted @ 2022-11-24 14:54 明天有风吹 阅读(100) 评论(0) 推荐(0)

2022年9月20日

How to install and configure fail2ban to secure linux server

摘要: How to check linux login history fail2ban-basic 最近把吃灰好几年的树莓派重新整起来之后: whitelist ignoreip = 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 EOF 阅读全文

posted @ 2022-09-20 17:34 明天有风吹 阅读(111) 评论(0) 推荐(0)

2022年9月18日

raspberry pi mount a usb drive tutorial

摘要: # fdisk is a tool to manage disks on Linux # this will display all disks # At the end of the displaying lines, you will see your usb drive, check the 阅读全文

posted @ 2022-09-18 14:43 明天有风吹 阅读(46) 评论(0) 推荐(0)

2022年9月17日

send email with python 发邮件

摘要: 使用 python 发邮件,具体参数改一下即可使用 # https://docs.python.org/3/library/email.examples.html # https://stackoverflow.com/a/26191922/1936057 def sendmail(subject, 阅读全文

posted @ 2022-09-17 21:47 明天有风吹 阅读(24) 评论(0) 推荐(0)

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 明天有风吹 阅读(53) 评论(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 明天有风吹 阅读(63) 评论(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 明天有风吹 阅读(17) 评论(0) 推荐(0)

2022年9月1日

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

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

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

First plugin for vim

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

posted @ 2022-09-01 14:22 明天有风吹 阅读(26) 评论(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 明天有风吹 阅读(111) 评论(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 明天有风吹 阅读(565) 评论(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 明天有风吹 阅读(1462) 评论(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 明天有风吹 阅读(539) 评论(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 明天有风吹 阅读(33) 评论(0) 推荐(0)

Arenas in Rust

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

posted @ 2022-06-14 22:47 明天有风吹 阅读(54) 评论(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 明天有风吹 阅读(854) 评论(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 明天有风吹 阅读(106) 评论(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 明天有风吹 阅读(54) 评论(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 明天有风吹 阅读(267) 评论(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 明天有风吹 阅读(6764) 评论(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 明天有风吹 阅读(86) 评论(0) 推荐(0)

2022年5月19日

hello asciinema

摘要: 阅读全文

posted @ 2022-05-19 14:57 明天有风吹 阅读(24) 评论(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 明天有风吹 阅读(48) 评论(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 明天有风吹 阅读(49) 评论(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 明天有风吹 阅读(125) 评论(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 明天有风吹 阅读(32) 评论(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 明天有风吹 阅读(551) 评论(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 明天有风吹 阅读(898) 评论(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 明天有风吹 阅读(199) 评论(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 明天有风吹 阅读(82) 评论(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 明天有风吹 阅读(135) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 ··· 8 下一页

导航

+V atob('d2h5X251bGw=')

请备注:from博客园