-
-
Save krallin/915c33b7091375ee336b to your computer and use it in GitHub Desktop.
debug-scalr-remote-ip
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
#!/opt/scalr-server/embedded/bin/python | |
import yaml | |
import pymysql | |
QUERY = "SELECT * FROM messages WHERE type='in' AND message_name='Hello';" | |
def main(): | |
with open("/opt/scalr-server/etc/scalr/config.yml") as f: | |
conf = yaml.load(f) | |
my = conf["scalr"]["connections"]["mysql"] | |
db = pymysql.connect(my["host"], my["user"], my["pass"], my["name"], my["port"]) | |
c = db.cursor() | |
c.execute(QUERY) | |
for row in c.fetchall(): | |
print row | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment