Skip to content

Instantly share code, notes, and snippets.

View MarkDarwin's full-sized avatar

Mark Darwin MarkDarwin

View GitHub Profile
@MarkDarwin
MarkDarwin / nextdnsblockyoutube.js
Created September 24, 2022 09:30
nextdns.io Block Youtube Ads
// CODE FROM : ducktapeonmydesk
const configID = "ABC123"; //the ID of the config, e.g. A1234BCD. Keep the parentheses
const APIKey = "YOURAPIKEY"; //your API key, found at the bottom of your account page. Keep the parentheses. https://my.nextdns.io/account
const retryFailedLinks = "Y"; //Mark "Y" or "N". If "Y", failed links will be retried 4 times at progressively increasing invtervals. If "N", failed links will not be retried. Keep the parentheses
const timeDelay = 800; //time delay between requests in milliseconds. 800 seems to not give any errors but is rather slow while anything faster will give errors (in limited testing). If you want to go lower, it is recommended that "retryFailedLinks" is marked "Y"
const ignoreDomainsSet = new Set([
"clients.l.google.com",
"clients1.google.com",
"clients2.google.com",
@MarkDarwin
MarkDarwin / block.js
Created August 22, 2022 15:32 — forked from rtfpessoa/nextdns.js
nextdns.io Block Youtube Ads
const configID = "<CONFIG-ID>";
const ignoreDomainsSet = new Set([
"clients.l.google.com",
"clients1.google.com",
"clients2.google.com",
"clients3.google.com",
"clients4.google.com",
"clients5.google.com",
"clients6.google.com",
@MarkDarwin
MarkDarwin / README.md
Created October 21, 2018 19:56 — forked from ErikFontanel/README.md
Firefly backup and restore scripts

firefly-backup

This script automatically creates a tar.gz archive of the firefly database and copies it to a secure offsite location.

It does NOT save the encryption key. Store that somewhere else securely (e.g. password manager).

I have firefly-backup running via a daily cronjob.

firefly-restore

This restores a .tar.gz backup of the firefly database to a docker volume. The script takes the filename of the backup as an argument and assumes a static location where those files are found.

#Get a list of all VM's with version numbers to see if any need upgrading
#Move to PowerCli scripts folder and initialise
$PowerCliPath = "${env:ProgramFiles(x86)}\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1"
$VIServer = "blah","blah2"
if (Test-Path -Path $PowerCliPath){
Write-Verbose -Message $PowerCliPath
$Installed = $true
}
@MarkDarwin
MarkDarwin / wsus-update.ps1
Created January 19, 2017 17:10 — forked from jacobludriks/wsus-update.ps1
wsus-update
Function WSUSUpdate {
$Criteria = "IsInstalled=0 and Type='Software'"
$Searcher = New-Object -ComObject Microsoft.Update.Searcher
try {
$SearchResult = $Searcher.Search($Criteria).Updates
if ($SearchResult.Count -eq 0) {
Write-Output "There are no applicable updates."
exit
}
else {
@MarkDarwin
MarkDarwin / Add-TestUsers.ps1
Created January 19, 2017 16:43 — forked from tylerapplebaum/Add-TestUsers.ps1
Create test users in Active Directory with realistic data from https://randomuser.me
<#
.SYNOPSIS
Create realistic-looking Active Directory accounts.
Written by Tyler Applebaum.
Version 0.1
Last Updated Nov 19 2016
.LINK
https://gist.github.com/tylerapplebaum/d692d9d2e1335b8b111927c8292c5dac
https://randomuser.me/