Skip to content

Instantly share code, notes, and snippets.

View yaodong's full-sized avatar

Yaodong Zhao yaodong

View GitHub Profile
@yaodong
yaodong / gist:8954589
Last active August 29, 2015 13:56
pessimistic iptables rules
#!/usr/bin/env bash
iptables -F
iptables -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
@yaodong
yaodong / 2012-12-24-再见,XOOPS.md
Last active August 29, 2015 13:57
2012-12-24-goodby-xoops.md

是时候说再见了,XOOPS

今天是圣诞节,一个叫 Micheal 的玩家加入到我在 Clash of Clans 游戏中的联盟中。这个名字让我回想起 2011 年发生在 XOOPS Development 邮件组的一场争论。不管谁对谁错,经过这一次的分裂,对于 XOOPS 来说是一次重大的打击。

基于我个人的所见所闻,XOOPS 的死亡是注定的。

持续地分裂。2001年,XOOPS 分裂于古老的 PHP-Nuke。2005年5月28日,日本团队分裂出 XOOPS 成立了 XOOPS Cube;2007 年 XOOPS 分裂出 ImpressCMS;2010年分裂出 XOOPS Engine,还有 Simple-XOOPS,坚守旧架构的 XOOPS1,等等。不仅团队成员,版本也存在相同的问题。XOOPS 2.x 系列被分裂为 2.0.x 和 2.2.x 而且互不完全兼容。当 Drupal 在 2007 年初(Drupal 5.0, 2007-01-15)开始使用 JQuery 时,XOOPS 还期望 2008 年能合并 2.0 和 2.2.x 分支(The 2.3 branch is defined by core development team as "merging of XOOPS 2.0 and 2.2 branches".[The XOOPS Project in 2008](http://www.xoops.org/modules/news/article.

@yaodong
yaodong / gist:11294892
Created April 25, 2014 16:14
How to define and include a module
# module name is a constant
module Debug
# constant will not be mixin
LEVEL = 'error'
# instance variable.
# It may clash with those of the host class or with those of other mixins.
# For the most part, mixin doesn't use instance variables directly, they use accessors of hosts.
attr_accessor :message
@yaodong
yaodong / gist:b4f7b914ce2b6c00ee80
Last active August 29, 2015 14:05
Install PostgreSQL on Ubuntu 14.04

update every time

sudo apt-get update
sudo apt-get dist-upgrade

install prefer apt-get

sudo apt-get install postgresql postgresql-contrib postgresql-clien
@yaodong
yaodong / unicorn.rb
Last active August 29, 2015 14:05
unicorn.rb
# Sample verbose configuration file for Unicorn (not Rack)
#
# This configuration file documents many features of Unicorn
# that may not be needed for some applications. See
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb
# for a much simpler configuration file.
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
@yaodong
yaodong / Berksfile
Created August 26, 2014 07:50
chef cookbooks
source "https://api.berkshelf.com"
cookbook 'build-essential', '~> 2.0.6'
cookbook 'sudo', '~> 2.7.0'
cookbook 'users', '~> 1.7.0'
cookbook 'chef-solo-search', '~> 0.5.1'
cookbook 'sshd', '~> 1.1.0'
cookbook 'fail2ban', '~> 2.2.0'
cookbook 'ufw', '~> 0.7.4'
@yaodong
yaodong / nginx.conf
Created August 28, 2014 11:42
Unicorn config examples
# This is example contains the bare mininum to get nginx going with
# Unicorn or Rainbows! servers. Generally these configuration settings
# are applicable to other HTTP application servers (and not just Ruby
# ones), so if you have one working well for proxying another app
# server, feel free to continue using it.
#
# The only setting we feel strongly about is the fail_timeout=0
# directive in the "upstream" block. max_fails=0 also has the same
# effect as fail_timeout=0 for current versions of nginx and may be
# used in its place.
PREFIX="/usr/local"
RBENV_PREFIX="$PREFIX/rbenv"
BIN_PATH="$PREFIX/bin"
RBENV_GROUP="rbenv"
umask 002
## Install rbenv, ruby-build and rbenv-gem-rehash
git clone git://github.com/sstephenson/rbenv.git $RBENV_PREFIX
# Configuration file for dnsmasq.
#
# Format is one option per line, legal options are the same
# as the long options legal on the command line. See
# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
# Listen on this specific port instead of the standard DNS port
# (53). Setting this to zero completely disables DNS function,
# leaving only DHCP and/or TFTP.
#port=5353
@yaodong
yaodong / dropbox-control.sh
Created January 10, 2015 16:15
script for start, stop and restart dropbox
#!/usr/bin/env bash
case $1 in
start)
open -a dropbox;
;;
stop)
osascript -e 'tell application "dropbox" to quit'
;;
restart)