Skip to content

Instantly share code, notes, and snippets.

function print_lua_table (lua_table, indent)
indent = indent or 0
for k, v in pairs(lua_table) do
if type(k) == "string" then
k = string.format("%q", k)
end
local szSuffix = ""
if type(v) == "table" then
szSuffix = "{"
end
@rming
rming / entity.lua
Last active September 6, 2015 10:07 — forked from jordoh/entity.lua
Starbound lua API
--- Stubs for entity.* callbacks defined in C++.
--
-- DO NOT INCLUDE this file in your scripts, it is for documentation purposes only.
--
-- Entity callbacks query and mutate the specific entity that is running the
-- lua script. They can be called from a _different_ entity using
-- world.callScriptedEntity(targetEntityId, "entity.*"), replacing "*" with the
-- name of a function defined below.
--
-- Specific types of entities (e.g. NPCs, Objects) define different sets of
@rming
rming / coreseek_install.sh
Created November 4, 2015 04:23 — forked from huobazi/coreseek_install.sh
Coreseek for MySQL 数据源 安装教程
Coreseek (Sphinx) for MySQL 数据源 安装教程
1. 下载源代码
$ wget http://www.coreseek.cn/uploads/csft/3.2/coreseek-3.2.13.tar.gz
$ tar xzf coreseek-3.2.13.tar.gz
$ cd coreseek-3.2.13
2. 中文测试环境检查:
@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
@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 / 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 / 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 / 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 / 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
@rming
rming / 1) Install
Created July 31, 2017 08:27 — forked from nghuuphuoc/1) Install
Install Redis on Centos 6
// --- Compiling ---
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ tar xzvf redis-2.8.3.tar.gz
$ cd redis-2.8.3
$ make
$ make install
// --- or using yum ---
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm