Skip to content

Instantly share code, notes, and snippets.

View justincjahn's full-sized avatar

Justin Jahn justincjahn

View GitHub Profile
@justincjahn
justincjahn / 10-cisco-elasticsearch.conf
Last active March 10, 2024 17:36
Logstash: Processing Cisco Logs
#
# INPUT - Logstash listens on port 8514 for these logs.
#
input {
udp {
port => "8514"
type => "syslog-cisco"
}
@justincjahn
justincjahn / README.md
Last active January 16, 2024 20:15
Minecraft server(s) using systemd and screen.

Install

# Install dependencies
sudo yum install -y java-1.8.0-openjdk screen

# Create a new unprivileged user for minecraft
useradd -r -m -d /opt/minecraft minecraft

# Create the directory that will house our minecraft instances

sudo su --shell /bin/bash minecraft

@justincjahn
justincjahn / New-HOTPSecret.ps1
Last active September 12, 2023 01:01
Create a new Duo-compatible HOTP secret for Yubikeys
<#
.SYNOPSIS
Generate an HOTP secret compatible with Yubikey and Duo.
.DESCRIPTION
Thanks to Yubico for the example:
https://support.yubico.com/hc/en-us/articles/360015668699-Generating-Base32-string-examples
#>
Function New-HOTPSecret {
[CmdletBinding()]
@justincjahn
justincjahn / cteDates.sql
Created January 18, 2023 20:57
Dynamic Date Table in SQL Serverless
WITH cteCount as (
SELECT
(n1.n + n10.n + n100.n + n1000.n) * -1 AS n
FROM
(VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) AS n1(n)
CROSS JOIN
(VALUES(0),(10),(20),(30),(40),(50),(60),(70),(80),(90)) AS n10(n)
CROSS JOIN
(VALUES(0),(100),(200),(300),(400),(500),(600),(700),(800),(900)) AS n100(n)
CROSS JOIN
@justincjahn
justincjahn / README.md
Created July 26, 2012 22:55
Address validation using Google Maps

Google Maps Address Verification

The HTML and accompanying scripts in this project demonstrate how to present users with a "did you mean..." style address validation mechanism that helps to ensure accurate addresses for sites that need said information.

Google Maps API Key

The script will need your own API key to function, my key has been redacted.

@justincjahn
justincjahn / Execute-RunbookLocally.ps1
Created August 5, 2022 22:08
Azure Automation Update Management - Execute Pre/Post script on Hybrid Worker Groups with local machines
<#PSScriptInfo
.VERSION 1.0
.GUID c2984973-98d8-4913-adba-55f1aec1c90f
.AUTHOR justincjahn
.COMPANYNAME Jahn Digital
.COPYRIGHT MIT
.TAGS UpdateManagement, Automation
.LICENSEURI
.PROJECTURI
.ICONURI
@justincjahn
justincjahn / Scram.js
Created October 19, 2011 19:43
SCRAM-SHA256-JSON
Scram = {
// summary: An implementation of th SCRAM-SHA256-JSON authentication protocol
// for use with the Storm Content Management Framework.
// author: Justin "4sak3n 0ne" Jahn
// copyright: (c) 2010 4sak3n Design (http://www.4sk.us/)
// license: http://www.opensource.org/licenses/bsd-license.php New BSD License
// The cryptographic libraries to be utilized by this method.
crypto: {
base: 'http://crypto-js.googlecode.com/files/',
@justincjahn
justincjahn / config.htm
Last active October 14, 2020 08:49
IOT Garage Door using ESP8266, ESP8266WebServer and Blynk w/ OTA
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>IOT Garage Door</title>
<link rel="stylesheet"
@justincjahn
justincjahn / vimdb.sh
Created November 29, 2011 01:03
Simple script that edits a bind zone file, updates the SOA line, commits to etckeeper, and restarts BIND.
#!/usr/bin/env bash
# The file we will be editing
FILE=/etc/bind/domain.tld
DOMAIN=domain.tld
# A path to the BIND init script
BIND=/etc/init.d/bind9
ETCKEEP=/usr/sbin/etckeeper
SUDO=/usr/bin/sudo
@justincjahn
justincjahn / Get-ExchangeServers.ps1
Created November 25, 2014 06:11
Fetch a list of Exchange servers from a Windows domain.
<#
.SYNOPSIS
Return a list of available Exchange Servers.
.DESCRIPTION
Fetches a list of Exchange servers from an Active Directory domain.
.NOTES
VERSION: 1.0.0
AUTHOR: Justin Jahn <jjahn@aeafcu.org>