Skip to content

Instantly share code, notes, and snippets.

@a4099181
a4099181 / Send-ChangedDynamicIP.ps1
Last active November 27, 2022 17:18
Retrieves the current IP address. Stores the current IP address in the Windows registry to track changes. Notifies you of changes via email. Generates a link to wake up the computer via the Internet (wake on Lan, wake on WAN). Requires the creation of an registry key: 'HKCU\Software\seb!\Send-ChangedDynamicIP' with a property named 'Known'. Crea…
@{
RegistryKey = `
Get-ItemProperty -Path HKCU:\Software\seb!\Send-ChangedDynamicIP;
Current= `
( Invoke-WebRequest -Uri https://api.ipify.org?format=json -UseBasicParsing ).Content `
| ConvertFrom-Json `
| Select-Object -ExpandProperty ip;
Mac = `
Get-WmiObject win32_networkadapterconfiguration `
| Where-Object DefaultIPGateway `
@a4099181
a4099181 / dirstat.ps1
Created August 5, 2019 09:36
Powershell script to calculate directory size. Lists all directories in a current directory. Calculates and prints a size for each of them (dirstat, folder statistics).
Get-ChildItem -Directory |
Select-Object `
@{ N="Directory"; E={ $_.Name } }, `
@{ N="Size"; E={ (Get-ChildItem -Recurse -File -Path $_.FullName | Measure-Object -Property Length -Sum).Sum } } |
Sort-Object -Property Size -Descending
@a4099181
a4099181 / Dockerfile
Created November 7, 2020 07:54
OpenSSL Dockerfile
FROM alpine
VOLUME [ "/demoCA" ]
RUN apk update && \
apk add --no-cache openssl git perl && \
rm -rf /var/cache/apk/*
RUN ln -s /etc/ssl/misc/CA.pl /usr/bin/ca