Skip to content

Instantly share code, notes, and snippets.

View zrong.php-fpm.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>zrong.php-fpm</string>
<key>ProgramArguments</key>
<array>
@zrong
zrong / cutmp3.sh
Created Feb 12, 2017
cut a mp3 file by ffmpeg
View cutmp3.sh
#!/bin/bash
##############################
# cut a mp3 file
# @author rzeng
# @date 2017-02-12
# @requirements ffmpeg
##############################
if ! [ "$(which ffmpeg)" ];then
echo "Install ffmpeg first!"
@zrong
zrong / shrink.sh
Last active Mar 6, 2018
shrink.sh
View shrink.sh
#!/bin/bash
##############################
# shrink the mp3 files
# @author rzeng
# @date 2017-02-12
# @update 2018-03-06
# @requirements lame
##############################
if ! [ "$(which lame)" ];then
@zrong
zrong / Buffer.ts
Created Sep 22, 2015
Int64.ts and Buffer.ts for egret.
View Buffer.ts
////////////////////////////////////////
// Buffer.ts
// extend egret.ByteArray, implement writeInt64
// @author zrongzrong@gmail.com
// Creation 2015-09-14
////////////////////////////////////////
class Buffer extends egret.ByteArray
{
private static SIZE_OF_INT64:number = 8;
@zrong
zrong / pure-ftpd.sh
Last active Apr 27, 2016
pure-ftpd init script for centos
View pure-ftpd.sh
#!/bin/bash
#
# Startup script for the pure-ftpd FTP Server $Revision: 1.1 $
#
# chkconfig: - 85 15
# description: Pure-FTPd is an FTP server daemon based upon Troll-FTPd
# processname: pure-ftpd
# pidfile: /var/run/pure-ftpd.pid
# config: /etc/pure-ftpd/pure-ftpd.conf
@zrong
zrong / annual_gift_lottery.lua
Last active Aug 29, 2015
Using: host/gift/yourname
View annual_gift_lottery.lua
#!/usr/bin/lua
-- Using:
-- Deploy this file to openresty
-- and visit host/gift/yourname.
-- E.g http://192.168.18.22/gift/zengrong
-- Will get a gift object for zengrong.
function in_table(t, v)
for key,value in pairs(t) do
if type(value) == 'table' then
View redis-server
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis/redis.pid
@zrong
zrong / 660-init-deb.sh
Last active Aug 29, 2015
nginx start script for CentOS an Ubuntu
View 660-init-deb.sh
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
View PList.as
package maroo.codec
{
import flash.utils.ByteArray;
import mx.utils.Base64Decoder;
public class PList
{
public static function parse(source:XML):Object
{
switch (source.name().localName) {
@zrong
zrong / dnspodsh.sh
Last active Sep 30, 2020
在bash中使用DNSPod的API接口实现DDNS客户端
View dnspodsh.sh
#!/bin/bash
##############################
# dnspodsh v0.3
# 基于dnspod api构架的bash ddns客户端
# 作者:zrong(zengrong.net)
# 详细介绍:http://zengrong.net/post/1524.htm
# 创建日期:2012-02-13
# 更新日期:2012-03-11
##############################
You can’t perform that action at this time.