Skip to content

Instantly share code, notes, and snippets.

@danfate
danfate / cloudflaredns.sh
Last active April 12, 2018 15:56 — forked from m-wild/cloudflaredns.sh
CloudFlare dynamic dns updater module for Synology
#!/bin/sh
# DSM Config
__USERNAME__="$(echo ${@} | cut -d' ' -f1)"
__PASSWORD__="$(echo ${@} | cut -d' ' -f2)"
__HOSTNAME__="$(echo ${@} | cut -d' ' -f3)"
__MYIP__="$(echo ${@} | cut -d' ' -f4)"
# log location
__LOGFILE__="/var/log/cloudflareddns.log"
@danfate
danfate / nesign.py
Created March 21, 2016 04:38 — forked from abrasumente233/nesign.py
网易云音乐签到(pc android)
# -*- coding: utf-8 -*-
"""Automatically signing for NetEasy Music"""
import requests
__author__ = 'abrasumente'
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
copy from http://blog.licess.com/simplehttpserver/
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@danfate
danfate / 1-redsocks2-openwrt.md
Created December 16, 2015 15:39 — forked from lanceliao/1-redsocks2-openwrt.md
在OpenWrt上配置redsocks2

redsocks2是一款透明socks5代理工具,能够实现智能代理的功能,这里是redsocks2在OpenWrt上的配置,配合shadowsocks使用。

redsocks.conf 是配置文件,放在/etc目录,将192.168.1.1改成路由器的地址. redsocks2.sh 为自启动文件,改名为redsocks2放到/etc/init.d目录即可。自启动文件假设redsocks可执行文件在/opt/bin目录。

启动redsocks2: /etc/init.d/redsocks2 start 停止redsocks2: /etc/init.d/redsocks2 stop

redsocks2 git源

@danfate
danfate / surge.conf
Created October 27, 2015 12:31 — forked from blackgear/surge.conf
Surge config for new user
[General]
loglevel = warning
bypass-system = true
skip-proxy = 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,localhost,*.local,*.lan
bypass-tun = 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12
dns-server = 114.114.114.114,114.114.115.115
[Proxy]
PROXY = custom,服务器地址,服务器端口,加密方式,密码,模块地址,tcp-fast-open=true
[General]
loglevel = notify
[Proxy]
Proxy = custom, 1.2.3.4, 443, rc4-md5, password, http://surge.run/SSEncrypt.module
[Rule]
DOMAIN-KEYWORD,google,Proxy,tcp-force
DOMAIN-KEYWORD,facebook,Proxy,tcp-force
DOMAIN-KEYWORD,youtube,Proxy,tcp-force
@danfate
danfate / surge.conf
Created October 5, 2015 10:27 — forked from janlay/README.md
Yet another config for Surge.app
# This config file was created for myself (@janlay). You may want to add or remove some rules to make efficient use of the Internet.
[General]
# warning, notify, info, verbose
loglevel = notify
[Proxy]
# http, https, socks5
Proxy = custom, 1.2.3.4, 443, rc4-md5, password, http://server/custom.module
@danfate
danfate / chrome_icon_fixer
Last active August 29, 2015 14:27 — forked from rashkur/chrome_icon_fixer
chrome icon fixer
import ConfigParser, mmap
config_file = "/usr/share/applications/google-chrome.desktop"
add_string_to_each_section = ["StartupWMClass", "Google-chrome-stable"]
option = add_string_to_each_section[0]
value = add_string_to_each_section[1]
class Fixer:
def check(self, cf, option, value):
class Chain(object):
def __init__(self, path=''):
self._path = path
def __getattr__(self, path):
return Chain('%s/%s' % (self._path, path))
def __str__(self):
return self._path