Skip to content

Instantly share code, notes, and snippets.

View ysdede's full-sized avatar
🎯
Focusing

Yunus Seyhan Dede ysdede

🎯
Focusing
View GitHub Profile
@ysdede
ysdede / install_grafana.sh
Created December 22, 2021 19:13
Install Grafana OSS
sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
# Add this repository for stable releases:
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
# Add this repository if you want beta releases:
echo "deb https://packages.grafana.com/oss/deb beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
# After you add the repository:
@ysdede
ysdede / Optimize-NSGAII.py
Last active January 16, 2022 21:35
Multi-objective NSGAII hyperparameters optimization with Optuna
import json
import signal
import sys
from subprocess import PIPE, Popen, call
import jessetk.utils as utils
import optuna
# Multi-objective NSGAII hyperparameters optimization with Optuna
# Wraps Jesse ai's backtest function as an objective function
@ysdede
ysdede / Pick-Parameters.py
Last active January 15, 2022 23:33
Pick best parameters from Optuna database
import optuna
import statistics
import json
# This code snippet filters Optuna trials based on performance metrics and standard deviation
# and generates a results.csv file containing all results
# and a SEQ.py file containing all hyperparameters
study = optuna.create_study(study_name="Band5min-LongOnly", directions=["maximize", "maximize"],
storage="postgresql://optuna_user:optuna_password@localhost/optuna_db_3", load_if_exists=True)
@ysdede
ysdede / install_pg14.sh
Created December 7, 2021 15:34
Postgresql 14 installer for Debian (& WSL2)
#!/bin/bash
sudo apt install -y lsb-core libllvm6.0 libpq5 pgdg-keyring wget --allow-unauthenticated
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql-14
@ysdede
ysdede / make-db.sh
Last active December 5, 2021 18:14
#!/bin/bash
# This script will create a postgresql database on ramdisk
# and create jesse_db, jesse user, and grant privileges
# Stop postgresql service if it is running
echo "Trying to stop Postgresql service gracefully, watch ps aux output for it..."
sudo systemctl stop postgresql
sudo service postgresql stop # WSL2
sudo -u postgres /usr/lib/postgresql/14/bin/pg_ctl -D /tmp/ramdisk/db/ stop
#!/bin/bash
cd Installer
if [ ! -d "WFInstaller.bat" ]; then
cat <<EOF >WFInstaller.bat
@echo off
for %%i in (*.exe) do start "" /b "%%i"
EOF