Skip to content

Instantly share code, notes, and snippets.

View Ammly's full-sized avatar
Working from home

Ammly Ammly

Working from home
View GitHub Profile
# --- Do not remove these libs ---
from freqtrade.strategy.interface import IStrategy
from pandas import DataFrame
import talib.abstract as ta
import freqtrade.vendor.qtpylib.indicators as qtpylib
# --------------------------------
# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement
# isort: skip_file
# --- Do not remove these libs ---
import numpy as np # noqa
import pandas as pd # noqa
from pandas import DataFrame
from freqtrade.strategy.interface import IStrategy
# --------------------------------
Ammly / Dockerfile
Created December 2, 2020 22:26
Install Jenkins and php7.4 through Docker
FROM jenkins/jenkins:2.263.1-centos7
USER root
RUN yum update -y && yum install epel-release -y
RUN rpm -Uvh
RUN yum install yum-utils -y
RUN yum-config-manager --enable remi-php74 -y && yum install php -y
RUN yum --enablerepo=remi install php-pdo php-mbstring php-xml php-pdo_mysql php-xdebug -y
RUN yum update -y
RUN cd /tmp
RUN curl -sS | php
Ammly /
Last active November 27, 2020 17:44
Install Docker, Docker-Compose and Git on Amazon Linux 2
sudo yum update -y
sudo amazon-linux-extras install docker -y
sudo yum install docker -y
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo chkconfig docker on
docker info
Ammly / amazon-linux2-userdata
Last active September 16, 2023 06:25
Amazon Linux 2 Laravel, Nginx, PHP7.4, Mariadb Userdata
sudo yum update -y
sudo amazon-linux-extras install nginx1 php7.4 -y
sudo yum clean metadata
sudo yum install git mariadb-server php-{pear,cgi,common,curl,mbstring,gd,mysqlnd,gettext,bcmath,json,xml,fpm,intl,zip} -y
# Back up existing config
sudo cp -R /etc/nginx /etc/nginx-backup
sudo chmod -R 777 /var/log
sudo chown -R ec2-user:ec2-user /usr/share/nginx/html
echo "<?php phpinfo(); ?>" > /usr/share/nginx/html/index.php
Ammly / nginx.conf
Created November 21, 2020 17:56
EC2 laravel nginx config
# For more information on configuration, see:
# * Official English Documentation:
# * Official Russian Documentation:
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
Ammly /
Created August 2, 2019 16:32 — forked from klingtnet/
Enable hiberate in Arch Linux usind kernel 4+, grub2 and a swapfile

This guide is based on the hibernate article from the Arch wiki.

  • edit /etc/default/grub and add resume as well as resume_offset kernel parameters
    • resume=UUID=abcd-efgh contains the UUID of the partition on which the swapfile resides. In most cases the swapfile resides in root, to identify the root parition's UUID run blkid or lsblk -O.
    • resume_offset=1234 is the offset of the swapfile from the partition start. The offset is the first entry in the physical_offset column of the output of filefrag -v /swapfile.
    • update grub: grub-mkconfig -o /boot/grub/grub.cfg
    • example: GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=75972c96-f909-4419-aba4-80c1b74bd605 resume_offset=1492992"
  • add the resume module hook to /etc/mkinitcpio.conf:
    • HOOKS="base udev resume autodetect ...
  • rebuild the initramfs mkinitcpio -p linux
Ammly /
Created May 10, 2019 12:10 — forked from alces/
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local playbook.yml
  • using inventory: ansible_connection=local
Ammly / accountBalance.php
Created February 14, 2019 17:06
JengaHq API Requests using GuzzleHttp for php
$account_id ={accountId};
$date = date('Y-m-d');
$plainText = $account_id.$country_code.$date;
$privateKey = openssl_pkey_get_private('file://'.storage_path('privatekey.pem'));
$token = {token}; //returned from token function above
Ammly / gist:ff4f5ad2ce7080ef9a7ceeb9d499936e
Created February 13, 2019 16:37 — forked from kyledrake/gist:d7457a46a03d7408da31
Creating a self-signed SSL certificate, and then verifying it on another Linux machine
# Procedure is for Ubuntu 14.04 LTS.
# Using these guides:
openssl genrsa -aes256 -out ca.key 2048
openssl req -new -x509 -days 7300 -key ca.key -sha256 -extensions v3_ca -out ca.crt