But original post can not access anymore.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\controllers; | |
use lithium\net\http\Router; | |
use lithium\storage\Session; | |
use li3_oauth\models\Consumer; | |
class WeiboController extends \lithium\action\Controller { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -------------------------------------------------------------------------------------- | |
# Download all pdf/ppt/pptx/zip/doc/odp files in page. | |
# | |
# Usage: | |
# xxx@xxx:~$ wget_slides http://velocityconf.com/velocity2010/public/schedule/proceedings | |
# Download all velocity 2010 slides. | |
# -------------------------------------------------------------------------------------- | |
function wget_slides () { | |
curl -sX GET "$1" | grep -or 'http:\/\/[^\"]\+\.\(pdf\|pptx\?\|zip\|doc\|odp\)' | awk '{print "\""$0"\""}' | xargs wget |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in `curl -s http://www.qconbeijing.com/schedule.html | grep -oe '\"[^\"]\+\.\(pdf\|rar\|zip\|ppt\|pptx\|odt\|doc\|docs\)' | cut -d\" -f2`; do wget http://www.qconbeijing.com/$f; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace path\to\lib; | |
use BadMethodCallException; | |
use lithium\core\Libraries; | |
use lithium\util\Inflector; | |
/** | |
* This class can extend either \lithium\data\entity\Record or \lithium\data\entity\Document |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# ---------------------------------------------------------------------------- | |
# | |
# Test under 64-bit Debian Squeeze | |
# | |
# Thanks follow up posts: | |
# | |
# - Ruby 1.8.2 and Checkinstall 1.6.0: | |
# http://checkinstall.izto.org/cklist/msg00770.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#if [ `whoami` != 'root' ]; then | |
#echo "Please run as root." | |
#exit 1 | |
#fi | |
cat << 'EOF' > /etc/init.d/fluentd | |
#! /bin/sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- virtualbox_4_1.rb.orig 2012-09-09 01:24:56.000000000 +0800 | |
+++ virtualbox_4_1.rb 2012-09-09 01:39:32.000000000 +0800 | |
@@ -135,15 +135,22 @@ | |
def forward_ports(ports) | |
args = [] | |
ports.each do |options| | |
- pf_builder = [options[:name], | |
- options[:protocol] || "tcp", | |
- "", | |
- options[:hostport], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf8 -*- | |
from simplejson import loads | |
from simplejson.decoder import JSONDecodeError | |
from betterprint import pprint | |
from os import path | |
if __name__ == '__main__': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias vmlive="VBoxManage list runningvms" | |
function vmstart () { | |
if [ -e $1 ]; then | |
echo 'No VirualMachine specified. All available machines:' | |
VBoxManage list vms | cut -d'"' -f2 | sed -E 's/(.*)/> \1/' | |
return | |
fi | |
local _EXISTS=`VBoxManage list vms | grep $1 | wc -l | awk '{print $1}'` | |
if [ ! $_EXISTS -eq 1 ]; then |
OlderNewer