Skip to content

Instantly share code, notes, and snippets.

View reillychase's full-sized avatar
🏠
Working from home

Reilly Chase reillychase

🏠
Working from home
View GitHub Profile
@reillychase
reillychase / server.py
Created November 19, 2018 14:10
ghostifi-server-create-function
import MySQLdb
import os
import sys
from sqlalchemy import create_engine, MetaData
from sqlalchemy.sql import text
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy import Column, String, Integer, Date, Table, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from urllib import quote_plus as urlquote
@reillychase
reillychase / server.py
Created November 13, 2018 23:51
ghostifi-threading
import MySQLdb
import os
import sys
from sqlalchemy import create_engine, MetaData
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy import Column, String, Integer, Date, Table, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from urllib import quote_plus as urlquote
from multiprocessing.dummy import Pool as ThreadPool
@reillychase
reillychase / server.py
Created November 13, 2018 19:47
ghostifi-subscription-triggers
import MySQLdb
import os
import sys
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy import Column, String, Integer, Date, Table, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from urllib import quote_plus as urlquote
@reillychase
reillychase / hostifi-server.py
Created November 13, 2018 02:07
hostifi-mysql
# Get list of servers already built
db = MySQLdb.connect("localhost","user","password@!","hostifi" )
cursor = db.cursor()
sql = "SELECT * FROM server"
vultr_check = []
try:
# Execute the SQL command
cursor.execute(sql)
# Fetch all the rows in a list of lists.
results = cursor.fetchall()
@reillychase
reillychase / server.py
Created November 13, 2018 01:52
ghostifi-sqlalchemy
# Setup SQLAlchemy
engine = create_engine('mysql://user:%s@localhost:3306/ghostifi' % urlquote('password@!'), echo=False)
Session = sessionmaker(bind=engine)
Base = declarative_base()
# DB classes
class Subscription(Base):
__tablename__ = 'wp_edd_subscriptions'
id = Column(Integer, primary_key=True)

Keybase proof

I hereby claim:

  • I am reillychase on github.
  • I am rchase (https://keybase.io/rchase) on keybase.
  • I have a public key ASDPHjjt-8IkPA1FL7jDBxrvKkw63o8EPkC84CUjdHDzMwo

To claim this, I am signing this object: