Skip to content

Instantly share code, notes, and snippets.

@rming
rming / launch-gce-shadowsocks.sh
Created May 2, 2017 07:41 — forked from nk23x/launch-gce-shadowsocks.sh
Shadowsocks on GCE automation scripts
#!/bin/bash
machine_type=f1-micro
image=ubuntu-14-04
gcloud compute instances create shadowsocks-1 \
--can-ip-forward --image $image --restart-on-failure \
--zone asia-east1-b --machine-type $machine_type \
--metadata-from-file startup-script=bin/shadowsocks-startup.sh
/*genarate javascript namspace function*/
var _ns= {};
_ns.genNameSpace= function(path, loseMe){
var reg = /^[_$a-z]+[_$a-z0-9]*/i;
var nsAr = path.split('.');
var stringCommond = "";
var stringNS = "";
var n = loseMe ? nsAr.length - 1 : nsAr.length;
for (var i = 0; i < n; i++){
if(!reg.test(nsAr[i])) {
2016/11/25 09:47:39 [19567] params.c:Parameter() - Ignoring badly formed line in config file: ignore errors
2016/11/25 09:47:39 [19567] name lookup failed for 119.162.158.222: Name or service not known
2016/11/25 09:47:39 [19567] connect from UNKNOWN (119.162.158.222)
2016/11/25 01:47:39 [19567] rsync on ftpuserhome/13/test/ from rsyncer@UNKNOWN (119.162.158.222)
2016/11/25 01:47:39 [19567] building file list
2016/11/25 01:47:39 [19567] 2016/11/25 01:47:39 119.162.158.222 ftpuserhome 13/test/1234.jpg 83186
2016/11/25 01:47:39 [19567] sent 83,292 bytes received 55 bytes total size 83,135
2016/11/25 09:53:21 [19640] params.c:Parameter() - Ignoring badly formed line in config file: ignore errors
2016/11/25 09:53:21 [19640] name lookup failed for 119.162.158.222: Name or service not known
2016/11/25 09:53:21 [19640] connect from UNKNOWN (119.162.158.222)
<?php
$key = '11345678901234561234567890123456';
$iv = '1234567890123456';
$method = "AES-256-CBC";
$options = OPENSSL_RAW_DATA;
$text = "Really";
$pkc_encoder = new PKCS7Encoder();
$text = $pkc_encoder->encode($text);
$res = openssl_encrypt($text, $method, $key, $options, $iv);
echo "pkcs7: " . bin2hex($text);
# use UTF8
set -g utf8
set-window-option -g utf8 on
# make tmux display things in 256 colors
#set -g default-terminal "screen-256color"
# set scrollback history to 10000 (10k)
set -g history-limit 10000
@rming
rming / 1
Created October 13, 2016 03:02 — forked from huobazi/1
添加 删除ubuntu自启动服务 init.d
1. 装个 sysv-conf-rc
2. sudo update-rc.d -f mysql remove 删除mysql随机器启动的服务
sudo update-rc.d -f apache2 remove 删除apache2随机器启动的服务
3. 查看/etc/rc2.d/里面的apache和mysql启动脚本,通常都是两个阿拉伯数字后再接一个英文字母,再加脚本名称。英文字母 是S的都是会自动启动的,K则相反。所以只要找到apache和mysql的启动脚本,把S改成K就可以了
@rming
rming / supervisord.sh
Last active June 1, 2016 05:51 — forked from danmackinlay/supervisord.sh
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@rming
rming / serverspeeder-all.sh
Created April 15, 2016 01:56 — forked from rptec/serverspeeder-all.sh
锐速破解版一键安装。
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PATH
#定义变量
#授权文件自动生成url
APX=http://soft.91yun.org/soft/serverspeeder/apx1.php
#安装包下载地址
INSTALLPACK=http://soft.91yun.org/soft/serverspeeder/91yunserverspeeder.tar.gz
@rming
rming / gist:70769051a830e8c92561
Created March 29, 2016 16:10 — forked from ergatea/gist:4487615
Shadowsocks 启动脚本
Shadowsocks 启动脚本
# insserv -v -d /etc/init.d/shadowsocks
=====================
#!/bin/sh
### BEGIN INIT INFO
# Provides: shadowsocks
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
@rming
rming / nginx
Created March 29, 2016 14:03 — forked from vdel26/nginx
Openresty init.d script
#!/bin/sh
#
# chkconfig: 2345 55 25
# Description: Nginx init.d script, put in /etc/init.d, chmod +x /etc/init.d/nginx
# For Debian, run: update-rc.d -f nginx defaults
# For CentOS, run: chkconfig --add nginx
#
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all