Skip to content

Instantly share code, notes, and snippets.

View steinwaywhw's full-sized avatar

Steinway Wu steinwaywhw

View GitHub Profile
@steinwaywhw
steinwaywhw / gist:f7a60d7de1ac321bed4b
Created June 1, 2015 16:29
Common Suffix for Pretty ATS Output
... 2>&1 | sed 's/S2\(E\|RT\)\|_type\|_t0ype\|C3NSTR\|_bool//g' | sed -e "s/\(cst\|BASpre\)(\(\\w\+\))/\2/g" | em "line=\d+" -f red | em "\[\w+\]" -f yellow | em "SHOWTYPE" -f blue | em "needed term" -l -f bold | sed -e "s/Var([0-9]\+->var(\(\\w\+\)([0-9]\+)))/\1/g" | sed -e "s/app(\(.*\); \(.*\))/\1(\2)/g"
@steinwaywhw
steinwaywhw / Readme.md
Created May 10, 2015 22:01
One-liner to remove un-tagged docker images
docker rmi $(docker images | grep "^<none>" | tr -s ' ' | cut -d ' ' -f 3)
@steinwaywhw
steinwaywhw / install.sh
Last active August 29, 2015 14:08
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
steinwaywhw / Readme.md
Last active August 29, 2015 14:05
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

Reference:

@steinwaywhw
steinwaywhw / Readme.md
Created August 21, 2014 17:28
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
steinwaywhw / 0_reuse_code.js
Created August 18, 2014 15:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@steinwaywhw
steinwaywhw / FixityTest.g4
Last active August 29, 2015 14:05
Custom Precedence Climbing
grammar FixityTest;
@header {
import java.util.*;
}
@members {
Map<String, String> fmap = new HashMap<>();
Map<String, Integer> pmap = new HashMap<>();
@steinwaywhw
steinwaywhw / README.md
Last active August 29, 2015 14:04
Installing ATS2

One-liner for Installing ATS 2

Just run

curl -L http://git.io/vJbxe | 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
steinwaywhw / Util.groovy
Last active August 29, 2015 14:03
Get server IP address at runtime in Grails/Groovy
def getIPAddress() {
return "ip route show dev eth0".execute().getText().tokenize()[9]
}