Skip to content

Instantly share code, notes, and snippets.

View qzm's full-sized avatar
🚀
I may be slow to respond.

Aaron Qiu qzm

🚀
I may be slow to respond.
View GitHub Profile
@qzm
qzm / docker-compose.yml
Last active May 31, 2023 08:58
Atlassian docker-compose (JIRA,Confluence,Bitbucket) with nginx and letsencrypt
version: '2'
services:
watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /root/.docker/config.json:/config.json
command: nginx-proxy nginx-proxy-le
@qzm
qzm / xfce-xrdp.sh
Last active February 27, 2021 16:56
install xfce4 and xrdp
sudo apt update && sudo apt -y upgrade
sudo apt-get install xrdp
sudo apt -y install xfce4
sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
# sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini
sudo sed -i 's/max_bpp=32/#max_bpp=32\nmax_bpp=128/g' /etc/xrdp/xrdp.ini
sudo sed -i 's/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g' /etc/xrdp/xrdp.ini
sudo /etc/init.d/xrdp start
@qzm
qzm / updateVnTrader.sh
Created July 26, 2019 02:59
update vnTrader
#!/usr/bin/env bash
cd /home/ubuntu/vnpy
git reset --hard HEAD
git pull
pip install .
@qzm
qzm / vnTraderMutliCoreProdMode.sh
Last active July 22, 2019 07:51
run vnTrader.sh in latest CPU Core
#!/usr/bin/env bash
BASEDIR=$(dirname "$0")
cd ${BASEDIR}
sudo taskset -c 1,2,3 nice -n -20 /home/ubuntu/anaconda3/bin/python vnTrader.py
@qzm
qzm / backtesting.py
Last active July 19, 2019 10:00
vnpy backtesting for VSCode
#%%
%load_ext autoreload
%autoreload 2
#%%
import matplotlib.pyplot as plt
plt.style.use("dark_background")
#%%
@qzm
qzm / 7zip.sh
Last active May 9, 2019 08:47
7zip
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on archive.7z dir1
7z a -mm=Deflate -mfb=258 -mpass=15 -r foo.zip C:\Path\To\Files\*
@qzm
qzm / remove-none-image.sh
Created May 8, 2019 04:20
remove docker <none> images
docker rmi $(docker images -f "dangling=true" -q)
@qzm
qzm / nginx.conf
Created May 6, 2019 04:23
Nginx configure file for single page application(SPA)
user nobody;
worker_processes auto;
worker_rlimit_nofile 65535;
events {
multi_accept on;
worker_connections 65535;
}
http {
@qzm
qzm / mysql-docker.sh
Last active December 20, 2019 07:36
Docker MySql Backup and Restore
# Backup
docker exec CONTAINER /usr/bin/mysqldump --set-gtid-purged=OFF -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@qzm
qzm / getData.py
Created May 4, 2019 08:50
get all future data from rqdata
from time import time
import rqdatac as rq
from vnpy.trader.object import BarData
from vnpy.trader.constant import Exchange, Interval
from vnpy.trader.database import database_manager
USERNAME = ""
PASSWORD = ""