Skip to content

Instantly share code, notes, and snippets.

@winguru
winguru / docker-compose.yml
Created May 23, 2018 15:14 — forked from huksley/docker-compose.yml
Launches fully configured Graylog 2.3.1 instance
#
# Launches configured Graylog 2.3.1 instance
#
# - Docker-compose 1.16 required
# - Please configure following according to your network:
# * gelf-address URL (for each container)
# * GRAYLOG_WEB_ENDPOINT_URI
# - After launch define GELF tcp and GELF udp inputs in graylog web ui
# - Containers send logging to the graylog itself
# - By default tuned to 30 days retention
# get a reference to the config instance
$tsgs = gwmi -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -Filter "TerminalName='RDP-tcp'"
# grab the thumbprint of the first SSL cert in the computer store
#$thumb = (gci -path cert:/LocalMachine/My | select -first 1).Thumbprint
$thumb = (gci -path Cert:\LocalMachine/My | select -Property Thumbprint, NotBefore, EnhancedKeyUsageList | Sort-Object -Property NotBefore | Select-Object -Last 1).Thumbprint
# set the new thumbprint value
swmi -path $tsgs.__path -argument @{SSLCertificateSHA1Hash="$thumb"}
###############################################################################
# Windows Offline Certificate Generator: Requests a certificate from the
# specified CA from the specified template and includes the NetBIOS name, FQDN
# and, if configured, static IP address as SANs
#
# Author: Jeremy Hagan
# Date: 25/06/2015
# Version: 1.1
#
# Usage is: GetCertificate.ps1 -CertTemplate TemplatName -CAServerName ServerName -CAName CAName -KeyLength KeyLength
#
# Copyright (c) 2010 Plex Development Team. All rights reserved.
#
# Modififications by Geoff Thornton (github@geoffthornton.me)
# This file should go in the Plex Scanners folder:
# %USERPROFILE%\AppData\Local\Plex Media Server\Scanners\Series
import re, os, os.path
import Media, VideoFiles, Stack, Utils
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
#
# -shirk added TLS version
# -jpicht added SMTP STARTTLS hack
import sys
import struct
@winguru
winguru / ssltest.py
Last active August 29, 2015 13:58 — forked from jpicht/ssltest.py
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
#
# -shirk added TLS version
# -jpicht added SMTP STARTTLS hack
import sys
import struct
# file: merger.py
# based off: http://cmikavac.net/2011/07/09/merging-multiple-nessus-scans-python-script/
# by: mastahyeti
# edited by: ebrinkster
import xml.etree.ElementTree as etree
import shutil
import os
first = 1
# Use external IP for best compatibility with apache2 vhosts listening on *:8888
backend default {
.host = "X.X.X.X";
.port = "80";
.connect_timeout = 0.5s;
.between_bytes_timeout = 5s;
.saintmode_threshold = 20;
.first_byte_timeout = 60s;
.max_connections = 10;
@winguru
winguru / compare2set.pl
Last active February 9, 2017 15:37
Format a JUNOS "compare" diff to set commands
#!/usr/bin/perl
# Updated 1/9/2017 by Geoff Thornton <github@geoffthornton.me>
# Used to transform a JUNOS "show | compare" diff format to a "show | display set" format
$element = qr/(policy|term)/;
@level = ();
@insert = ();
while (<>) {
if ( $_ =~ /^\[edit .*\]$/ ) {
@winguru
winguru / wordpress.vcl
Last active December 21, 2015 12:08 — forked from reifman/default.vcl
# Default backend definition. Set this to point to your content server.
backend default {
.host = "127.0.0.1";
.port = "80";
.connect_timeout = 60s;
.first_byte_timeout = 60s;
.between_bytes_timeout = 60s;
.max_connections = 800;
}