2015-10-21
- jennifer
- martym
| import redis | |
| import time | |
| import sys | |
| def producer(): | |
| r = redis.Redis() | |
| i = 0 | |
| while True: | |
| r.rpush('queue', 'Message %d' % i) |
| #!/bin/bash | |
| # Ubuntu 18.04 account creation and Google 2FA/MFA for use on EC2 User data at instance launch | |
| # Create users when launching an Ubuntu server EC2 instance | |
| declare -A USERKEY | |
| # Create users when launching an Ubuntu server EC2 instance |
| def escape_csv(user_generated_string): | |
| """ | |
| CSV injection esacaping for Python. Excel treats a string as active content when it encounters a | |
| "trigger" character at the start of the string. This method returns the string with | |
| the triger character escaped. | |
| """ | |
| if user_generated_string[0] in ('@','+','-', '='): | |
| user_generated_string = "'" + user_generated_string |
| from __future__ import unicode_literals | |
| from urlparse import parse_qs | |
| import requests | |
| from requests_oauthlib import OAuth1 | |
| key = "key" | |
| secret ="secret" | |
| oauth = OAuth1(key, secret) |