Skip to content

Instantly share code, notes, and snippets.

@huahang
huahang / gist:e6ebf948804fd7ea7c13
Created April 9, 2015 07:07
2 clients aquired the same InterProcessLock?
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.recipes.locks.InterProcessLock;
import org.apache.curator.framework.recipes.locks.InterProcessMutex;
import org.apache.curator.retry.ExponentialBackoffRetry;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class MutexExample {
@huahang
huahang / .bash_profile
Last active December 26, 2015 14:19
Install Python from Source for CentOS 6
# User specific environment and startup programs
export PATH=$HOME/bin:$PATH
export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH
export VIRTUAL_ENV_DISABLE_PROMPT=1
source $HOME/.python-venv/bin/activate
@huahang
huahang / brew upgrade -v
Created June 11, 2013 13:43
Error messages when I do "brew upgrade" in OS X Mavericks.
$ brew upgrade -v
==> Upgrading 2 outdated packages, with result:
serf 1.2.1, subversion 1.7.10
==> Upgrading serf
==> Downloading http://serf.googlecode.com/files/serf-1.2.1.tar.bz2
Already downloaded: /Library/Caches/Homebrew/serf-1.2.1.tar.bz2
tar xf /Library/Caches/Homebrew/serf-1.2.1.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/serf/1.2.1 --with-apr=/usr/local/Library/ENV/4.3
./configure --prefix=/usr/local/Cellar/serf/1.2.1 --with-apr=/usr/local/Library/ENV/4.3
checking for chosen layout... Serf