Skip to content

Instantly share code, notes, and snippets.

View ozooxo's full-sized avatar

Cong-Xin Cynthia Qiu ozooxo

View GitHub Profile
$ kubectl create clusterrolebinding MYNAME-cluster-admin-binding --clusterrole=cluster-admin --user=MYNAME@gmail.com
$ kubectl create namespace argocd
$ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
$ kubectl -n argocd get pods
NAME READY STATUS RESTARTS AGE
argocd-application-controller-5bc5cf665f-8hgl2 1/1 Running 0 70s
argocd-dex-server-b59646b69-7mktd 1/1 Running 0 70s
argocd-redis-868b8cb57f-lz7qj 1/1 Running 0 70s
@ozooxo
ozooxo / gist:e654861f055758ffd76a4745e0d2bdb7
Created July 26, 2019 22:53
List all open ports in Mac
sudo lsof -PiTCP -sTCP:LISTEN
@ozooxo
ozooxo / readme.md
Last active June 18, 2019 11:29
Setup a dev docker environment on AWS

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 / install.md
Last active August 2, 2021 17:44
Install LocalStack (Mac)
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 April 24, 2019 13:17
Various related to `PATH` on Mac

Check the path of one executable:

type -a postgres

Check the path:

echo $PATH
@ozooxo
ozooxo / python-with-exception.py
Last active June 18, 2018 19:48
Python content manager executing order
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))

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 15:58
Multiple JDK on MacOS

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
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
# git constants
testcasename=long-commit-path
unmergebranch=unmergebranch
mergebranch=mergebranch
# Clean up
rm -rf $HOME/Workspace/enterovirus-test/$testcasename/
cd $HOME/Workspace/enterovirus-test/
mkdir $testcasename
cd $testcasename