Skip to content

Instantly share code, notes, and snippets.

@mountainstorm
mountainstorm / cve.py
Created September 19, 2015 08:35
Simple script to pull CVE info from NVD, parse the XML and import/update it to a mongodb
# coding: utf-8
'''This is a simple script to download an NVD CVE feed, extract interesting bits
from the XML and import/update a mongo db - or optionally print it to screen'''
from __future__ import unicode_literals, print_function
import zipfile
import urllib2
import argparse
import cStringIO
import xml.etree.ElementTree as ET
@mountainstorm
mountainstorm / PygmentsFunc
Created May 17, 2015 16:04
Display source code with pygments; but only the function - searches for the end of the func and only returns it
Copyright (c) 2015 Mountainstorm
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@mountainstorm
mountainstorm / gist:e459b8ddb39b0b494ba2
Created April 23, 2015 07:28
Pretty Graphviz charts
# coding: utf-8
import xml.etree.ElementTree as ET
GRAPHVIZ_PT_2SVG = 3.5 # conversion from gv pt size to svg units
namespaces = {
u'svg': u'http://www.w3.org/2000/svg',
u'xlink': u'http://www.w3.org/1999/xlink'
@mountainstorm
mountainstorm / search.py
Last active August 29, 2015 14:15
Security CTF search script; DONT use unless you want a script which allows a fun way to test Shellshock
#!/usr/bin/python
# coding: utf-8
import sys
import os
import re
import subprocess
import cgi
import cgitb
@mountainstorm
mountainstorm / trackdiff.py
Created September 9, 2014 22:23
Simple unified diff processing script, which takes lineno's for file a, and tells you where they will be in file b. The idea is it should be really useful for tracking issues once you've done a source code review
#!/usr/bin/python
# coding: utf-8
# Copyright (c) 2014 Mountainstorm
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@mountainstorm
mountainstorm / enumeration.py
Created September 9, 2014 18:20
hfsplus structures, allows parsing the hfsplus file structure and changing it.
#!/usr/bin/python
# coding: latin-1
# Copyright (c) 2013 Mountainstorm
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@mountainstorm
mountainstorm / GraphicsContext.py
Created August 28, 2014 06:45
Console graphic primitives; basic drawing primitives, boxes, lines etc implemented in console control codes. Was part of MtUI when it was going to be console based but not used anymore. Saved here as its pretty fun code and I didn't want to loose it
#!/usr/bin/python
# coding: utf-8
# Copyright (c) 2013 Mountainstorm
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@mountainstorm
mountainstorm / jquery.find.highlight.js
Last active August 29, 2015 13:57
Simple highlight to allow dynamic highlighting of a search pattern
/*
* Copyright (c) 2014 Mountainstorm
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@mountainstorm
mountainstorm / jquery.disableswipeback.js
Last active August 7, 2019 10:21
jquery plugin to disable back/forward swiping on OSX Safari
/*
* Copyright (c) 2014 Mountainstorm
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@mountainstorm
mountainstorm / texture-atlas.py
Created December 24, 2013 11:44
Simple script which takes a selection of files and creates a Starling 2D texture texture & atlas; cropping any redundant border (transparent bits). Requires Pillow (new PIL - 'easy_install Pillow')
#!env python3
# coding: utf-8
# Copyright (c) 2013 Mountainstorm
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is