Skip to content

Instantly share code, notes, and snippets.

@ImpostorKeanu
ImpostorKeanu / nmap_open_only.xsl
Created January 23, 2021 19:06
XSL file to limit hosts and ports only to those that are responsive/open in NMap XML documents
<!--
Quick and dirty XSL file to lessen the size of large NMap
XML files. Below is an example using the lxml library in Python.
Observed to reduce size of a 300MB XML IP protocol scan to 19MB
in less than a minute.
from lxml import etree as ET
document = ET.parse('to_transform.xml')
xslt = ET.parse('nmap_open_only.xsl')
@ImpostorKeanu
ImpostorKeanu / external_django_orm.py
Last active January 23, 2021 18:02
Use Django's ORM without the web framework
#!/usr/bin/env python3
from django.conf import settings
'''
Useful in situations when you want to use Django's ORM
instead of SQLAlchemy, usually just due to preference.
'''
# ========================
# IMPLEMENT CONFIGURATIONS
### Keybase proof
I hereby claim:
* I am arch4ngel on github.
* I am arch4ngel (https://keybase.io/arch4ngel) on keybase.
* I have a public key ASASuDBvvmZALA0LUBZpazTLNab-Lo2brFzBn07W96ooeQo
To claim this, I am signing this object:
# useful for running ssl server on localhost
# which in turn is useful for working with WebSocket Secure (wss)
# copied from http://www.piware.de/2011/01/creating-an-https-server-in-python/
@ImpostorKeanu
ImpostorKeanu / index.md
Created January 1, 2016 15:04 — forked from rstacruz/index.md
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one