Skip to content

Instantly share code, notes, and snippets.

Hanwen Wu steinwaywhw

  • Google
  • US
Block or report user

Report or block steinwaywhw

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
steinwaywhw /
Last active Aug 29, 2015
My own install scripts.
sudo add-apt-repository -y ppa:synapse-core/ppa
sudo add-apt-repository -y ppa:webupd8team/sublime-text-3
sudo add-apt-repository -y ppa:moka/stable
sudo add-apt-repository -y ppa:ricotz/docky
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
sudo apt-get install -y moka-gnome-shell-theme plank moka-icon-theme faba-icon-theme faba-mono-icons plank-theme-orchis
sudo apt-get install -y synapse sublime-text-installer curl build-essential wget oracle-java8-installer
steinwaywhw /
Last active Aug 29, 2015
Repeat a SQL multiple times

Repeat a SQL Multiple Times using db2batch

Just enclose the SQL statements within --#BGBLK and --#EOBLK and feed it with a repeat-count as shown in input.sql.

Then run

db2batch -n DATABASE_NAME -f input.sql


steinwaywhw /
Created Aug 21, 2014
One-liner to find out all ports being reserved in /etc/services

One-liner to Find Out All Service Ports being Reserved in /etc/services/

This script show you all the ports that are being reserved by other programs. It will be useful when you want to find an available range of ports.

steinwaywhw / 0_reuse_code.js
Created Aug 18, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
steinwaywhw / FixityTest.g4
Last active Aug 29, 2015
Custom Precedence Climbing
View FixityTest.g4
grammar FixityTest;
@header {
import java.util.*;
@members {
Map<String, String> fmap = new HashMap<>();
Map<String, Integer> pmap = new HashMap<>();
steinwaywhw /
Last active Aug 29, 2015
Installing ATS2

One-liner for Installing ATS 2

Just run

curl -L | sudo sh

If you are using Cloud9 platform, this is what I suggest you to do.


Downgrading Bison Package on Ubuntu 14.04

In order to build MySQL 5.7, one needs a lower version of Bison. This script can help downgrade Bison from v3 to v2.7.

steinwaywhw / Config.groovy
Created Jun 27, 2014
Sample log4j configuration for Grails application
View Config.groovy
import org.apache.log4j.*
import grails.util.Holders
myconfig {
myvariable {
workdir = 0
log4j = {
steinwaywhw / Util.groovy
Last active Aug 29, 2015
Get server IP address at runtime in Grails/Groovy
View Util.groovy
def getIPAddress() {
return "ip route show dev eth0".execute().getText().tokenize()[9]

#Installing Node.js and NPM in 30s

You can’t perform that action at this time.