Skip to content

Instantly share code, notes, and snippets.

View nmanzi's full-sized avatar
🌀
In a maelstrom of self indulgence.

Nathan Manzi nmanzi

🌀
In a maelstrom of self indulgence.
View GitHub Profile
@nmanzi
nmanzi / bigtreetech-skr-2-h2-500c.cfg
Created January 24, 2023 15:10
Klipper config for the SKR 2 with a Biqu H2 500c Extruder.
# This file contains common pin mappings for the BigTreeTech SKR 2.
# To use this config, the firmware should be compiled for the
# STM32F407 with a "32KiB bootloader".
# In newer versions of this board shipped in late 2021 the STM32F429
# is used, if this is the case compile for this with a "32KiB bootloader"
# You will need to check the chip on your board to identify which you have.
#
# The "make flash" command does not work on the SKR 2. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
@nmanzi
nmanzi / fn_is_writeable_replica.sql
Last active July 22, 2021 19:41
Checks if the database is a writable replica - primary in Always-On AG
USE [master]
GO
CREATE FUNCTION [dbo].[fn_is_writeable_replica] (@dbname sysname)
RETURNS BIT
WITH EXECUTE AS CALLER
AS
BEGIN
***REDACTED OUTPUT***
***Terraform Apply, azurerm_key_vault_secret is modified in-place from existing state***
Provider produced inconsistent final plan
When expanding the plan for azurerm_function_app.fa to include new values
learned so far during apply, provider "azurerm" produced an invalid new value
for .app_settings["***"]: was
cty.StringVal("@Microsoft.KeyVault(SecretUri=https://***.vault.azure.net/secrets/***/44e0bbbfc06c454994212dda5007b5b3)"),
but now
#!/bin/sh
# Useful if you don't have AD/LDAP binding configured for your Jamf macOS workstations and/or local usernames
# are not the same as your AD/LDAP user ID but you'd still like to scope policies based on AD/LDAP group
# membership.
# This script configures a scheduled task that runs every 30 minutes and does the following:
# - Grab the username from device location details (enrolled user) using the API
# - Feed the username into `jamf policy -username`
# Make sure to replace the value of apiUser and apiPass with a standard Jamf user account
@nmanzi
nmanzi / gist:a6259f69cfe00c5ddf1e
Created December 15, 2015 03:55
pfSense 2.2 Graylog extractors
{
"extractors": [
{
"condition_type": "regex",
"condition_value": "^filterlog:.*,(in|out),4,.*",
"converters": [],
"cursor_strategy": "copy",
"extractor_config": {
"index": 17,
"split_by": ","
nodes:
o365-worldwide-any-miner:
inputs: []
output: true
prototype: o365-api.worldwide-any
o365-ipv4-processor:
inputs:
- o365-worldwide-any-miner
output: true
prototype: stdlib.aggregatorIPv4Generic
## Written by nathan.manzi@diverseit.com.au
## Required installation of the ACMESharp powershell module
## Follow installation steps at https://github.com/ebekker/ACMESharp/wiki/Quick-Start
##
Import-Module acmesharp
## !! Modify these variables before running script !!
$domain = "adfs.contoso.com"
$email = "jbloggs@contoso.com"
@nmanzi
nmanzi / GetUniqueHorizonViewExternalUsers.sql
Created September 2, 2018 14:56
Queries the Horizon View Events DB for unique users logging into a broker from outside of local networks.
select distinct event_data.StrValue
from (select distinct event.EventID, event_data.StrValue
from event inner join viewevents.dbo.event_data
on event_data.EventID = ViewEvents.dbo.event.EventID
where EventType = 'BROKER_USERLOGGEDIN' and
Time >= '2017-05-01' and
event_data.StrValue NOT LIKE '10.%'
and event_data.Name = 'ClientIPAddress') t inner join ViewEvents.dbo.event_data on t.EventID = ViewEvents.dbo.event_data.EventID
where event_data.Name = 'UserDisplayName'
@nmanzi
nmanzi / nexus.service
Last active January 5, 2018 14:05
Systemd script for Sonatype Nexus 2
[Unit]
Description=Nexus Service
After=network.target
[Service]
Type=forking
ExecStart=/opt/nexus/bin/nexus start
ExecStop=/opt/nexus/bin/nexus stop
ExecReload=/opt/nexus/bin/nexus restart
PIDFile=/var/run/nexus/nexus.pid

Keybase proof

I hereby claim:

  • I am nmanzi on github.
  • I am hadricus (https://keybase.io/hadricus) on keybase.
  • I have a public key ASCXxFTmRqRGC36lZ6WmACEj2IYm1a31CP9UkPdKek66Pwo

To claim this, I am signing this object: