Skip to content

Instantly share code, notes, and snippets.

View rhymeswithmogul's full-sized avatar

Colin Cogle rhymeswithmogul

View GitHub Profile
@rhymeswithmogul
rhymeswithmogul / renew-unifi-cert.sh
Last active July 29, 2021 15:58
Get a valid certificate for the UniFi Controller
#!/bin/sh
#########################################################################
# renew-unifi-cert.sh (Version 1.1, 2019-11-21)
# Copyright © 2019 Colin Cogle <colin@colincogle.name>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@rhymeswithmogul
rhymeswithmogul / Disable-PrintSpooler.ps1
Last active August 29, 2021 00:34
Disable Print Spooler to protect against PrintNightmare
<#PSScriptInfo
.VERSION 1.0.8
.GUID c77c6ecf-69d1-4bb3-bbc2-ea3d8aa91297
.AUTHOR Colin Cogle
.COPYRIGHT (c) 2021 Colin Cogle. All Rights Reserved. Licensed under the AGPL, version 3 or later.
.TAGS PrintNightmare, print, printer, spooler, security, DC, ADDS, CVE
.LICENSEURI https://www.gnu.org/licenses/agpl-3.0.en.html
.PROJECTURI https://gist.github.com/rhymeswithmogul/088e5b6ba075cbe3e0f17222797fd3aa
.EXTERNALMODULEDEPENDENCIES Microsoft.PowerShell.Management
.RELEASENOTES This minor version doesn't try to disable an already-disabled service.
@rhymeswithmogul
rhymeswithmogul / Compress-Assets.ps1
Last active December 1, 2021 12:45
Generate statically-compressed assets for NGINX
#!/usr/bin/env pwsh
<#PSScriptInfo
.VERSION 1.0.0
.GUID ca796623-622f-44ad-89f0-111c147eba79
.AUTHOR Colin Cogle
.COPYRIGHT © 2021 Colin Cogle. Licensed under the Affero GPL, version 3 or later.
.TAGS nginx, gzip, Brotli, compression
.LICENSEURI https://www.gnu.org/licenses/agpl-3.0.en.html
.PROJECTURI https://gist.github.com/rhymeswithmogul/20d5cb31a4c90c3a21d9175b1564669d
#>
@rhymeswithmogul
rhymeswithmogul / pygopherd-ipv6.patch
Created December 1, 2021 12:50
Add IPv6 support to PyGopherD 3.0.0 because I'm a little insane.
--- /tmp/server.py 2021-11-29 00:36:15.635976398 +0000
+++ server.py 2021-11-29 01:34:51.548265273 +0000
@@ -38,7 +38,7 @@
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_RCVTIMEO, timeout)
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDTIMEO, timeout)
- host, port = self.socket.getsockname()
+ host, port, flowinfo, scopeid = self.socket.getsockname()
if self.config.has_option("pygopherd", "servername"):
self.server_name = self.config.get("pygopherd", "servername")
@rhymeswithmogul
rhymeswithmogul / Remove-TeamViewerRemotely.ps1
Created November 7, 2019 23:26
Remove TeamViewer remotely
<#
Remove-TeamViewerRemotely.ps1, version 1.0
-- a quick and dirty script that I wish weren't needed, but here we are.
by Colin Cogle <colin@colincogle.name>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@rhymeswithmogul
rhymeswithmogul / Get-MailboxSizes.ps1
Last active November 27, 2023 23:05
A script to get mailbox sizes and print them beautifully.
<#
Get-MailboxSizes.ps1
Copyright (C) 2022-2023 Colin Cogle.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more