Skip to content

Instantly share code, notes, and snippets.

index.translog.flush_threshold_period: 60s
index.refresh_interval: 60s
indices.memory.index_buffer_size: 50%
indices.memory.min_index_buffer_size: 300m
index.translog.flush_threshold: 30000
index.store.type: mmapfs
index.merge.policy.use_compound_file: false
@xiocode
xiocode / gist:8142377
Created December 27, 2013 03:55
go调用winapi dll
package main
/*
* title:golang调用kernel32.dll 设置console标题,获取系统磁盘列表以及容量
* author:[email protected]
* date:2013-12-27
*/
import (
"fmt"
"syscall"
"unsafe"
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
tar cvzf - /home/elasticsearch/elasticsearch.buzzreader/ | nc 61.147.69.93 12391 >> log.out &
nc -dl 12345 | tar xvzf - >> log.out &
@xiocode
xiocode / gist:8182558
Created December 30, 2013 14:18
服务器安装手册
添加EPEL
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
添加Postgresql
rpm -Uvh http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
yum install postgresql93-server postgresql93-devel
yum install bzr git hg
yum install gcc
@xiocode
xiocode / gist:8267527
Created January 5, 2014 12:13
.zshrc
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"
# Example aliases
{
"autocomplete_closures": true,
"autocomplete_builtins": true,
"autocomplete_suggest_imports": true,
"use_named_imports": true,
"fmt_cmd": ["goimports"],
"env":{
"GOROOT": "/Users/shao/Developer/go",
"GOPATH": "/Users/shao/Developer/workspace"
}
var Pages = mongoose.model('pages', pagesChema)
var contents = new Array()
Pages.find(function (err, pages) {
for (var i = 0; i < pages.length; i++) {
contents[i] = new Array()
var page = pages[i]
console.log(page)
contents[i][0] = {"value": "", "formatCode": "General"}
contents[i][1] = {"value": "vipabc", "formatCode": "General"}
contents[i][2] = {"value": page.createdat, "formatCode": "General"}
@xiocode
xiocode / gist:8997143
Last active August 29, 2015 13:56
docker note
先删除运行的image
sudo docker ps -a | grep Exit | awk '{print $1}' | sudo xargs docker rm
然后删除docker images下不用的
@xiocode
xiocode / gist:9088935
Last active August 29, 2015 13:56
Hadoop安装
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
export CLASSPATH=.:$JAVA_HOME/lib
export HADOOP_HOME=/home/docker/hadoop
export HIVE_HOME=/home/docker/hive
export PATH=$JAVA_HOME/bin:$HADOOP_HOME/bin:$HIVE_HOME/bin:$PATH

Hadoop配置文件 https://github.com/xiocode/playground