Skip to content

Instantly share code, notes, and snippets.

View lidaobing's full-sized avatar
🦍
Mammal - verified by Github

LI Daobing lidaobing

🦍
Mammal - verified by Github
View GitHub Profile
#!/usr/bin/env python
# Usage:
# This script will generate two files(vpnup and vpndown) after executing.
# Do chmod a+x on the two newly created files, and then move them to the
# openvpn config folder. then add the following two lines to the vpn config file:
# up vpnup
# down vpndown
# you might also need 'redirect-gateway' in the config file, if you don't use vpn
# as the default gateway.
@lidaobing
lidaobing / .vimrc
Created September 9, 2010 07:21
.vimrc
set ai
"set guioptions-=m
set guioptions-=T
"set textwidth=72
"set background=light
set wrap
set nocp
syntax on
filetype on
filetype indent on
@kdwinter
kdwinter / authenticable.rb
Created June 14, 2010 21:52
Authlogic with Mongoid (in spirit of http://pastie.org/503478)
module Authenticable
def self.included(model)
model.class_eval do
extend ClassMethods
include InstanceMethods
field :username
field :email
field :crypted_password
field :password_salt
require 'rack'
module Rack
class Obama
CONTENT_TYPE = "nobel-prize/peace".freeze
def initialize(app)
@app = app