Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Reilly Chase reillychase

🏠
Working from home
View GitHub Profile
@reillychase
reillychase / server.py
Created Nov 19, 2018
ghostifi-server-create-function
View server.py
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 Nov 13, 2018
ghostifi-threading
View server.py
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 Nov 13, 2018
ghostifi-subscription-triggers
View server.py
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
View hostifi-server.py
# 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 Nov 13, 2018
ghostifi-sqlalchemy
View server.py
# 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)
View keybase.md

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: