Skip to content

Instantly share code, notes, and snippets.

@dishuostec
dishuostec / aria2
Created November 4, 2014 06:29
init.d file for aria2c daemon (centos)
#!/bin/sh
#
# aria2 ariac server
#
# chkconfig: 345 70 30
# description: ariac server
# processname: aria2c
Prgmname="/usr/bin/aria2c"
shortname="aria2c"
@dishuostec
dishuostec / shadowsocks.xml
Last active August 29, 2015 14:09
shadowsocks config for winsw
<service>
<id>shadowsocks</id>
<name>shadowsocks</name>
<description>shadowsocks</description>
<executable>node</executable>
<startargument>sslocal</startargument>
<log mode="none"/>
</service>
@dishuostec
dishuostec / send_to_start_up.vbs
Created November 16, 2014 09:15
put this file in SendTo folder
if WScript.Arguments.Count = 0 then
WScript.Echo "Missing parameters"
else
strTargetPath = WScript.Arguments.item(0)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strTargetPath)
strBaseName = objFSO.GetBaseName(objFile)
strTargetFolder = objFSO.GetParentFolderName(objFile)
set WshShell = WScript.CreateObject("WScript.Shell")
@dishuostec
dishuostec / stop_hijack.bat
Last active August 29, 2015 14:09
使用windows系统防火墙拦截劫持ip
@echo off
color 1F
%windir%\system32\reg.exe query "HKU\S-1-5-19" >nul 2>&1 || (
echo -------
echo *** WARNING ***
echo -------
echo.
echo ADMINISTRATOR PRIVILEGES NOT DETECTED
echo ____________________________________________________________________________
@dishuostec
dishuostec / redis
Created December 17, 2014 05:20
redis service config file for winsw
<service>
<id>redis</id>
<name>redis</name>
<description>redis server</description>
<workingdirectory>d:\redis</workingdirectory>
<logpath>d:\redis\logs</logpath>
<logmode>rotate</logmode>
<executable>redis-server.exe</executable>
<startargument>redis.windows.conf</startargument>
<stopexecutable>taskkill.exe</stopexecutable>
@dishuostec
dishuostec / http劫持
Created December 17, 2014 14:31
阻止中国联通的http劫持
// ==UserScript==
// @name Frame Killer
// @namespace http://www.arantius.com/
// @description 联通http劫持
// @include *
// @grant none
// ==/UserScript==
var frames=document.evaluate("//frame", document, null,
XPathResult.ANY_TYPE, null);
var f;
#! /bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#===============================================================================================
# System Required: CentOS6.x (32bit/64bit)
# Description: Install Shadowsocks(libev) for CentOS
# Author: Teddysun <[email protected]>
# Intro: http://teddysun.com/357.html
#===============================================================================================
#!/bin/bash
log_dir=/usr/local/nginx/logs/
backup_log_dir=/data/nginx_logs/$(date +"%Y%m")/
log_date=$(date +"%Y%m%d")
nginx_pid=/var/run/nginx.pid
keep_days=30
echo "processing ${log_dir}"
#create backup dir
@dishuostec
dishuostec / backup.bat
Created February 26, 2015 05:59
winscp command line backup
C:\backup\exe\WinSCP.com /privatekey=C:\backup\a.ppk [email protected] /command "synchronize local C:\backup\data\ /data/sqldump/BACKUPS/" exit
@dishuostec
dishuostec / nodejs
Created October 5, 2015 04:09
node.js init.d script for CentOS
#!/bin/sh
#
# chkconfig: 35 99 99
# description: Node.js /home/nodejs/sample/app.js
#
. /etc/rc.d/init.d/functions
USER="nodejs"