Skip to content

Instantly share code, notes, and snippets.

View zxkane's full-sized avatar

Meng Xin Zhu zxkane

View GitHub Profile
@zxkane
zxkane / .gitignore
Last active August 29, 2015 14:20
Simple pmr server
*.pyc
@zxkane
zxkane / output
Last active August 29, 2015 14:24
gradle exec issue
➜ wechat git:(master) ✗ ./gradlew -b test.gradle npm -S
:npm FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':npm'.
> A problem occurred starting process 'command 'npm''
* Try:
@zxkane
zxkane / default
Last active August 29, 2015 14:25 — forked from pdeschen/initd
# defaults for VME wechat server
# pulled in from the init script; makes things easier.
NAME=vme-wechat
# location of java
JAVA=/home/jenkins/jenkins-home/tools/hudson.model.JDK/java-1.8/bin/java
# arguments to pass to java
JAVA_ARGS="-Dspring.profiles.active=svt" # specify active profile for spring boot
@zxkane
zxkane / vme-jenkins-docker.sh
Created July 22, 2015 10:44
launch jenkins docker container
docker stop vme-jenkins
docker rm vme-jenkins
export HOST_IP=`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
docker run --name vme-jenkins -p $HOST_IP:8080:8080 -p 50000:50000 -e "JAVA_OPTS=-Duser.timezone=Asia/Hong_Kong" -v /home/zxkane/jenkins:/var/jenkins_home -d jenkins
@zxkane
zxkane / ssh-tunnel0.sh
Created February 21, 2012 14:14
automatically create ssh tunnel to forward port
ssh -q -N -o stricthostkeychecking=no -R 10002:localhost:22 -R 5900:localhost:5900 -R 6500:localhost:6500 username@mydomain.gicp.net&
@zxkane
zxkane / embedded-jetty-osgi
Created March 5, 2012 11:22
Minimum bundle list of embedded Jetty in Equninox
javax.servlet
javax.transaction
org.eclipse.equinox.http.jetty
org.eclipse.equinox.http.servlet
org.eclipse.osgi.services
org.eclipse.osgi
org.mortbay.jetty.server
org.mortbay.jetty.util
@zxkane
zxkane / json_dump.java
Created March 14, 2012 16:00
dump a string that presents json data
public static void main(String[] args) throws JSONException {
JSONObject obj = new JSONObject(
"{}"); //$NON-NLS-1$
dump(0, "", obj);
}
private static void dump(int level, String name, Object obj) throws JSONException {
for (int i = 0; i < level; i++)
System.out.print("\t");
if (obj instanceof JSONObject) {
@zxkane
zxkane / brew_log_install_32bit_postgresql
Created September 1, 2012 11:46
log of installing 32bit postgresql on mac osx
ocalhost% brew unlink ossp-uuid && brew link ossp-uuid -- INSERT --
Unlinking /usr/local/Cellar/ossp-uuid/1.6.2... 8 links removed
Linking /usr/local/Cellar/ossp-uuid/1.6.2... 8 symlinks created
localhost% HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install postgresql --32-bit --universal -- INSERT --
==> Downloading http://ftp.postgresql.org/pub/source/v9.1.4/postgresql-9.1.4.tar.bz2
Already downloaded: /Library/Caches/Homebrew/postgresql-9.1.4.tar.bz2
/usr/bin/tar xf /Library/Caches/Homebrew/postgresql-9.1.4.tar.bz2
==> Patching
/usr/bin/patch -f -p1 -i 000-homebrew.diff
patching file src/pl/plpython/Makefile
@zxkane
zxkane / .gitignore
Last active December 18, 2015 20:29
A python program is intended to automatically order goods in second kill of Amazon.cn. Prerequisites: requests, lxml, selenium
*.pyc
.settings/
@zxkane
zxkane / mirror.sh
Created July 8, 2013 07:54
Use p2's ant task to mirror repository
./eclipse --launcher.suppressErrors -nosplash -data ws -application org.eclipse.ant.core.antRunner -buildfile mirror.xml