Skip to content

Instantly share code, notes, and snippets.

@kkfong
kkfong / ca.md
Created May 30, 2018 18:16 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@kkfong
kkfong / one-line-random-string-generators.md
Created March 26, 2018 18:29 — forked from henriquemenezes/one-line-random-string-generators.md
List of one-line random string generators

One-line Random String Generator

Python

CSPRNG (Cryptographically Secure Pseudo-Random Number Generator) functions:

  • os.urandom(n): return a string of n random bytes.
  • random.SystemRandom(): provides random functions that uses os.urandom().

Note: Don't use random module for PRNG for security purposes.

#!/bin/bash
JQPATH=$(which jq)
if [ "x$JQPATH" == "x" ]; then
echo "Couldn't find jq executable." 1>&2
exit 2
fi
set -eu
shopt -s nullglob
@kkfong
kkfong / .gitignore
Created August 6, 2016 18:48 — forked from smugmug-api-docs/.gitignore
OAuth 1.0a Example Code for the SmugMug API
ENV
__pycache__
*.json
!example.json
@kkfong
kkfong / pfsense2-2.grok
Created June 26, 2016 18:03 — forked from elijahpaul/pfsense2-2.grok
pfsense2-2.grok
# GROK match pattern for logstash.conf filter: %{LOG_DATA}%{IP_SPECIFIC_DATA}%{IP_DATA}%{PROTOCOL_DATA}
# GROK Custom Patterns (add to patterns directory and reference in GROK filter for pfSense events):
# GROK Patterns for pfSense 2.2 Logging Format
#
# Created 27 Jan 2015 by J. Pisano (Handles TCP, UDP, and ICMP log entries)
# Edited 14 Feb 2015 by E. Paul
#
# Usage: Use with following GROK match pattern
@kkfong
kkfong / git-cheat-sheet.md
Created November 12, 2015 17:24 — forked from iansheridan/git-cheat-sheet.md
A cheat sheet for GIT

Setup

git clone <repo>

clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS

Add colors to your ~/.gitconfig file:

@kkfong
kkfong / 01-inputs.conf
Created October 16, 2015 08:52 — forked from mortenya/01-inputs.conf
I have this taking events from my Snort Defense Center, it's light right now, mostly a proof of concept.
input {
syslog {
port => 1514
}
}
filter {
#IP Address of Snort
if [host] =~ /192\.168\.0\.250/ {
mutate {
@kkfong
kkfong / pfsense_kibana_dash_v1.json
Created October 16, 2015 06:50 — forked from elijahpaul/pfsense_kibana_dash_v1.json
pfSense firewall dashboard (Kibana)
{
"title": "PFSense Firewall",
"services": {
"query": {
"idQueue": [],
"list": {
"0": {
"query": "tags: \"PFSense\" AND action: \"pass\"",
"alias": "Passed",
"color": "#6ED0E0",
@kkfong
kkfong / Readme.md
Created October 5, 2015 05:03 — forked from boly38/Readme.md
a maven profile called "stats" used to log some maven lifecycle steps

"stats" maven profile

this profile simply append step datetime in a file called stats.log

Installation

  • add stats profile to your pom.xml
#!/bin/sh
# dependencies
echo "Installing dependencies via Homebrew (http://brew.sh)"
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew update
brew install gcc48