This file contains 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 | |
# date: 2017-11-17 | |
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
# author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com | |
echo 'install: ~/.mozilla/native-messaging-hosts/hide_titlebar.json' | |
[[ -d ~/.mozilla/native-messaging-hosts ]] || mkdir -p ~/.mozilla/native-messaging-hosts | |
cat > ~/.mozilla/native-messaging-hosts/hide_titlebar.json << EOF | |
{ | |
"name": "hide_titlebar", |
This file contains 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 | |
# date: 2024-05-21 | |
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
# author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com | |
# 设置接口名称和流量限制 | |
IFACE="eth0" | |
LIMIT="190 GiB" | |
# vnstat 数据库文件路径 |
This file contains 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
diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds | |
index 37630cde66..f90ed13d12 100755 | |
--- a/target/linux/ramips/base-files/etc/board.d/01_leds | |
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds | |
@@ -205,6 +205,9 @@ hc5661a) | |
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2" | |
set_wifi_led "$boardname:blue:wlan2g" | |
;; | |
+hc5611) | |
+ ucidef_set_led_default "system" "system" "$boardname:green:system" "1" |
This file contains 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
// date: 2020-01-10 | |
// update: 2024-04-01 | |
// license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
// author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com | |
#![feature(coroutines)] | |
#![feature(coroutine_trait)] | |
use std::ops::{Coroutine, CoroutineState}; | |
use std::pin::Pin; |
This file contains 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
// date: 2020-01-10 | |
// update: 2024-03-31 | |
// license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
// author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com | |
#![feature(coroutines)] | |
#![feature(coroutine_trait)] | |
use std::ops::{Coroutine, CoroutineState}; | |
use std::pin::Pin; |
This file contains 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 | |
# 南浦月 | |
# nanpuyue@gmail.com | |
# 2013-5-11 | |
# 用法: | |
# fonts-rename.sh <字体目录> | |
# fonts-rename.sh <字体文件> |
This file contains 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
// date: 2023-06-12 | |
// license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
// author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com | |
// build: gcc -fPIC -shared -o hook_uname.so hook_uname.c -ldl | |
// usage: LD_PRELOAD=./hook_uname.so uname -a | |
#include <string.h> | |
#include <dlfcn.h> | |
#include <sys/utsname.h> |
This file contains 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 | |
# | |
# e.g. | |
# for https://www.youtube.com/playlist?list=PLL7JeXQtCv0MslQgUCV3DvKmaagaB9Nms use: | |
# youtube-list.sh PLL7JeXQtCv0MslQgUCV3DvKmaagaB9Nms | |
for i in \ | |
`curl -s "https://www.youtube.com/playlist?list=$1" |\ | |
grep -Po "/watch.*?$1" |\ | |
sed -r "s#&.*##" | uniq`; |
This file contains 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 | |
docker() { | |
case "$1" in | |
htop) | |
local container="$2" | |
if [ -z "$container" ]; then | |
echo -e '"docker htop" requires at least 1 argument.\n' | |
echo -e 'Usage:\n\tdocker htop CONTAINER [htop OPTIONS]' | |
return 1 |
This file contains 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
// date: 2022-05-09 | |
// license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
// author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com | |
use std::mem::take; | |
fn push(buf: &mut &mut [u8], value: u8) { | |
buf[0] = value; | |
*buf = &mut take(buf)[1..]; | |
} |
NewerOlder