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
#Requires Python 3.6 | |
import xml.etree.ElementTree as ET | |
from arguments import Arguments | |
import sys | |
from os import path | |
import json | |
args = Arguments(sys.argv) |
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
#qpy:console | |
################################# | |
# | |
# This is a very minimal QPython script to access Github Gists | |
# | |
# for a more robust QPython application, check out https://github.com/bng44270/gist-client-android | |
# | |
################################# |
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
########################################## | |
# gister.py | |
# Github Gist Library for Python | |
# | |
# Usage: | |
# from gister import Gister | |
# | |
# mygist = Gister("bng44270") | |
# | |
# mygist.ListGists() |
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 requests | |
from re import sub as regex_sub | |
from re import match as regex_match | |
# Return every "i" value in array "x" | |
everyother = lambda x,i : [a for a in x if x.index(a) % i == 0] | |
# Similar to the JavaScript slice function. Usage: slice(<array>,<beginning-index>,<length>) | |
slice = lambda a,i,l : a[i:(i+l)] |
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 requests | |
class PyIFTTT: | |
""" | |
Usage: | |
# Initialize object with IFTTT API Key | |
myifttt = PyIFTTT('api-key') | |
""" | |
def __init__(self,key=""): |
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
from arguments import Arguments | |
from sys import argv as command_args | |
from math import ceil as round_up | |
priority_map = {1:90.0,2:60.0,3:40.0,4:25.0,5:10.0} | |
severity_map = {1:95.0,2:55.0,3:25.0} | |
impact_map = {1:80.0,2:60.0,3:40.0} | |
ARGS = Arguments(command_args) |
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
#*********************** | |
# TaxiiClient class | |
# Constructor: | |
# TaxiiClient(discovery_url, auth = None, cert_val = True) | |
# auth => Set to dictionary to do HTTP auth {'user':'USERNAME','pass':'PASSWORD'} | |
# cert_val => Sets whether or not to do SSL certificate validation | |
# Methods: | |
# do_doscovery() | |
# - perform TAXII DISCOVERY | |
# get_urls() |
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
# Requires Python 3.6 | |
import xml.etree.ElementTree as ET | |
from arguments import Arguments | |
import sys | |
import re | |
from os import path, listdir | |
args = Arguments(sys.argv) |
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
from arguments import Arguments | |
from sys import argv as command_args | |
def xlsloadcodes(filename): | |
with open(filename,'r') as f: | |
filelines = f.readlines() | |
return [{'code':a.split(' ')[0],'value':a.split(' ')[1].strip()} for a in filelines] | |
def xlsmakeif(cell,codes): |
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
#!/bin/bash -x | |
######################################################### | |
# This script will take the output from the CQ listpage | |
# tool and download a package for each node listed | |
######################################################### | |
PROTO="http" | |
SERVER="localhost:4502" | |
AUTH="admin:admin" |