Skip to content

Instantly share code, notes, and snippets.

View pglezen's full-sized avatar

Paul Glezen pglezen

View GitHub Profile
@pglezen
pglezen / gethmac.md
Last active October 1, 2018 11:32
Some notes on managing Geth and Mist on Mac OS in local user space.

Ethereum on Mac OS

These are some installation and update tips for Ethereum tools on Mac OS.

Geth

First and foremost is Geth, the Go ETHereum node. The download site is

@pglezen
pglezen / DatetimeZ.ipynb
Created October 22, 2017 20:08
Parsing timestamps with Z in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pglezen
pglezen / errdbtimes.awk
Created September 21, 2017 18:25
Organize Cloverleaf Error DB Output
# Presents hcidbdump -l output one entry per line.
#
# Usage: hcidbdump -e -l -O i | awk -f errdbtimes.awk
#
# This is useful because the raw output spreads each entry across
# several lines. This makes the output difficult to script and
# overly verbose. Here is a sample
#
#------- Begin Sample Raw Output -----------------
#
@pglezen
pglezen / console.log.R
Last active February 27, 2017 03:09
A console.log for R
console.log <- function(fmt,...) {
print(paste(format(Sys.time(), "%H:%M:%S"), sprintf(fmt, ...)))
}
@pglezen
pglezen / RiskSimulation.ipynb
Created October 31, 2016 03:34
Risk Simulation Using Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pglezen
pglezen / DPLatencyRegex.md
Created December 5, 2015 01:04
DataPower Latency Regular Expressions

This Gist is a small collection of regular expressions used to parse DataPower latency log entries. It only works for basic latency entries, not extended latency entries. Also, it may only work for MPGS; this hasn't been tested for WSPs.

reg = re.compile(r'\w\w\w (\w\w\w \d\d \d\d\d\d \d\d:\d\d:\d\d) \[0x80e00073\]\[latency\]\[info\] \w+\(([^)]+)\): tid\((\d+)\).+ Latency:\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+\[(https?://[^/]+)([^?]+)?(\?.+)?\]')

Here is a description by groupings.

@pglezen
pglezen / DPLatency.ipynb
Created December 3, 2015 05:36
DataPower Latency Visualization
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pglezen
pglezen / spmetagen.xsl
Created June 12, 2015 14:40
Generate SAML SP metadata for DataPower
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dp="http://www.datapower.com/extensions"
xmlns:sp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:sa="urn:oasis:names:tc:SAML:2.0:assertion"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
exclude-result-prefixes="dp"
extension-element-prefixes="dp"
version="1.0">
@pglezen
pglezen / aDescription.md
Last active May 20, 2021 09:27
DataPower Dynamic Routing

The code sample below demonstrates how to implement a dynamic routing scheme in DataPower. It uses the inbound URI as the routing criterion. The routing logic is contained in the XSLT named computeRoute.xsl. The XSLT reads the route configuration from an XML file named routes.xsl.

All matches are logged to a log category named route-<domain> where represents the name of the application domain. Defining a log category with this name will enable you to fine tune the destination

@pglezen
pglezen / WSSubject.md
Created October 20, 2014 16:56
Obtain credential attributes from WSSubject in a WAS container.

The code sample below demonstrates how to obtain user and group information for an authenticated user from within WebSphere Application Server. It uses the WAS security API as documented in the Programming API section of the WAS 8.5.5 Knowledge Center (see packages starting with com.ibm.websphere.security.auth and com.ibm.websphere.security.cred.)

For more details on the WAS authentication model, please see Advanced WAS Authentication on IBM developerWorks. Yes, it's old; but most of it still applies.