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
cut -d ' ' -f 2 .ssh/id_rsa.pub | base64 -d | sha256sum | cut -d ' ' -f 1 | sed 's/..\B/&:/g' |
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
def constructpacket(data): | |
frame = [ 0x60 ] | |
frame.extend(data) | |
lrc = 0x00 | |
for x in frame: | |
lrc = lrc ^ x | |
frame.append(lrc) | |
frame.append(0x03) | |
return frame |
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
[alias] | |
pl = log --oneline --decorate --graph | |
plall = log --oneline --decorate --all --graph | |
co = checkout | |
ds = diff --staged | |
d = diff | |
dwd = diff --word-diff | |
dcw = diff --color-words | |
dswd = diff --staged --word-diff | |
dscw = diff --staged --color-words |
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 bs4 import BeautifulSoup | |
html_doc=open('dns.html', 'r').read() | |
soup = BeautifulSoup(html_doc, 'html.parser') | |
table = soup.find('table', attrs={'class': 'advanced-dns'}) | |
rows = table.findAll('tr', attrs={'class': '[object Object]'}) | |
for row in rows: | |
cols = row.findAll('td') | |
rowtextl = [c.text.strip().replace('\n',' ') for c in cols] | |
removelist = (u'TTL Automatic', u'Remove Edit') | |
for r in removelist: |
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
# stolen from glyph | |
Host *.via.* | |
ProxyCommand sh -c 'cuttable="$(echo "${0}" | sed -e "s/.via./~/g" )"; to_host="$(echo "${cuttable}" | cut -d "~" -f 1)"; via_host="$(echo "${cuttable}" | cut -d "~" -f 2- | sed -e "s/~/.via./g")"; local_port="${1}"; echo "Connecting to <${to_host}> on port <${local_port}> via <${via_host}>." > /dev/stderr; exec ssh -q "${via_host}" -W "${to_host}:${local_port}";' '%h' '%p' |
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
# IOS 15.4 | |
sed -r 's/(ip ospf authentication-key 7 |ip ospf message-digest-key 1 md5 7 )([0-9A-F]+)/\1*redacted*/;s/(snmp-server community )([^ ]+) (.*)$/\1*redacted* \3/' | |
# ASA 9.1 | |
sed -i -r 's/( ospf message-digest-key [0-9]+ md5 )([^ ]+)(.*)$/\1*redacted*\3/;s/(snmp-server community )(.*)/\1*redacted*/;s/(ikev1 pre-shared-key )(.*)/\1*redacted*/' |
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
| egrep -o 'Deny ..p.*' | sed -r 's/ by.*$//;s/\([^ ]+\)//g;s!/[0-9]+ ! !' | sort | uniq -c |
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 fileinput | |
from datetime import datetime | |
counts = dict() | |
for i in range(288): | |
counts[i] = 0 | |
for line in fileinput.input(): | |
dt = datetime.strptime(line.strip(), '%d/%b/%Y:%H:%M:%S') | |
bucket = (dt.hour*60+dt.minute)/5 |
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/python | |
from binascii import hexlify, unhexlify | |
frombank = unhexlify('723a860e84da00cc090014c10390b39d7d79861384da00c80e00000000000001ef1d534991a069861384da00c90e00000000000057d981ff69f29ba7') | |
working = unhexlify('723c303a860e84da00cc090014c10390b39d7d79861384da00c80e00000000000001ef1d534991a069861384da00c90e00000000000057d981ff69f29ba7') | |
from pyasn1.type import tag, tagmap, univ, namedtype | |
from pyasn1 import debug | |
#debug.setLogger(debug.Debug('all')) |
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
# Test on delivery | |
def register(key): | |
def decorator(method): | |
method.response = key | |
return method | |
return decorator | |
@register('$') |
NewerOlder