This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mariadb] | |
name = MariaDB | |
baseurl = http://yum.mariadb.org/10.2/centos7-amd64 | |
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB | |
gpgcheck=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wget -qO- https://get.docker.com/ | sh | |
sudo usermod -aG docker $(whoami) | |
sudo systemctl enable docker.service | |
sudo systemctl start docker.service | |
sudo yum install -y epel-release | |
sudo yum install -y python-pip | |
sudo yum upgrade -y python* | |
sudo pip install docker-compose --force --upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_or_create(session, model, **kwargs): | |
''' | |
Creates an object or returns the object if exists | |
credit to Kevin @ StackOverflow | |
from: http://stackoverflow.com/questions/2546207/does-sqlalchemy-have-an-equivalent-of-djangos-get-or-create | |
''' | |
instance = session.query(model).filter_by(**kwargs).first() | |
if instance: | |
return instance | |
else: |