Skip to content

Instantly share code, notes, and snippets.

@neroanelli
neroanelli / routeros-ddns-dnspod.sh
Created January 20, 2020 14:29 — forked from shenjunru/routeros-ddns-dnspod.sh
DNSPod DDNS Updater on RouterOS
#policy: read,test
#pppoe-interface
:local pppoe "pppoe-out1"
#dnspod-token
:local token "uid,api-toekn"
#dnspod-domain
:local domain "example.com"

平台:DigitalOcean VPS ubuntu14.04 x64, strongswan5.2.2 运行以下命令请使用root权限

一:安装strongswan

由于ubuntu软件仓库中strongswan版本较低,因此从官网源码编译安装

apt-get install build-essential     #编译环境
aptitude install libgmp10 libgmp3-dev libssl-dev pkg-config libpcsclite-dev libpam0g-dev     #编译所需要的软件
#生成CA密钥
ipsec pki --gen --outform pem > caKey.pem
#生成CA证书
ipsec pki --self --in caKey.pem --dn "C=US, O=你的组织名字, CN=你的CA名字" --ca --outform pem > caCert.pem
#生成服务器密钥
ipsec pki --gen --outform pem > serverKey.pem
@neroanelli
neroanelli / net_speeder_install.sh
Created March 18, 2014 07:08
net_speeder_install.sh
#!/bin/sh
# Set Linux PATH Environment Variables
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# Check If You Are Root
if [ $(id -u) != "0" ]; then
clear
echo -e "\033[31m Error: You must be root to run this script! \033[0m"
@neroanelli
neroanelli / v2ex.py
Last active August 29, 2015 13:56
v2ex checkin script.
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests,time
I = 1
username = 'xxxxxxx' ###账号###
password = 'xxxxxxxx' ###密码###
login_url = 'http://v2ex.com/signin' ###如V2EX设置了使用 SSL,必须改 https###
index_url = 'http://v2ex.com' ###同上###
mission_url = 'http://www.v2ex.com/mission/daily' ###同上###
@neroanelli
neroanelli / kuaipan.py
Last active August 29, 2015 13:56
kuaipan checkin script.
__author__ = 'clownfish'
#coding:utf-8
import urllib2,urllib,cookielib,json,time
username = "xxxxxx"
password = "xxxx"
I = 1
class kp(object):
username = ''
password = ''
#登录显示页面
@neroanelli
neroanelli / redsocks2
Created November 23, 2013 14:55
redsocks2 initial script for tomato firmware.
#!/bin/sh
PREFIX="/opt/bin"
PIDFILE="/var/run/redsocks2.pid"
CONFFILE="/opt/etc/redsocks2/redsocks2.conf"
case "$1" in
start)
if [ -f "$PIDFILE" ]; then
echo "Redsocks2 is already running."
@neroanelli
neroanelli / shadowsocks
Last active April 12, 2021 21:11
shadowsocks for tomato firmware.
#!/bin/sh
BIN=shadowsocks
RUN_D=/var/run
ss_local_PID_FILE=$RUN_D/ss-local.pid
ss_redir_PID_FILE=$RUN_D/ss-redir.pid
ipset_blacklist="/opt/etc/ipset/blacklist"
ipset_whitelist="/opt/etc/ipset/whitelist"
file="/opt/etc/config/shadowsocks"
COND=$1
#! /bin/bash
### BEGIN INIT INFO
# Provides: shadowsocks
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Should-Start: network-manager
# Should-Stop: network-manager
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
#! /bin/bash
### BEGIN INIT INFO
# Provides: shadowsocks
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Should-Start: network-manager
# Should-Stop: network-manager
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6