Skip to content

Instantly share code, notes, and snippets.

Nathan Manzi nmanzi

Block or report user

Report or block nmanzi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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
View letsencrypt.ps1
## 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"
View Golden Sun.html
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: #EEE;}
.emubox {
border: 3px solid green;
padding: 10px;
}
.container{
You can’t perform that action at this time.