Skip to content

Instantly share code, notes, and snippets.

View mamedshahmaliyev's full-sized avatar

Mamed Shahmaliyev mamedshahmaliyev

View GitHub Profile
@mamedshahmaliyev
mamedshahmaliyev / git_tips.md
Last active December 2, 2020 07:09
Git tips
@mamedshahmaliyev
mamedshahmaliyev / forex_historical_data_truefx.py
Created August 6, 2019 18:12
Download forex historical data monthly in csv format from http://www.truefx.com (pepperstone) using python and selenium
import datetime, time, os
from dateutil.relativedelta import relativedelta
from selenium import webdriver
tmp_dir = os.path.join(os.getcwd(), 'forex')
if not os.path.isdir(tmp_dir): os.makedirs(tmp_dir)
options = webdriver.ChromeOptions();
options.add_argument("--window-size=1300,900")
options.add_experimental_option("prefs", {
@mamedshahmaliyev
mamedshahmaliyev / ssl_fix.sh
Last active March 7, 2024 13:51
Self-signed certificate issues, disable SSL verification, ignore SSL related errors etc.
####### installation of self-signed certificate into CentOS7 (RHEL) #######
mkdir -p /etc/pki/ca-trust/source/anchors
cp /path/to/self_signed_cert.crt /etc/pki/ca-trust/source/anchors/self_signed_cert.crt
chmod +x /etc/pki/ca-trust/source/anchors/self_signed_cert.crt
sudo update-ca-trust
####### installation of self-signed certificate into Ubuntu (Debian) #######
mkdir -p /usr/local/share/ca-certificates/
cp /path/to/self_signed_cert.crt /usr/local/share/ca-certificates/self_signed_cert.crt
chmod +x /usr/local/share/ca-certificates/self_signed_cert.crt
#!/bin/bash
# Where to restore
db_host='localhost'
db_name='adhoctuts'
db_user='root'
db_pass='Adhoctuts2018#'
dump_file='/root/scripts/dump_ignore.sql'
#!/bin/bash
# Define the database and root authorization details
db_host='localhost'
db_name='adhoctuts'
db_user='root'
db_pass='Adhoctuts2018#'
# Define the ignore list
tmp=$(mysql -h $db_host -u $db_user -p"$db_pass" -se "select group_concat(concat(' --ignore-table=',table_schema,'.',table_name)) into @tbl from information_schema.tables where table_schema='$db_name' and table_name like '%_log';select @tbl;" $db_name | cut -f1)
#!/bin/bash
# Define the database and root authorization details
db_host='localhost'
db_name='adhoctuts'
db_user='root'
db_pass='Adhoctuts2018#'
# Define the query to get the needed tables
table_list=$(mysql -h $db_host -u $db_user -p"$db_pass" -se "select concat(table_schema,'.',table_name) from information_schema.tables where table_schema='$db_name' and table_name not like 'tbl1' AND table_name not like '\_\_%';" $db_name | cut -f1)
@mamedshahmaliyev
mamedshahmaliyev / docker_usefull_commands.sh
Last active August 9, 2021 06:56
Usefull commands for docker-compose and docker, supplementary material for https://adhoctuts.com/run-mulitple-databases-in-single-machine-using-docker
#####################################################################
## docker-compose commands, works with service names ################
## docker-compose will look for docker-compose.yml file by default ##
#####################################################################
docker-compose up -d # build and start all the containers
docker-compose up -d service_name # build and start specific container
# stop and remove all the containers,
# removes all the data unless the data persistence is specified