Skip to content

Instantly share code, notes, and snippets.

@czers
czers / assert-safe-removal.bash
Created July 6, 2018 18:03
Assert safe removal of files - e.g. make sure that photos from SD card are all copied to your hard disk before deleting them
#!/bin/bash
function get-checksums-with-names {
find $1 -type f -exec basename "{}" \; > $2.names
#find $1 -type f -exec md5sum "{}" \; > $2.fullpaths.md5sum
#cut -c-32 $2.fullpaths.md5sum > $2.just.md5sum
#paste -d '|' $2.just.md5sum $2.names > $2.names.md5sum
}
get-checksums-with-names $1 $2
@czers
czers / azure-streisand-firewall-setup.sh
Last active April 8, 2017 21:03
Configuring Azure firewall for Streisand VPN
#!/bin/sh
# Choose subscription to use like this:
# az account list --output table
# az account set --subscription "Visual Studio Professional with MSDN"
# az account set --subscription "Visual Studio Enterprise with MSDN"
RG_NAME=phalanx
NSG_NAME=phalanx-nsg