Skip to content

Instantly share code, notes, and snippets.

Cong-Xin Cynthia Qiu ozooxo

Block or report user

Report or block ozooxo

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
@ozooxo
ozooxo / readme.md
Last active Jun 18, 2019
Setup a dev docker environment on AWS
View readme.md

Basically just spawn a new EC2 instance. I choose ubuntu 18.04 server, as Amazon 2 ECS optimized image doesn't have free tier. Log into the instance by

$ ssh ubuntu@<ec2-instance-ip>

No need to install git. But to make git clone works (even for public repo) I need to add my RSA key in this EC2 instance to github. Just follow this link to do so.

Follow this link to install docker.

@ozooxo
ozooxo / gist:9280304
Last active May 15, 2019
MPI always gives rank=0, size = 1
View gist:9280304

I accidentally installed multiple versions of MPI's (openmpi, mpich2, ...) in my Ubuntu 12.04 machine. I removed them all, and installed openmpi again; however, after fixing that (I never try before that), my MPI always gives rank=0, size = 1. The reason is that the removal process is incomplete, hence causes file sharing conflict. It can be seen from the following test

beta@landmark:~$ whereis mpicc
mpicc: /usr/bin/mpicc.mpich2 /usr/bin/mpicc.openmpi /usr/bin/mpicc
/usr/bin/X11/mpicc.mpich2 /usr/bin/X11/mpicc.openmpi /usr/bin/X11/mpicc
/usr/share/man/man1/mpicc.1.gz

It turns out that the packages libmpich2-3 and libmpich2-dev failed to be removed. So after apt-get remove libmpich2-3 libmpich2-dev, everything goes fine.

@ozooxo
ozooxo / install.md
Last active Apr 30, 2019
Install LocalStack (Mac)
View install.md
pip install --user localstack
brew install nose

Modify ~/.zshrc to add

export PATH="/Users/cynthia/Library/Python/3.6/bin:${PATH}"
@ozooxo
ozooxo / path.md
Last active Apr 24, 2019
Various related to `PATH` on Mac
View path.md

Check the path of one executable:

type -a postgres

Check the path:

echo $PATH
@ozooxo
ozooxo / gist:7568836
Created Nov 20, 2013
The ``smlnj`` package cannot be located by simply doing ``sudo apt-get install smlnj`` in ubuntu 12.04. It can be installed by running the following code.
View gist:7568836
beta@landmark:~$ sudo add-apt-repository ppa:hrzhu/smlnj-backport
beta@landmark:~$ sudo apt-get update
beta@landmark:~$ sudo apt-get install smlnj
beta@landmark:~$ sml
Standard ML of New Jersey v110.75 [built: Tue Aug 20 07:15:06 2013]
-
@ozooxo
ozooxo / python-with-exception.py
Last active Jun 18, 2018
Python content manager executing order
View python-with-exception.py
import contextlib
@contextlib.contextmanager
def inner():
try:
print("inner(): before yield")
yield "~~~message~~~"
print("inner(): after yield")
except Exception as e:
print("inner(): catch exception -- "+str(e))
View gist:faf6d4a30d41eac0b5f9a5e583e87ecd

Run default example:

$ ./gatling/bin/gatling.sh -sf gatling/user-files/simulations/computerdatabase/ -s computerdatabase.BasicSimulation -m

For a minimal setup using https://gatling.io/docs/current/extensions/maven_plugin/, then one can run it using mvn gatling:test.

For using io.gatling.highcharts:gatling-highcharts-maven-archetype, it seems have problem to run inside of Eclipse (I can't "add scala nature" even if I follow this toturial. However, to make it working in IntelliJ IDEA is quite straightforward (add scala plugin is kind of the only thing which need to handle).

@ozooxo
ozooxo / jdk.md
Last active May 8, 2018
Multiple JDK on MacOS
View jdk.md

Search Java version and install:

$ brew tap caskroom/versions

$ brew cask search java
==> Exact Match
java ✔
==> Partial Matches
charles-applejava          eclipse-javascript         java6                     netbeans-java-ee           yourkit-java-profiler
View gist:2a02684da960b4e610612ea6859114f5
The Linux users' guide to Mac OS X
https://www.techradar.com/news/computing/apple/the-linux-users-guide-to-mac-os-x-624449#article-body
How to Install and Dual Boot Linux and Mac OS
https://www.lifewire.com/dual-boot-linux-and-mac-os-4125733
You can’t perform that action at this time.