Skip to content

Instantly share code, notes, and snippets.

@msghens
msghens / pf_snort_suppress.txt
Last active June 13, 2022 14:29
pfSense snort spress file
#(spp_sip) URI is too long
suppress gen_id 140, sig_id 3
#(http_inspect) INVALID CONTENT-LENGTH OR CHUNK SIZE
suppress gen_id 120, sig_id 8
#(http_inspect) UNKNOWN METHOD
suppress gen_id 119, sig_id 31
#(http_inspect) NO CONTENT-LENGTH OR TRANSFER-ENCODING IN HTTP RESPONSE
@msghens
msghens / person.py
Created October 20, 2015 21:08
Python person record for IMS/LDI python scripts
# -*- coding: utf-8 -*-
#~ Representation of the Ellucian Person Class. Class will be used
#~ to make it easier to pass information between defs and processes.
#~
#~ Unlike the google provisioning that uses dictionary to represent a the user
import xmltodict
#!/bin/sh -x
if [ -d ./google-env ]; then
rm -rf google-env
fi
#virtualenv2 --system-site-packages google-env
virtualenv google-env
. ./google-env/bin/activate
pip install google-api-python-client
@msghens
msghens / nikola_aws.json
Last active February 28, 2019 23:13
Anti-hotlink for Nikola Static Blog on AWS S3
{
"Version": "2012-10-17",
"Id": "adbeeacc-1678-4760-9d52-dc3379f07506",
"Statement": [
{
"Sid": "Allow get requests referred by domain",
"Effect": "Deny",
"Principal": {
"AWS": "*"
},
@msghens
msghens / openldap_passwd.py
Created July 19, 2016 23:08 — forked from rca/openldap_passwd.py
Python hashing and test functions for user passwords stored in OpenLDAP.
#!/usr/bin/env python
"""
http://www.openldap.org/faq/data/cache/347.html
As seen working on Ubuntu 12.04 with OpenLDAP 2.4.28-1.1ubuntu4
Author: Roberto Aguilar <roberto@baremetal.io>
"""
import hashlib
import os
@msghens
msghens / getCanvasPortalData.py
Last active October 27, 2016 16:03
Downloads current Canvas Portal Data and decompresses files to table names.
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
import urllib2
import json
import requests
from pprint import pprint
import sys
@msghens
msghens / logex.groovy
Created March 21, 2017 17:36
Simple groovy file log with rotation.
#!/usr/bin/groovy
//See: http://stackoverflow.com/questions/16522339/rolling-log-files-removing-old-log-files/16522674
import java.util.logging.Logger
import java.util.logging.FileHandler
import java.util.logging.SimpleFormatter
import java.io.IOException
import java.util.logging.LogManager
import java.util.logging.Level
//@GrabResolver(name='postgres', root='https://mvnrepository.com/artifact/org.postgresql/postgresql')
//@GrabConfig(systemClassLoader=true)
//@Grab(group='org.postgresql', module='postgresql', version='9.4.1211.jre6')
import groovy.sql.Sql;
import java.util.logging.*
Logger logger = Logger.getLogger("")
logger.info ("I am a test info log")
@msghens
msghens / lvar.ise
Created April 21, 2017 21:07
Local Variable example for ise
((IF_NOT_BLANK sql_conn))DEFINE _connect_identifier=((sql_conn))
((ELSE))((IF_NOT_BLANK /default/sql_conn))DEFINE _connect_identifier=((/default/sql_conn))
((ELSE))PROMPT No local connection defined using ISE Default: ((/Ban_controls/Bansid)).
DEFINE _connect_identifier=((/Ban_controls/Bansid))
((ENDIF*))((ENDIF*))
@msghens
msghens / log.py
Created April 27, 2017 21:19
module for simple file rolling logger.
# -*- coding: utf-8 -*-
"""
Logging module, to be universal to all modules
"""
import sys
import logging
import logging.handlers
import os