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
***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 / 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
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
@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'

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:

select distinct event_data.StrValue
from (select distinct event.EventID
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.StrValue NOT LIKE '172.1%' and
event_data.StrValue NOT LIKE '192.168.%' and
and event_data.Name = 'ClientIPAddress') t inner join ViewEvents.dbo.event_data on t.EventID = ViewEvents.dbo.event_data.EventID
require 'rails_helper'
RSpec.describe WorkerUser, type: :model do
it "has a valid factory" do
expect(build(:worker_user)).to be_valid
end
context "validation" do
let(:user) { build(:worker_user) }
source "https://rubygems.org"
gem "active_type", ">= 0.3.2"
gem "autoprefixer-rails", ">= 5.0.0.1"
gem "bcrypt", "~> 3.1.7"
gem "bootstrap_form", "~> 2.3"
gem "bootstrap-sass", "~> 3.3"
gem "bootscale", :require => false
gem "coffee-rails", "~> 4.2"
gem "dotenv-rails", ">= 2.0.0"