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
import os | |
import sys | |
import json | |
import time | |
import pytz | |
import couchdb | |
import dateutil.parser | |
from email import utils | |
from datetime import datetime | |
import splunklib.client as client |
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
Sydenham Station | Marrickville Station | |
---|---|---|
Dulwich Hill Station | ||
Hurlstone Park Station | ||
Canterbury Station | ||
Campsie Station | ||
Bankstown Station | ||
Berala Station | ||
Sefton Station | ||
Leightonfield Station | ||
Ashfield Station |
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
# Add this to the YAML section: | |
ansible_ssh_port: 1234 |
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
--- | |
- name: Prepare New Digital Ocean Droplet | |
hosts: you.example.com | |
user: ansible | |
tasks: | |
- action: shell date +%s | sha256sum | base64 | head -c 6 | |
register: rand_var | |
- digital_ocean: > | |
state=present | |
command=droplet |
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
@ApiMethod(name = "sayHi", clientIds = { | |
Constants.WEB_CLIENT_ID, | |
Constants.ANDROID_CLIENT_ID}, | |
audiences = { Constants.WEB_CLIENT_ID, Constants.ANDROID_CLIENT_ID }, | |
scopes = { | |
"https://www.googleapis.com/auth/userinfo.email", | |
"https://www.googleapis.com/auth/userinfo.profile" }) |
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
import csv | |
from dateutil import parser | |
qs_list = [] | |
with open('C:\\Users\\username\\Desktop\\tweets.csv', 'rb') as csvfile: | |
qsreader = csv.reader(csvfile, delimiter=',', quotechar='"') | |
header = qsreader.next() | |
for row in qsreader: | |
d = parser.parse(row[6]) | |
row[6] = d.isoformat() |
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
import os | |
import sys | |
# First, add the project to PATH. Adjust as needed. | |
PWD = os.path.dirname(os.path.abspath(__file__)) | |
PROJECT_PATH = os.path.abspath(os.path.join(PWD, '../../../../')) | |
sys.path.append(PROJECT_PATH) | |
# Second, configure this script to use Django | |
import django |
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
version: '3.4' | |
services: | |
app: | |
image: mitmproxy/mitmproxy | |
ports: | |
- 8080:8080 | |
- 8081:8081 | |
volumes: | |
- mitmproxy:/home/mitmproxy/.mitmproxy |
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
REM On Unix you would do this: find ./ -type f -exec dos2unix {} \; | |
REM After installing dos2unix.exe in Windows, you can create a small bat script with the below in it to | |
REM recursively change the line endings. Careful if you have any hidden directories (e.g. .git) | |
for /f "tokens=* delims=" %%a in ('dir "C:\Users\username\path\to\directory" /s /b') do ( | |
"C:\Program Files\unix2dos.exe" %%a | |
) |
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
# post_loc.txt contains the json you want to post | |
# -p means to POST it | |
# -H adds an Auth header (could be Basic or Token) | |
# -T sets the Content-Type | |
# -c is concurrent clients | |
# -n is the number of requests to run in the test | |
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |
OlderNewer