Skip to content

Instantly share code, notes, and snippets.

View freeyoung's full-sized avatar

Eric Qian freeyoung

  • Berlin, Germany
View GitHub Profile
@Lupino
Lupino / ss.coffee
Created August 8, 2014 14:34
shadowsocks-auth nodejs client
redis = require 'redis'
client = redis.createClient()
SS_PREFIX = 'ss:'
#
# user
# name: shadowsocks 的用户名
# password: shadowsocks 的密码
# method: shadowsocks 的加密方法
@wen-long
wen-long / ss-redir 透明代理.md
Last active March 18, 2024 12:13
ss-redir 透明代理.md

##ss-redir 的 iptables 配置(透明代理)

透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则

创建 /etc/ss-redir.json 本地监听 7777 运行ss-redir -v -c /etc/ss-redir.json

iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
@shadabahmed
shadabahmed / logstash-suse
Last active March 16, 2017 18:19
Logstash init.d script and config file. Ubuntu script is borrowed from http://www.vmdoh.com/blog/centralizing-logs-lumberjack-logstash-and-elasticsearch SuSe script is for SLES. Just copy the script to /etc/init.d as logstash
#! /bin/sh
### BEGIN INIT INFO
# Provides: logstash
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
@Jerry-Fix
Jerry-Fix / ubuntu 12.04 preseed
Created April 13, 2013 17:03
ubuntu 12.04 preseed for cobbler
d-i debian-installer/locale string en_US
d-i debian-installer/language string en
d-i debian-installer/country string US
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/allow_unauthenticated string true
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
@binux
binux / xf_magnet.js
Last active October 19, 2023 02:38
QQ旋风网页版,磁力链支持 书签: javascript:void((function(){var d=document;var s=d.createElement('script');s.src='http://blog.binux.me/assets/image/xf_magnet.js';s.id='binux_script';d.body.appendChild(s)})())
// vim: set et sw=2 ts=2 sts=2 ff=unix fenc=utf8:
// Author: Binux<i@binux.me>
// http://binux.me
// Created on 2013-01-21 20:18:42
jQuery.ajax({
url: 'http://pyproxy.duapp.com/http://httpbin.duapp.com/cookies/set?userid=21',
cache: true,
dataType: 'script',
success: function() {
@moklett
moklett / openconnect.md
Created July 24, 2012 15:21
OpenConnect VPN on Mac OS X

Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.

As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.

Here's how to get it set up on Mac OS X:

  1. OpenConnect can be installed via homebrew:

     brew update
    

brew install openconnect

@arantius
arantius / simple-rrd-merge.py
Created March 23, 2012 02:43
A very simple script to merge multiple RRD files, since none of those available seem to work.
#!/usr/bin/env python
"""Simple script to merge multiple RRD files together.
Accepts any number of RRD file names as arguments. Produces an "rrdtool dump"
style file on stdout. The last RRD file should have a slot for every possible
record in the resulting merged RRD.
Run something like:
$ python simple-merge-rrd.py filea.rrd fileb.rrd filec.rrd | \
@niallo
niallo / ubuntu-lucid-python-2.7
Created March 8, 2012 22:59
Puppet module to install & set default Python to 2.7 on Ubuntu 10.04 LTS / Lucid
class python27 {
Package { ensure => "installed" }
$apt-base = "/etc/apt/sources.list.d/fkrull-"
Exec { require => Package["python-software-properties"] }
exec { "python-repo" :
command => "/usr/bin/add-apt-repository ppa:fkrull/deadsnakes",
creates => "${apt-base}deadsnakes-lucid.list",
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@chuangbo
chuangbo / README.md
Last active June 19, 2023 04:48
Python dynamic DNSPod DNS Script

替换上你的 API Token,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。

获取 API Token 的方式

获得 domain_id 可以用 curl

curl -k https://dnsapi.cn/Domain.List -d "login_token=TOKEN"`