Skip to content

Instantly share code, notes, and snippets.

@elementalvoid
elementalvoid / p0wned.zsh
Created September 30, 2018 19:31
p0wned? zsh shell func to check against api.pwnedpasswords.com for your password.
# Uses the range check to avoid sending your actual password and then checks the returned list locally.
p0wned () {
read -s 'pass?Enter password: '
echo
sum=$(echo -n "$pass" | sha1sum | cut -c1-40)
short=$(echo -n $sum | cut -c1-5)
remain=$(echo -n $sum | cut -c6-40)
curl -s https://api.pwnedpasswords.com/range/${short} | grep -i ${remain}
}
@elementalvoid
elementalvoid / get-sony-alpha55-gps.sh
Created October 14, 2018 23:29
get-sony-alpha55-gps.sh
#!/bin/bash
wget -O assistme.dat http://control.d-imaging.sony.co.jp/GPS/assistme.dat
wget -O assistme.md5 http://control.d-imaging.sony.co.jp/GPS/assistme.md5
checksum=$(md5sum assistme.dat | awk '{print $1}')
sony_checksum=$(cat assistme.md5 | awk '{print $1}')
if [[ ${checksum} == ${sony_checksum} ]]; then
echo "Okay: Checksums match."
echo "Place files in: <sdcard>/PRIVATE/SONY/GPS/
else
echo "Warning: Checksums do not match!"