Skip to content

Instantly share code, notes, and snippets.

@vvikramjhu
Created January 11, 2014 01:38
Show Gist options
  • Save vvikramjhu/8365858 to your computer and use it in GitHub Desktop.
Save vvikramjhu/8365858 to your computer and use it in GitHub Desktop.
import MySQLdb
conn = MySQLdb.connect(host='127.0.0.1', user='root', passwd='ernest', db='safeview', port=3306)
curs = conn.cursor()
# The function below inserts images into the table multifactor_image in safeview.
# This table will work as a pool of images and be used
# for user identification in "sitekey" for each user.
def fill_multifactoImage_table():
for line in open("imageNames", "r"):
curs.execute('INSERT INTO safeview.multifactor_image(filename) VALUES(%s)', line)
if __name__ == "__main__":
fill_multifactoImage_table()
conn.commit()
conn.close()
1351060631fnx5i.jpg
1351173672osmhe.jpg
1351262241u4827.jpg
1351450651givca.jpg
1352429787ngb9i.jpg
1352767791ihimd.jpg
1353589705o8zlg.jpg
13542323435q3eu.jpg
1354817113lpvu1.jpg
1355222811tksiu.jpg
13553636279jgd2.jpg
1356382130sqjjs.jpg
1357320488q6l6s.jpg
13582615946sooz.jpg
1358438291lj3sl.jpg
1358794457t6q3q.jpg
1359904664ggcww.jpg
1360002644zqxj2.jpg
file0001023544662.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment