Skip to content

Instantly share code, notes, and snippets.

@nanpuyue
nanpuyue / frpc
Created November 6, 2018 13:30
frpc init script for openwrt
#!/bin/sh /etc/rc.common
# date: 2018-11-06
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt
# author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com
START=95
USE_PROCD=1
start_service() {
procd_open_instance
# file: nginx.conf
# date: 2018-10-13
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt
# author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
#!/bin/bash
for ((i=0; i<256; i++)); do
printf "\e[48;5;${i}m %03d \e[0m" $i
(((i + 3) % 6 == 0 )) && printf '\n'
done
#!/bin/bash
# file: args.sh
# date: 2018-08-17
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt
# author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com
LIST=(1 ' 2 3')
at(){
for i in $@; do
#!/bin/bash
# file: rsync-repo.sh
# date: 2018-07-18
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt
# author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com
LOCAL_DIR="/path/ubuntu"
MIRROR_SRC="rsync://archive.ubuntu.com/ubuntu/"
DISTS="bionic bionic-backports bionic-proposed bionic-security bionic-updates"
COMPONENTS="main restricted universe multiverse"
#!/bin/bash
# file: migrate_github_plugin.sh
# date: 2018-06-30
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt
# author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com
search_account_meta(){
grep -r "$*" ??/|awk -F':' '{print $1}'|uniq
}
@nanpuyue
nanpuyue / mount.ntfs
Last active September 15, 2018 14:53
mount ntfs partition by ufsd
#!/bin/sh
# file: /sbin/mount.ntfs
# date: 2018-05-26
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt
# author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com
if modprobe -q ufsd; then
exec mount -t ufsd "$@"
else
exec mount -t ntfs-3g "$@"
date: 2018-05-26
license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt
author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com
source:http://dl.paragon-software.com/free/Paragon-715-FRE_NTFS_Linux_9.5_Express.tar.gz
---
diff -u a/ifslinux/ufsdvfs.c b/ifslinux/ufsdvfs.c
--- a/ifslinux/ufsdvfs.c 2017-09-09 00:06:41.000000000 +0800
+++ b/ifslinux/ufsdvfs.c 2018-05-26 14:39:23.392496043 +0800
@@ -112,6 +112,10 @@
#include <linux/kthread.h>
@nanpuyue
nanpuyue / you-get.sh
Created April 18, 2018 15:02
a you-get gui
#!/bin/bash
# file: you-get.sh
# date: 2018-04-18
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt
# author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com
URL=$(zenity --entry --text=请输入视频地址)
INFO=$(you-get -i "$URL"|sed 's/\x1b\[\wm//g')
TITLE="$(echo "$INFO"|grep -Po '(?<=title:).*'|sed -r 's/^\s*//')"
LIST=$(echo "$INFO"|grep -Po 'format:.*$|(?<=video-profile:).*$|(?<=size:).*MiB|(?<=container:).*$'|\
@nanpuyue
nanpuyue / ipsec-updown.sh
Last active April 6, 2018 14:50
for OpenWrt
#!/bin/sh
# file: ipsec-updown.sh
# date: 2018-04-06
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt
# author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com
VERBOSE=1
RETRY=10
TIMEOUT=40
CHECK_INT=30