Skip to content

Instantly share code, notes, and snippets.

View lhotakj's full-sized avatar
💭
coding at home, coding at work, coding everywhere.

Jaroslav Lhoták lhotakj

💭
coding at home, coding at work, coding everywhere.
View GitHub Profile
@lhotakj
lhotakj / drop_all_tables_mysql.sql
Created May 14, 2020 19:51
Drop all tables in MySQL database without consistency check
use `<< database name >>`;
SET FOREIGN_KEY_CHECKS = 0;
SET @tables = NULL;
SET GROUP_CONCAT_MAX_LEN=32768;
SELECT GROUP_CONCAT('`', table_schema, '`.`', table_name, '`') INTO @tables
FROM information_schema.tables
WHERE table_schema = (SELECT DATABASE());
SELECT IFNULL(@tables, '') INTO @tables;
@lhotakj
lhotakj / centos-install-python-3.7.1.sh
Last active December 15, 2018 19:33
centos-install-python-3.7.1
# https://linuxhint.com/install_python3_centos7/
# https://tecadmin.net/install-python-3-7-on-centos/
# alt
cd /tmp
sudo yum groupinstall -y "Development Tools"
wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz
tar -xJf Python-3.7.1.tar.xz
cd Python-3.7.1
./configure
make
@lhotakj
lhotakj / enable-nfs-ports-centos.sh
Last active December 12, 2018 21:04
enable-nfs-ports-centos.sh
list all NFS ports:
rpcinfo -p | awk '{print $3" "$4}' | sort -k2n | uniq
#edit https://www.cyberciti.biz/faq/centos-fedora-rhel-iptables-open-nfs-server-ports/
sudo firewall-cmd --zone=public --permanent --add-port=111/tcp
sudo firewall-cmd --zone=public --permanent --add-port=111/udp
sudo firewall-cmd --zone=public --permanent --add-port=2049/udp
sudo firewall-cmd --zone=public --permanent --add-port=2049/tcp
@lhotakj
lhotakj / install_python36_ubuntu.sh
Last active October 15, 2019 07:27
ubuntu - install python3.6
sudo apt-get update -y
sudo apt-get install python3.6 -y
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update -y
sudo apt-get install python3.6 -y
sudo apt install python3-pip -y
# go to /usr/bin and edit pip3 to point to 3.6