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 smtplib, sys, settings | |
def send_email_alert(msg): | |
if not settings.TO_EMAIL: | |
print "No emails to alert!" | |
sys.exit() | |
else: | |
server = smtplib.SMTP('smtp.gmail.com', 587) | |
server.starttls() | |
server.login(settings.FROM_EMAIL, settings.FROM_EMAIL_PASS) |
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
#!/usr/bin/env python3 | |
import argparse, ipaddress, socket, geoip2.database | |
input = argparse.ArgumentParser() | |
input.add_argument("host", type=str, help="enter the host to locate") | |
input_args = input.parse_args() | |
ip_reader = geoip2.database.Reader('/volumes/files/personal/utilities/network/dependencies/GeoLite2-City.mmdb') | |
def input_validate(host): |
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
#!/usr/bin/env python3 | |
import argparse | |
arg = argparse.ArgumentParser() | |
arg.add_argument("file", type=str, help="input text file") | |
arg.add_argument("dir", type=str, help="dir to save new file in") | |
input = arg.parse_args() | |
def parse_vocab(file, dir): | |
vocab_file = open(file).read().split("\n") |
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 argparse, urllib.request, requests, re | |
from bs4 import BeautifulSoup | |
from queue import Queue | |
from threading import Thread | |
#input validation | |
def validate_url(input_url): | |
if "http://" not in input_url: | |
raise ValueError("not a valid URL!") | |
elif "https://" not in input_url: | |
raise ValueError("not a valid URL!") |
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
#!/usr/bin/python3 | |
import tinify, argparse, os, settings | |
# change this to your tinypng api key | |
tinify.key = settings.TINIFY_API_KEY | |
# input arguments | |
input = argparse.ArgumentParser() | |
input.add_argument("-d", "--directory", type=str, help="\ | |
Specify the directory you want to save the images in, if not the current one.", required=False) |
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
# Gist example of IB wrapper ... | |
# | |
# Download API from http://interactivebrokers.github.io/# | |
# | |
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install | |
# | |
# Note: The test cases, and the documentation refer to a python package called IBApi, | |
# but the actual package is called ibapi. Go figure. | |
# | |
# Get the latest version of the gateway: |
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
2926 function calls (2876 primitive calls) in 341.547 seconds | |
Ordered by: internal time | |
ncalls tottime percall cumtime percall filename:lineno(function) | |
1 341.539 341.539 341.541 341.541 {built-in method perspective.table.libbinding.make_table} | |
2 0.002 0.001 0.002 0.001 {method 'copy' of 'numpy.ndarray' objects} | |
2 0.000 0.000 0.000 0.000 missing.py:219(_isna_ndarraylike) | |
3 0.000 0.000 0.000 0.000 {method 'astype' of 'numpy.ndarray' objects} | |
26/25 0.000 0.000 0.000 0.000 {built-in method numpy.array} |
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
Sampling process 13221 for 3 seconds with 1 millisecond of run time between samples | |
Sampling completed, processing symbols... | |
Analysis of sampling Python (pid 13221) every 1 millisecond | |
Process: Python [13221] | |
Path: /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python | |
Load Address: 0x100a6f000 | |
Identifier: Python | |
Version: ??? | |
Code Type: X86-64 | |
Parent Process: zsh [70842] |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer