Skip to content

Instantly share code, notes, and snippets.

View ozooxo's full-sized avatar

Cong-Xin Cynthia Qiu ozooxo

View GitHub Profile
@ozooxo
ozooxo / gist:c69f8db42877df8997b1e25fcb654cb7
Created October 18, 2016 08:28
Install Trac on Ubuntu 14.04
apt-get install python python-babel
sudo apt install -y trac libapache2-mod-wsgi
apt-get install python-pip
pip install --upgrade Babel
pip install --upgrade Trac
mkdir -p /var/local/trac
trac-admin /var/local/trac initenv
htpasswd -c /var/local/trac/.htpasswd adminusername
@ozooxo
ozooxo / gist:10600945
Last active November 7, 2016 21:06
Set up honeyd (ubuntu 12.04)
# installation
sudo apt-get install honeyd
sudo apt-get install nmap #(supported software for port scanning)
# check my eth0 address
ifconfig
### eth0 Link encap:Ethernet HWaddr 00:26:2d:f9:db:be <-----------------use this one
### inet addr:192.168.0.103 Bcast:192.168.0.255 Mask:255.255.255.0
### inet6 addr: fe80::226:2dff:fef9:dbbe/64 Scope:Link
@ozooxo
ozooxo / gist:9959489
Last active September 29, 2017 17:08
clean up ubuntu disk space
sudo apt-get clean # cleaning up of the apt cache. it gives me roughly 500MB cache
sudo apt-get purge linux-image-3.5.0-37-generic # roughly 100MB per removed kernal. kernal list is in /boot/.
# 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
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
@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

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 / 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))
@ozooxo
ozooxo / gist:7568836
Created November 20, 2013 18:54
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.
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 / 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