Skip to content

Instantly share code, notes, and snippets.

View justincjahn's full-sized avatar

Justin Jahn justincjahn

View GitHub Profile
@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 / 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 / panos.rb
Created March 24, 2018 00:04
Oxidized NCM: PANOS XML Model
class PanOS < Oxidized::Model
# PaloAlto PAN-OS model #
# Modified by https://github.com/justinjahn to output XML from CLI instead of JSON
comment '! '
prompt /^[\w.\@:\(\)-]+[#>]\s?$/
cmd :all do |cfg|
@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 / 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 / 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 / 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>
@justincjahn
justincjahn / Dockerfile
Last active July 24, 2016 09:20
Docker Minecraft Server
FROM centos:latest
MAINTAINER jjahn
# UPDATE
RUN yum -y update
# Install Java and GNU Build Tools
RUN yum -y install java-1.8.0-openjdk
RUN yum -y groupinstall "Development Tools"
@justincjahn
justincjahn / date-range-picker.hbs
Last active August 29, 2015 14:06
Ember.js Bootstrap Date Range
{{input type="text" class="form-control date-picker date-start"}}
<span class="input-group-addon">to</span>
{{input type="text" class="form-control date-picker date-end"}}
<span class="clear-button glyphicon glyphicon-remove-circle form-control-feedback"></span>