This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd /home/ubuntu/vnpy | |
git reset --hard HEAD | |
git pull | |
pip install . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#%% | |
%load_ext autoreload | |
%autoreload 2 | |
#%% | |
import matplotlib.pyplot as plt | |
plt.style.use("dark_background") | |
#%% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker rmi $(docker images -f "dangling=true" -q) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user nobody; | |
worker_processes auto; | |
worker_rlimit_nofile 65535; | |
events { | |
multi_accept on; | |
worker_connections 65535; | |
} | |
http { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "" |