Skip to content

Instantly share code, notes, and snippets.

@Tras2
Tras2 / cloudflare-ddns-update.sh
Last active November 20, 2024 03:38
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record
@Tras2
Tras2 / keybase.md
Created December 20, 2017 13:49
Keybase.io proof

Keybase proof

I hereby claim:

  • I am tras2 on github.
  • I am tras2 (https://keybase.io/tras2) on keybase.
  • I have a public key whose fingerprint is BCEB 201F 1CAD B2EE BEB3 A8C6 2F21 9429 866F 21D4

To claim this, I am signing this object:

@Tras2
Tras2 / ParsePwnedPasswordFile.ps1
Created August 15, 2017 15:09
A PowerShell script which goes through the a Pwned Password list (available from https://haveibeenpwned.com/Passwords) and produces multiple smaller 'partition' files which contain the SHA-1 passwords specific to that partition
# A PowerShell script which goes through the a Pwned Password list (available from https://haveibeenpwned.com/Passwords)
# and produces multiple smaller 'partition' files which contain the SHA-1 passwords specific to that partition
Param (
# The filename of the Pwned password source file
[Parameter(Mandatory=$true)]
[ValidateScript({Test-Path -Path $_})]
$InputFilename,
# Output directory is where the output partition .txt files will end up here
[Parameter(Mandatory=$true)]
@Tras2
Tras2 / Set-WmiNamespaceSecurity.ps1
Created June 29, 2017 13:11
This is a modified version of a script which can be used to set the WMI permissions for both Agent-less User-ID and WMI Probing. It is designed to be run from a PowerShell prompt and can be used to set the local WMI settings, or the settings of a remote computer.
# Copyright (c) Microsoft Corporation. All rights reserved.
# For personal use only. Provided AS IS and WITH ALL FAULTS.
# Set-WmiNamespaceSecurity.ps1
# Example: Set-WmiNamespaceSecurity root/cimv2 add steve Enable,RemoteAccess
# Taken from https://live.paloaltonetworks.com/t5/Management-Articles/PowerShell-Script-for-setting-WMI-Permissions-for-User-ID/ta-p/53646
# Modified by Stuart Clarkson (https://github.com/Tras2)
Param (
# Demo code used in blog post https://stuart-clarkson.blogspot.co.uk/2017/01/getting-qualys-asset-scan-information.html
# Created by Stuart Clarkson (17 January 2017)
# This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
# https://creativecommons.org/licenses/by-sa/4.0/
# Uses the Qualys API v2
# https://www.qualys.com/docs/qualys-api-v2-user-guide.pdf
# Set your Qualys username & password here