Skip to content

Instantly share code, notes, and snippets.

View homerquan's full-sized avatar

Homer Quan homerquan

View GitHub Profile
config = new BaseConfiguration()
storage = config.subset("storage")
storage.setProperty("backend", "inmemory")
index = storage.subset("index").subset("search")
index.setProperty("backend", "elasticsearch")
index.setProperty("local-mode", true)
index.setProperty("client-only", false)
index.setProperty("directory", "/tmp/titan/es")
@homerquan
homerquan / es.sh
Created July 10, 2013 03:32 — forked from rajraj/es.sh
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
@homerquan
homerquan / rmq-pub.js
Last active August 29, 2015 14:19 — forked from tlhunter/rmq-pub.js
#!/usr/bin/env node
var amqp = require('amqplib');
var exchange_name = 'pubsub';
amqp.connect('amqp://localhost').then(function(conn) {
process.once('SIGINT', function() { conn.close(); });
return conn.createChannel().then(function(channel) {
@homerquan
homerquan / build.sbt
Last active August 29, 2015 14:21 — forked from seratch/build.sbt
organization := "net.seratch"
name := "sandbox"
version := "0.1"
scalaVersion := "2.9.1"
libraryDependencies ++= Seq(
"junit" % "junit" % "4.9" withSources(),
package pc
import akka.actor.Actor
import akka.actor.Props
import akka.actor.ActorRef
import akka.actor.ActorRefFactory
class Parent extends Actor {
val child = context.actorOf(Props[Child], "child")
var ponged = false
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@homerquan
homerquan / jetty.sh
Last active September 7, 2015 18:49 — forked from tonek/jetty.sh
install jetty 9 CentOS
cd ~
sudo wget http://eclipse.org/downloads/download.php?file=/jetty/stable-9/dist/jetty-distribution-9.2.1.v20140609.tar.gz -O jetty.tar.gz
tar -xf jetty.tar.gz
rm -rf jetty.tar.gz
mv jetty-* jetty
sudo /usr/sbin/useradd jetty
sudo mv jetty /srv/
@homerquan
homerquan / sublime-text-2.sh
Created January 17, 2016 02:52 — forked from henriquemoody/sublime-text-2.sh
Install Sublime Text on Fedora.
#!/usr/bin/env bash
# Usage: {script} [ OPTIONS ] TARGET VERSION
#
# TARGET Default target is "/usr/local".
# VERSION If not defined tries to get the build into the Sublime Text 2 website.
#
# OPTIONS
#
# -h, --help Displays this help message.
#
@homerquan
homerquan / OpenWithSublimeText2.bat
Created February 2, 2016 15:50 — forked from mrchief/LICENSE.md
Add "Open with Sublime Text 2" to Windows Explorer Context Menu (including folders)
@echo off
SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f