Skip to content

Instantly share code, notes, and snippets.

Jay lakemove

Block or report user

Report or block lakemove

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
lakemove / pom.xml
Created Jun 9, 2012
maven pom.xml basic structure
View pom.xml
<project xmlns=""
lakemove / commandline.bat
Created Jun 14, 2012
customized windows commandline
View commandline.bat
doskey ls=dir /b $*
rem Java
set JAVA_HOME=C:\opt\jdk1.6.0_25
set Path=%JAVA_HOME%\bin;%Path%
rem Maven
set MVN_HOME=C:\opt\apache-maven-3.0.4
lakemove /
Last active Oct 7, 2015
useful shell commands
# tcpdump ldap traffic to a file, then can be analyzed by wireshark
sudo tcpdump -vv -w /tmp/ldapdump -i lo port 389
#sniff http traffic
sudo ngrep -q -d eth0 -W byline host and port 8180
#Search recursively to find a word or phrase in certain file types, such as C code
find . -name "*.[ch]" -exec grep -i -H "search pharse" {} \; | column -t -s ":"
#search empty folder
lakemove /
Created Aug 8, 2012
script to bootstrap hudson in tomcat
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0_25
export CATALINA_HOME=/usr/lib/apache-tomcat-7.0.26
export CATALINA_BASE=/srv/hudson-ci
export HUDSON_HOME=/srv/hudson-ci/hudson-home
export PATH=$JAVA_HOME/bin:$PATH
# see
# to disable it , use "-XX:-UsePerfData" ,
lakemove / web
Created Oct 25, 2012
The essence of this technique
View web
//pure-CSS drop down menus ul ul {
display: none;
} li:hover > ul {
display: block;
//image pre-loader
function preloadImages() {
lakemove / blog-app.conf
Created Oct 29, 2012
node upstart script
View blog-app.conf
description "blog-app server"
author "Jay"
start on startup
stop on shutdown
#Your scripts
cd /home/jay/works/blog-app
lakemove /
Created Mar 21, 2013
self-executable shell commandline shamelessly copied from [jgit|]
for a in "$@"
case "$a" in
-*) continue ;;
*) cmd=$a; break; ;;
lakemove /
Created Mar 28, 2013
showcase svn automated operations and invoking Java from shell script
mkdir $WORKDIR && cd $WORKDIR
svn info svn+ssh:// >/dev/null
if [ $? -eq 0 ]; then
echo "branch already exist, delete it [y/n](y)?"
svn rm svn+ssh:// -m "delete to create"
lakemove /
Last active Aug 29, 2015
download coursera lecture videos
# download video by providing video url and cookie.
# saved file name will be from Content-Disposition
function download() {
local url=$1
local cookies=$2
local filename=$(curl -I -L -s --cookie "$cookies" "$url" | grep Content-Disposition | python -c "import sys, urllib as ul; print ul.unquote(;" | awk -F\" '{print $2}')
echo "start to download $filename"
lakemove / gist:9929800
Last active Aug 29, 2015
calculate mean and variance in a single iteration
View gist:9929800
var data = [{x: 1, p: 0.1}, {x: 2, p: 0.3}, {x: 8, p: 0.6}]; //{x:probability}
var mu = 0, sigma = 0;
for (i in data) {
mu += i.p * i.x;
sigma += i.p * i.x * i.x;
You can’t perform that action at this time.