This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::env::args; | |
| use std::fs::File; | |
| use std::io::{BufRead, BufReader}; | |
| use std::str::FromStr; | |
| fn main() { | |
| let mut args = args(); | |
| if args.len() == 3 { | |
| args.next(); | |
| let interval = u32::from_str(&args.next().unwrap()).unwrap(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // file: select_delay.rs | |
| // date: 2019-04-09 | |
| // license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
| // author: nanpuyue <[email protected]> https://blog.nanpuyue.com | |
| use std::time::{Duration, Instant}; | |
| use futures::Future; | |
| use tokio::timer::Delay; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # file: export_data.sh | |
| # date: 2019-03-29 | |
| # license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
| # author: nanpuyue <[email protected]> https://blog.nanpuyue.com | |
| # note: | |
| # sigrok-cli -i xxx.sr -P uart:baudrate=1500000:tx=D3 -A uart=tx-data --protocol-decoder-samplenum | |
| INTERVAL=100 | |
| END=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # file: yubikey-touch-notify | |
| # date: 2019-03-09 | |
| # license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
| # author: nanpuyue <[email protected]> https://blog.nanpuyue.com | |
| # refer: https://github.com/maximbaz/yubikey-touch-detector | |
| SOCKET="$XDG_RUNTIME_DIR/yubikey-touch-detector.socket" | |
| NOTIFY_ICON="dialog-information" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh /etc/rc.common | |
| # file: /etc/init.d/ss-local | |
| # date: 2018-11-06 | |
| # license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
| # author: nanpuyue <[email protected]> https://blog.nanpuyue.com | |
| START=95 | |
| USE_PROCD=1 | |
| start_service() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # file: build_mips-unknown-linux-musl.sh | |
| # date: 2018-12-24 | |
| # license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
| # author: nanpuyue <[email protected]> https://blog.nanpuyue.com | |
| export LC_ALL=C | |
| export STAGING_DIR="/build/openwrt-sdk-18.06.1/staging_dir" | |
| export TOOLCHAIN="toolchain-mips_24kc_gcc-7.3.0_musl" | |
| export PATH="$STAGING_DIR/$TOOLCHAIN/bin/:$PATH" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| from smbus import SMBus | |
| # Use /dev/i2c-0 | |
| smbus = SMBus(0) | |
| # Use PEC | |
| smbus.pec = True | |
| ADDR1 = 0x34 | |
| ADDR2 = 0x36 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # file: x-input.sh | |
| # date: 2018-11-12 | |
| # license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
| # author: nanpuyue <[email protected]> https://blog.nanpuyue.com | |
| # | |
| # 依赖:zenity xdotool xclip | |
| # | |
| # 使用时将脚本绑定快捷键,例如: | |
| # 设置快捷键 alt + t 绑定 x-input.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh /etc/rc.common | |
| # date: 2018-11-06 | |
| # license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
| # author: nanpuyue <[email protected]> https://blog.nanpuyue.com | |
| START=95 | |
| USE_PROCD=1 | |
| start_service() { | |
| procd_open_instance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # file: nginx.conf | |
| # date: 2018-10-13 | |
| # license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
| # author: nanpuyue <[email protected]> https://blog.nanpuyue.com | |
| user www-data; | |
| worker_processes auto; | |
| pid /run/nginx.pid; | |
| include /etc/nginx/modules-enabled/*.conf; |