Skip to content

Instantly share code, notes, and snippets.

View SteveMcGrath's full-sized avatar

Steven McGrath SteveMcGrath

View GitHub Profile
@SteveMcGrath
SteveMcGrath / example_python_tio_session.py
Created November 2, 2018 14:37
Example connecting to Tenable.io w/o pyTenable or the Python SDK
import requests
from requests.packages.urllib3.util.retry import Retry
# Sets the retry adaptor with the ability to properly backoff if we get 429s
retries = Retry(
total=3,
status_forcelist={429, 501, 502, 503, 504},
backoff_factor=1,
respect_retry_after_header=True
)
@SteveMcGrath
SteveMcGrath / dofler.html
Last active January 4, 2018 21:42
Dofler v6 HD Wires
<html>
<head>
<title>Dofler v6 Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.min.js"></script>
<script src="http://momentjs.com/downloads/moment.min.js"></script>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous">

Keybase proof

I hereby claim:

  • I am stevemcgrath on github.
  • I am stevemcgrath (https://keybase.io/stevemcgrath) on keybase.
  • I have a public key ASBDAlHEsS4PcuIt9XJZAHOEj4_C49uCHte41aDeDgAbqAo

To claim this, I am signing this object:

#!/usr/bin/env python
from threading import Thread
from io import StringIO
import telepot, re, sys, os, requests, subprocess
class TelegramBaskitBot(Thread):
def __init__(self, token, adminuser=None, adminid=None, address=None, port=None, sudo=True, baskit=None):
# Populate the required fields
self.token = token
self.adminuser = adminuser
from BeautifulSoup import BeautifulSoup as soup
import re
def getdata(filename):
rcve = re.compile(r'CVE')
with open(filename) as xmlfile:
rawdata = soup(xmlfile.read())
for section in rawdata.findAll('section', attrs={'title': rcve}):
print section.get('title')
for item in section.findAll('infodata'):
http://pastebin.com/Hynppw70
@SteveMcGrath
SteveMcGrath / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@SteveMcGrath
SteveMcGrath / ciscobuilddate.py
Last active August 29, 2015 14:07
Determine the build week date of Cisco Equipment
from datetime import date, timedelta
import calendar
def builddate(serial):
'''
Returns a date object of the manufactured date.
'''
# The serial format is LLLYYWWSSSS where YY and WW denote the build week.
# YY -- Decimal number where 00 denotes 1996 as the starting year.
# WW -- Decimal number of the week of the year it was built.
@SteveMcGrath
SteveMcGrath / p2vps.sh
Last active August 29, 2015 14:05
Physical2OpenVZ
#!/bin/bash
###############################################################################
# Physical2OpenVZ #
###############################################################################
# Version 0.1
# Written By: Steven McGrath
#
# Version History
# ---------------
# * 0.1 - Initial Version
### Keybase proof
I hereby claim:
* I am stevemcgrath on github.
* I am stevemcgrath (https://keybase.io/stevemcgrath) on keybase.
* I have a public key whose fingerprint is 4068 1B3D 966E 41E2 80EE A3B2 09B1 AB82 775F 0AE0
To claim this, I am signing this object: