Skip to content

Instantly share code, notes, and snippets.

View Callumpy's full-sized avatar

Callum Parkinson Callumpy

View GitHub Profile
@Callumpy
Callumpy / csv-count.ps1
Created June 21, 2022 10:43
Get a count of CSV files in a folder structure and count how many rows of data in each CSV
cd $PSScriptRoot
$rootFolder = 'C:\DefaultRoot\'
$files = Get-ChildItem -Path ($rootFolder + "*.csv") -Recurse
$output = foreach ($file in $files) {
try {
[int]$LinesInFile = 0
$reader = New-Object IO.StreamReader ($file.DirectoryName + "\" + $file.Name)
@Callumpy
Callumpy / dynamic_ipv6_update.sh
Last active March 12, 2019 00:07
Dynamic IPv6 Firewall Update Script for OpenWRT
#!/bin/sh
# CONFIGURABLE PARAMETER: PREFIX
# Set the prefix to the name of the rules that need to be updated. (Can update multiple rules with same name)
PREFIX=Web-ServerIPv6
PREFIX_LEN=${#PREFIX}
# CONFIGURABLE PARAMETER: getIP
# Set your method of getting IPv6 address in here
# Current method is through ip neighbor with MAC address (Lowercase, :)(getIP=$(ip neighbor | grep "Your MAC Here" | grep -v "STALE" | cut -d" " -f1))