Skip to content

Instantly share code, notes, and snippets.

View xiaods's full-sized avatar
🌏
Coding for Fun

Deshi Xiao xiaods

🌏
Coding for Fun
View GitHub Profile
@xiaods
xiaods / testhelpers.rb
Created February 27, 2010 15:53
test single ruby helper
require "rubygems"
require "test/unit"
require "stringio"
module Test::Unit
# Used to fix a minor minitest/unit incompatibility in flexmock
# AssertionFailedError = Class.new(StandardError)
class TestCase
@xiaods
xiaods / gist:337218
Created March 19, 2010 04:06 — forked from gerhard/etc_default_php-fastcgi
REE + nginx + Passenger + MySQL + mysql gem + git on Ubuntu 9.10 Karmic
# inspiration
# http://github.com/jnstq/rails-nginx-passenger-ubuntu
# sudo this sudo that bollocks
sudo -i
# system-related stuff
apt-get install htop strace sysstat
dpkg-reconfigure sysstat
apt-get install ntp
@xiaods
xiaods / gist:420453
Created June 1, 2010 01:31 — forked from wayneeseguin/gist:296055
rvm and rails3 setup follow
This example shows how to setup an environment running Rails 3 beta 3 under 1.9.2-head with a 'rails3' gem set.
∴ rvm update --head
# ((Open a new shell)) or do 'rvm reload'
# If you do not already have the ruby interpreter installed, install it:
∴ rvm install 1.9.2-head
# Switch to 1.9.2-head and gemset rails3, create if it doesn't exist.
∴ rvm --create use 1.9.2-head@rails3
user app;
worker_processes 2;
error_log /home/app/logs/nginx.error.log info;
events {
worker_connections 1024;
}
@xiaods
xiaods / gist:924997
Created April 18, 2011 08:34 — forked from thokra/gist:660949
batik highcharts imager convertor
class SvgController < ApplicationController
require 'active_support/secure_random'
def create
# create an SVG image
# based on Highcharts index.php
batik_path = Rails.root.to_s() + '/vendor/batik/batik-rasterizer.jar'
svg = params[:svg]
filename = params[:filename].blank? ? "chart" : params[:filename]
@xiaods
xiaods / gist:952663
Created May 3, 2011 01:19 — forked from anonymous/gist:887026
reverse proxy for tumblr,reference
upstream tumblr {
server 72.32.231.8:80;
}
server {
listen 80;
server_name jyorr.com;
access_log /var/log/nginx/jyorr.access.log;
@xiaods
xiaods / sparkOnShurenyun.md
Last active October 15, 2015 03:16 — forked from cfmcgrady/sparkOnMesos.md
玩转Spark on 数人云

###RUN SPARK ON 数人云

###单机版

  • Mesos运行在host上
  • Spark driver 和 executor运行docker上

#####1.搭建Mesos集群环境 详情 ,登录数人云,登录控制台后,通过集群管理创建自己的集群 #####2.运行Spark demo

@xiaods
xiaods / dki
Created October 16, 2015 02:30 — forked from itoffshore/dki
Create Docker data-only container + container with static ip address
#!/bin/sh
##############################################
data_paths=/srv/dockerdata/debuild:/build #
data_name=debdata #
data_image=user/debdata #
bridge=br0 #
ipfile=/etc/default/docker_ips #
##############################################
@xiaods
xiaods / gist:55142ccedbe4f25628a3
Created November 6, 2015 17:23
Zookeeper Performance way for shurenyun.co
# 下载测试包
git clone https://github.com/brownsys/zookeeper-benchmark.git
# build bench tools
mvn -DZooKeeperVersion=3.4.6 package
# run benchmark
java -cp target/lib/*:target/* edu.brown.cs.zkbenchmark.ZooKeeperBenchmark --conf benchmark.conf
@xiaods
xiaods / yh-shurenyun-install-tutorial.md
Last active November 20, 2015 00:05
永洪BI产品数人云安装方法

下载安装包

文件名为YonghongBI.sh

使用java:8镜像为基础容器镜像

dsxiao@omegamaster1:~$ docker images java
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
java 8 de4a13c84f53 8 days ago 641.9 MB