Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Takes Let's Encrypt SSL certificates and generates a script to paste in to your NetApp CLI to automatically install the certificate.
# Paths assume you use acme.sh, adjust variables at top of file as needed.
VSERVER="NTPCLST02"
CERT_CN="ntpclst02.ttl.one"
CERT_CER="/root/.acme.sh/$CERT_CN/$CERT_CN.cer"
CERT_KEY="/root/.acme.sh/$CERT_CN/$CERT_CN.key"
CERT_INTCA="/root/.acme.sh/$CERT_CN/ca.cer"
CERT_ROOTCA=""
CERT_CA_CN=`cat $CERT_CER | openssl x509 -noout -text | grep "Issuer: " | awk -F'CN=' '{print $2}'`
@danielewood
danielewood / Movie-AutoCleanup.ps1
Last active April 25, 2017 04:45
Movie-AutoTorrent Scripts
$CompleteDir = "D:\Movies\"
$Files = Get-ChildItem $CompleteDir -Recurse | where {!$_.psiscontainer}
$Files | Where Length -LT 400000000 | Where Extension -ne ".srt" | Remove-Item -Verbose -Force
$CompleteDir = "D:\Movies\!New Releases"
get-childitem $CompleteDir -Recurse | ForEach-Object { Move-Item -LiteralPath $_.FullName $_.FullName.Replace("[",".(") -Force}
get-childitem $CompleteDir -Recurse | ForEach-Object { Move-Item -LiteralPath $_.FullName $_.FullName.Replace("]",").") -Force}
get-childitem $CompleteDir -Recurse | ForEach-Object { Move-Item -LiteralPath $_.FullName $_.FullName.Replace("..",".") -Force}
@danielewood
danielewood / PowershellAes.ps1
Created April 18, 2017 18:30 — forked from ctigeek/PowershellAes.ps1
Aes Encryption using powershell.
function Create-AesManagedObject($key, $IV) {
$aesManaged = New-Object "System.Security.Cryptography.AesManaged"
$aesManaged.Mode = [System.Security.Cryptography.CipherMode]::CBC
$aesManaged.Padding = [System.Security.Cryptography.PaddingMode]::Zeros
$aesManaged.BlockSize = 128
$aesManaged.KeySize = 256
if ($IV) {
if ($IV.getType().Name -eq "String") {
$aesManaged.IV = [System.Convert]::FromBase64String($IV)
}
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices>
<PersistAllDeviceInstalls>false</PersistAllDeviceInstalls>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">