Skip to content

Instantly share code, notes, and snippets.

@alvin2ye
alvin2ye / install ree on ubuntu 14.04.md
Created June 3, 2014 15:06
Ubuntu 14.04 Install Ruby1.8.7 OR REE has Error "timeout.rb:60: [BUG] Segmentation fault"

失败原因是gcc 版本太高

gcc > 4.6 的版本,安装前需要

export CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls"

已经编译的要删除重新编译。

; Summary: Proxy Switchy! Exported Rule List
; Date: Sunday, May 15, 2011
; Website: http://bit.ly/proxyswitchy
#BEGIN
[wildcard]
*://192.168.1.*
*://www.amazon.com/*
*://www.bbc.co.uk/*
{"RetCode":0,"Action":"DescribeUHostInstanceResponse","UHostSet":[{"UHostId":"uhost-nn1asj","UHostType":"Normal","OsType":"Linux","ImageId":"cec2b3cd-8fa2-41ab-8f1c-bae4b254f078","BasicImageId":"uimage-xqxgvr","BasicImageName":"Ubuntu 14.04 32位","Tag":"超达 PIE 服务器","Name":"s152","State":"Running","CreateTime":1420983089,"ChargeType":"Month","ExpireTime":1423661490,"CPU":1,"Memory":2048,"DiskSet":[{"Type":"Boot","DiskId":"cec2b3cd-8fa2-41ab-8f1c-bae4b254f078","Drive":"/dev/sda","Size":20}],"IPSet":[{"Type":"Private","IP":"10.4.24.222"},{"Type":"Telecom","IPId":"eip-xrnw1m","IP":"183.131.76.95","Bandwidth":2}]},{"UHostId":"uhost-13mlhb","UHostType":"Normal","OsType":"Linux","ImageId":"dbcac69d-88b0-4637-9564-030dc3aaf68f","BasicImageId":"uimage-3mndzp","BasicImageName":"Ubuntu 14.04 64位","Tag":"鹿城建设","Name":"s149","State":"Running","CreateTime":1419820341,"ChargeType":"Month","ExpireTime":1422498741,"CPU":1,"Memory":2048,"DiskSet":[{"Type":"Boot","DiskId":"dbcac69d-88b0-4637-9564-030dc3aaf68f","Drive":"/dev/sda"
alert(2)
@alvin2ye
alvin2ye / qs.rb
Created July 6, 2009 06:15 — forked from jmettraux/qs.rb
require 'rubygems'
require 'openwfe/engine/file_persisted_engine' # sudo gem install ruote
engine = OpenWFE::FilePersistedEngine.new(
:definition_in_launchitem_allowed => true)
#
# the process definition
class MyTodoProcess < OpenWFE::ProcessDefinition
@alvin2ye
alvin2ye / gist:141920
Created July 7, 2009 06:09
ruby benchmark
require 'benchmark'
def method_1
# `curl -d "password=403" http://wiki.agideo.com/agideowiki/authenticate >> /dev/null 2>&1 `
`curl http://f22.agideo.com >> /dev/null 2>&1 `
# `curl http://agi-alvin.javaeye.com >> /dev/null 2>&1 `
# `curl http://www.google.com >> /dev/null 2>&1 `
# `curl http://primy.agideo.com >> /dev/null 2>&1 `
# `curl http://douban.com >> /dev/null 2>&1 `
end
@alvin2ye
alvin2ye / gist:144591
Created July 10, 2009 16:07
google ajax loading
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" language="javascript">
google.load("jquery", "1.2");
google.load("jqueryui", "1.5.2"); // 不用 jQuery UI 可以不用此行
</script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
alert($);
});
@alvin2ye
alvin2ye / gist:148972
Created July 17, 2009 09:39
Ext.Toolbar
var tb = new Ext.Toolbar({
renderTo: document.body,
width: 600,
height: 100,
items: [
{
// xtype: 'button', // default for Toolbars, same as 'tbbutton'
text: 'Button'
},
@alvin2ye
alvin2ye / ext3 ajax tree click
Created July 18, 2009 02:59
ext3 ajax tree click
Ext.onReady(function(){
// shorthand
var Tree = Ext.tree;
var tree = new Tree.TreePanel({
useArrows: true,
preloadChildren :true,
autoScroll: true,
animate: true,
containerScroll: true,
@alvin2ye
alvin2ye / Ext.data.ScriptTagProxy 跨域访问
Created July 23, 2009 08:48
Ext.data.ScriptTagProxy 跨域访问
var ds = new Ext.data.Store({
proxy: new Ext.data.ScriptTagProxy({
url: 'http://extjs.com/forum/topics-remote.php'
}),
reader: new Ext.data.JsonReader({
root: 'topics',
totalProperty: 'totalCount',
id: 'post_id'
}, [
{name: 'title', mapping: 'topic_title'},