Skip to content

Instantly share code, notes, and snippets.

View charlescui's full-sized avatar

CharlesCui charlescui

  • TvTaobao 电视淘宝 杭州智屏电子商务
  • China ZheJiang HangZhou
View GitHub Profile
@charlescui
charlescui / wr703n-openwrt.md
Created September 5, 2012 23:21 — forked from ninehills/wr703n-openwrt.md
WR703N OpenWrt 配置流程

WR703N OpenWrt 配置流程

下载安装

访问WR703N在OpenWrt的[Wiki页][wr703n-openwrt],然后在Flashing一节中找到下载链接:[squashfs-factory.bin][flash.bin],下载后别忘了[比对md5][md5sum]。[1]

进入路由器管理界面,出厂配置为http://192.168.1.1,用户名和密码均为admin,然后进入固件更新,选择下载的文件,然后更新。

@charlescui
charlescui / bijective.rb
Created July 14, 2012 15:07 — forked from zumbojo/bijective.rb
Simple bijective function (base(n) encode/decode)
# Simple bijective function
# Basically encodes any integer into a base(n) string,
# where n is ALPHABET.length.
# Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047
ALPHABET =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//)
# make your own alphabet using:
# (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join
@charlescui
charlescui / runtime_callback.rb
Created April 9, 2012 08:55 — forked from outoftime/runtime_callback.rb
Add support for OmniAuth callbacks defined at runtime
#
# Including this module in an OmniAuth strategy implementation allows it to have
# a runtime-defined callback path extension. The callback path always begins
# with the predefined callback path, but may extend it. Specify a callback path
# extension at runtime by passing the 'callback' parameter to the request-phase
# auth URL. For example, the below URL:
#
# http://your.host/auth/facebook?callback=users/create
#
# Will issue a callback to:
@charlescui
charlescui / connection_fix.rb
Created March 24, 2012 04:05 — forked from taras-yorku/connection_fix.rb
MySQL server has gone away fix - Ensure it only affects mysql2 adapter
# If your workers are inactive for a long period of time, they'll lose
# their MySQL connection.
#
# This hack ensures we re-connect whenever a connection is
# lost. Because, really. why not?
#
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar)
#
# From:
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/
@charlescui
charlescui / gist:1172826
Created August 26, 2011 06:22 — forked from liwh/gist:1022751
install coreseek on mac os
# 按照coreseek网站上的安装步骤没装上,所以采用了下面的安装方式,安装成功!
sudo port install autoconf263 libtool-devel m4 autoconf automake libtool
cd mmseg-3.2.14
aclocal && glibtoolize --copy --force --ltdl && autoreconf -i -f && automake --a && ./configure --prefix=/usr/local/mmseg3 && make && sudo make install
cd ../csft-3.2.14
./configure --prefix=/usr/local/coreseek --without-unixodbc --with-mmseg --with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg3/lib/ --with-pgsql
sphinx: &using
address: sphinx-server-host-ip
bin_path: /usr/local/bin
searchd_binary_name: searchd
indexer_binary_name: indexer
enable_star: 1
min_prefix_len: 3
prefix_fields: name
mem_limit: 1024M
morphology: 'none'