网上存在各类通过命令行编辑深藏在 NAS 文件系统深处的某配置文件而实现某些高级功能的方法,就连群晖官方的技术支持也会提供这种方案。
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 | |
set -e | |
DEPS="ioreg ggrep jq ddcctl" | |
EXTERNAL_DISPLAY_NO=${EXTERNAL_DISPLAY_NO:-1} | |
RATIO=${RATIO:-100} # 0-100 | |
get-builtin-brightness() { |
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
# Append the following lines to: | |
# /usr/syno/etc/packages/VPNCenter/openvpn/openvpn.conf | |
push "redirect-gateway def1 bypass-dhcp" | |
push "dhcp-option DNS YOUR_DNS_SERVER" | |
push "dhcp-option PROXY_AUTO_CONFIG_URL http://wpad/proxy.pac" |
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/sh | |
# Q&As | |
# | |
# Q: Why not use [paperkey][paperkey]? | |
# A: It brings much more complexity and dependencies, and I don't have time to check the implementation for security. | |
# | |
# Q: Why not OCR? | |
# A: I didn't find an open-source ocr software that works for normal photos. | |
# even though I used [OCR-A][OCR-A] for printing and [ScannerPro][ScannerPro] for image processing. |
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
If you see the error message below, you may need this patch: | |
Undefined symbols for architecture x86_64: | |
"_tun_close", referenced from: | |
_tuntap_open in n2n.a(tuntap_osx.o) | |
ld: symbol(s) not found for architecture x86_64 | |
# How to use | |
If you got the source code from official repository, like me: | |
svn co https://svn.ntop.org/svn/ntop/trunk/n2n |
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
while you.is_single and you.love_letter in you.code_written: | |
you.is_single = True |
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
import re | |
import scrapy | |
def parse_date(s): | |
if s: | |
s = s.replace('年', '').replace('月', '').replace('NEW', '') | |
if len(s) == 5: | |
month = s[-1] | |
s = s[:4] + "0" + month # add a leading zero to month | |
s = int(s) |
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
function r(r){for(var t={};i=r.pop();)t[i]=1;return t}function FindProxyForURL(r,i){if(isPlainHostName(i))return e;var f=i,o=0;do{if(_.hasOwnProperty(f))return t;if(n.hasOwnProperty(f))return e;o=i.indexOf(".",o)+1,f=i.substring(o)}while(o>0);var u=dnsResolve(i);if(!u)return t;if(u.indexOf(":")>=0)return e;var l=u.split("."),p=(255&l[1])<<8|255&l[2],v=l[0],d=s[v],h=a[v];if(0===d)return t;if(16===h)return e;var w=0,L=d.length,c=L>>1;do d[c]>p?L=c:w=c,c=w+L>>1;while(w+1<L);return p-d[w]>>h[w]===0?e:t}var t="PROXY 127.0.0.1:1235;",e="DIRECT",n=r("v2ex.co|qishu.co|cn|loli.vg|pp.cc|cnu.cc|adchina.cc|chinave.cc|hefei.cc|yiyi.cc|snsfun.cc|ulink.cc|ffdy.cc|ngacn.cc|zhibo8.cc|akarin.xyz|sf.gg|iapps.im|dcloud.io|mindstore.io|daocloud.io|coding.io|jianshu.io|my-card.in|pdim.gs|51.la|ijq.tv|acg.tv|yy.tv|muho.tv|zerodm.tv|pps.tv|mootion.tv|miomio.tv|imgo.tv|rrmj.tv|bilibili.tv|fun.tv|zhanqi.tv|xiaoka.tv|feizao.tv|1006.tv|ganews.tv|hoolo.tv|panda.tv|acfun.tv|1cool.tv|cctvcom|kdnet.net|cloudxns.net|lxdns.net|768cn.net|zoosn |
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
#!/usr/bin/env python3 | |
# <bitbar.title>Duplicacy Scheduler</bitbar.title> | |
# <bitbar.version>v1.0</bitbar.version> | |
# <bitbar.author>Tevin</bitbar.author> | |
# <bitbar.author.github>tevino</bitbar.author.github> | |
# <bitbar.desc>Run duplicacy backup every hour.</bitbar.desc> | |
# <bitbar.dependencies>duplicacy,python3</bitbar.dependencies> | |
import os |
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
# A way of implementing subtraction using addition only. | |
# Available operations: loop, assign, add by one. | |
# Restrictions: no negative numbers, integers only. | |
# | |
# Aadit M Shah on StackOverflow says this method was devised by Stephen Cole Kleene, but I can't find any sources. | |
# https://stackoverflow.com/a/34079075 | |
def subtract(minuend, subtrahend): | |
for _ in range(subtrahend): |