Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathan Manzi nmanzi

View GitHub Profile
View gist:d72245ef261a22af6de9c2c8155d318c
***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
View createscheduledcheckin.sh
#!/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 Jun 12, 2019
Checks if the database is a writable replica - primary in Always-On AG
View fn_is_writeable_replica.sql
USE [master]
GO
CREATE FUNCTION [dbo].[fn_is_writeable_replica] (@dbname sysname)
RETURNS BIT
WITH EXECUTE AS CALLER
AS
BEGIN
View gist:a606bebefd1b55041c9ae4c8c814ba83
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 Sep 2, 2018
Queries the Horizon View Events DB for unique users logging into a broker from outside of local networks.
View GetUniqueHorizonViewExternalUsers.sql
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'
View keybase.md

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:

View GetUniqueHorizonViewExternalUsers.sql
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
View worker_user_spec.rb
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) }
View Gemfile
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"
@nmanzi
nmanzi / nexus.service
Last active Jan 5, 2018
Systemd script for Sonatype Nexus 2
View nexus.service
[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
You can’t perform that action at this time.