Skip to content

Instantly share code, notes, and snippets.

View ilyasst's full-sized avatar

Ilyass Tabiai ilyasst

View GitHub Profile

Run freqtrade on your VM


Important

TA-lib requires 2Gb of RAM. You can either:

  1. Upgrade your VM to a 2Gb RAM VM
  2. Use this guide to create a SWAP file (virtual memory) on the VM's SSD that is at least 2Gb: https://www.vultr.com/docs/setup-swap-file-on-linux
@ilyasst
ilyasst / python_systemd.md
Last active April 15, 2024 04:34
Run a python script forever using systemd

Run a python script forever

In this section, we are going to show how to run a python script as a systemd service, allowing you to boot it at the start of a Linux machine and to maintain it alive.

Test method: Telegram Bot

We are going to use a very basic Telegram bot in order to test that our script will:

  1. Automatically start when the machine boot
  2. Automatically restart when it crashes/exits for whichever reason
@ilyasst
ilyasst / openacces_check.py
Created November 11, 2019 07:00
Relies on Arcas and Matplotlib to plot the evolution of the availability of open access publications through a few APIs using an arbitrary set of publications returned by each API.
"""
This script is heavily inspired by the example provided by the developers of Arcas:
https://github.com/ArcasProject/ArcasExamples/blob/initial_commits/scripts/scraping_num_articles.py
"""
import arcas
import pandas as pd
import matplotlib.pyplot as plt
keywords = ["composite", "carbon", "fiber"]
num_collect = 10

Run freqtrade on Raspberry Pi

Seupt your Dietpi. Static IP. SSH.

Freqtrade v2019.9 with Python 3.7 and setup.sh

Python 3.7:

 sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
@ilyasst
ilyasst / install_freqtrade_rpi.sh
Last active July 2, 2023 14:54
install_freqtrade2019_9-python37_Dietpi
sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
tar xf Python-3.7.2.tar.xz
cd Python-3.7.2
./configure
make -j 4
sudo make altinstall
cd ..
sudo apt-get install libffi-dev git libatlas-base-dev
git clone https://github.com/freqtrade/freqtrade.git
@ilyasst
ilyasst / gist:7fcafc757e1f045845ecc9e914a3f79e
Last active October 21, 2021 21:43
Fenisc fiber inclusion thermomechanical problem: two materials
from dolfin import *
from mshr import *
import numpy as np
import matplotlib.pyplot as plt
# https://comet-fenics.readthedocs.io/en/latest/demo/thermoelasticity/thermoelasticity_transient.html#References
L = 1.
R = 0.4
$ VBoxManage import ./UCS-Virtualbox-Demo-Image.ova --vsys 0 --eula accept
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% 
Interpreting /home/crohr/dev/ucs/./UCS-Virtualbox-Demo-Image.ova...
OK. 
Disks: vmdisk1 53687091200 -1 http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized UCS-Demo-Image-virtualbox-disk1.vmdk -1 -1 
... 
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% 
Successfully imported the appliance.
# Forked by hand from https://raw.githubusercontent.com/milq/milq/master/scripts/bash/install-opencv.sh
# KEEP UBUNTU OR DEBIAN UP TO DATE
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get -y autoremove
# INSTALL THE DEPENDENCIES
@ilyasst
ilyasst / stopwords.txt
Last active April 29, 2017 19:14
Stopword list from the nltk/corpora
all
just
being
over
both
through
yourselves
its
before
o
@ilyasst
ilyasst / write_stopwords_txt.py
Created April 18, 2017 01:25
Write stopwrods from nltk corpora/stopwords to a text file
from nltk.corpus import stopwords
with open("./stopwords.txt",'w') as outFile:
stop_words = set(stopwords.words('english'))
for w in stop_words:
outFile.write(w+"\n")
outFile.close()