Skip to content

Instantly share code, notes, and snippets.

View AhmedSakrr's full-sized avatar
💻
Assembly | C/C++ | Rust | Ruby | Golang | Python | JS | Solidity Programmer.

Ahmed Sakr AhmedSakrr

💻
Assembly | C/C++ | Rust | Ruby | Golang | Python | JS | Solidity Programmer.
View GitHub Profile
@AhmedSakrr
AhmedSakrr / install_freqtrade_rpi.sh
Created October 21, 2021 21:43 — forked from ilyasst/install_freqtrade_rpi.sh
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

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

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

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@AhmedSakrr
AhmedSakrr / setProxyEnv.sh
Created October 21, 2021 20:52 — forked from jctosta/setProxyEnv.sh
Script para configuração automática de proxy em sistemas Linux
# Terminal Settings (WGET, Apt e etc.)
export http_proxy=http://localhost:3128
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export no_proxy=localhost,127.0.0.1,localaddress,.localdomain.com,10.*
# Configurações para proxy automático em ambientes Gnome
if hash gsettings 2>/dev/null; then
gsettings set org.gnome.system.proxy autoconfig-url '<pac_file_location>'
@AhmedSakrr
AhmedSakrr / docker_cheatsheet.md
Created October 21, 2021 20:52 — forked from jctosta/docker_cheatsheet.md
Docker - Comandos Úteis

Docker - Comandos Úteis

Containers

  • Abrir um shell em um container em execução:
    • docker exec -t -i <container_id> <shell>

Limpeza

  • Excluir containers com status equivalente a Exited:
@AhmedSakrr
AhmedSakrr / docker-wsl2-memory-limits.md
Created October 21, 2021 20:49 — forked from jctosta/docker-wsl2-memory-limits.md
You can limit docker-windows memory usage by adjusting some parameters in wsl2 configuration.

Limit WSL2 Memory Usage when using Docker for Windows

You can limit docker-windows memory usage by adjusting some parameters in wsl2 configuration.

First, close any instances of Docker Windows currently running and create a new file named .wslconfig in your user home directory, like C:\Users<username>:

[wsl2]
memory=4GB
processors=5
@AhmedSakrr
AhmedSakrr / python_systemd.md
Created October 21, 2021 20:18 — forked from ilyasst/python_systemd.md
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
@AhmedSakrr
AhmedSakrr / stochastic_and_rsi
Created May 13, 2021 19:20 — forked from anonymous/stochastic_and_rsi
slightly improved version of indicator with Stochastic RSI and RSI with alerts from autemox
// ver 1 alerts show significant stoch rsi crossovers as long as they arent in outermost bounds
// ver 2 fixed error with > to >= that caused some alerts to not appear
// ver 3 changed from symbols to columns to make it easier to set up real trading view alerts with it!
// BASED on https://www.tradingview.com/script/aUZVp1GC-Stochastic-RSI-with-Crossover-Alerts/
// Author: autemox
study(title="Stochastic RSI with Crossover Alerts", shorttitle="Stoch RSI with Crossover Alerts")
smoothK = input(3, minval=1)
smoothD = input(3, minval=1)
lengthRSI = input(14, minval=1)
@AhmedSakrr
AhmedSakrr / ATR_RSI_MACD.pine
Created May 13, 2021 19:18 — forked from siralam/ATR_RSI_MACD.pine
TradingView: ATR + RSI + MACD
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © szewa1992
//@version=4
study("MACD + ATR + RSI", resolution="", overlay=false)
displayATR = input(title="Display ATR?", type=input.bool, defval=true)
displayRSI = input(title="Display RSI?", type=input.bool, defval=false)
displayMACD = input(title="Display MACD?", type=input.bool, defval=true)