Skip to content

Instantly share code, notes, and snippets.

-- Create a trigger to prevent a DB being accidently deleted on a production server.
-- This trigger prevents drop of ALL db's on the server.
-- Find it at the root level under Root > Server Objects > Triggers.
CREATE TRIGGER TRG_PreventDropDB ON ALL SERVER
FOR DROP_DATABASE
AS
BEGIN
RAISERROR('MLJ SYSTEMS DEFINED ERROR : You cannot drop databases on this server.', 16,1);
@mattjoslin
mattjoslin / install-unifi-pihole-English.sh
Created May 3, 2020 14:13
Install UniFi controller and Pi-hole
#! /bin/bash
Colour='\033[1;31m'
less='\033[0m'
echo -e "${Colour}By using this script, you'll adjust the password, update the system, install the stable UniFi controller of your choice and install Pi-hole.\nUse CTRL+C to cancel the script\n\n${less}"
read -p "Please enter a STABLE version (e.g: 5.9.29) or press enter for version 5.12.66: " version
if [[ -z "$version" ]]; then
version='5.12.66'
# Telegraf Configuration
#
# Telegraf is entirely plugin driven. All metrics are gathered from the
# declared inputs, and sent to the declared outputs.
#
# Plugins must be declared in here to be active.
# To deactivate a plugin, comment out the name and any variables.
#
# Use 'telegraf -config telegraf.conf -test' to see what metrics a config
# file would generate.
@mattjoslin
mattjoslin / profiles.json
Last active February 15, 2020 16:28
Windows Terminal Profile setup
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"alwaysShowTabs": true,
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"initialCols": 120,
"initialRows": 30,