Skip to the relevant sections if needed.
This file contains hidden or 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
import os | |
import pandas.io.sql as sqlio | |
import psycopg2 | |
from dotenv import load_dotenv, find_dotenv | |
load_dotenv(find_dotenv()) | |
SQL_USER = os.environ.get('SQL_USER') | |
SQL_PASS = os.environ.get('SQL_PASS') |
First, download firefox. Then:
$ # Untar the download
$ tar xjf firefox-<version-num>.tar.bz2
$ # Remove current firefox
$ sudo rm -r /opt/firefox
$ # Move new firefox to old firefox location
$ sudo mv ~/Downloads/firefox /opt/firefox
This file contains hidden or 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
class AuthorizedResource(Resource): | |
""" | |
We created this AuthorizedResource from Resource | |
because the user authorization was being made after payload | |
validation. This way a non-auth'ed user was able to sniff the | |
payload that was required by the endpoint. | |
By wrapping dispatch_request with the requires_auth function, | |
we check for user authentication first. | |
""" | |
@requires_auth |
This file contains hidden or 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
import time | |
import logging | |
from locust import TaskSet, User, between, task, events | |
import mysql.connector | |
TEST_QUERY = ''' | |
SELECT COUNT(*) FROM YOUR_TABLE_HERE; | |
''' |