Skip to content

Instantly share code, notes, and snippets.

@hellwolf
Last active October 25, 2019 06:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellwolf/19683984d3df156e9a2473513b9f8061 to your computer and use it in GitHub Desktop.
Save hellwolf/19683984d3df156e9a2473513b9f8061 to your computer and use it in GitHub Desktop.
Estonian residents of the same birthday
YOUR_BIRTHDAY=YYMMDD;for a in 3 4;do
for i in `seq 9999`;do
kood=${a}${YOUR_BIRTHDAY}$(printf %04d $i)
# https://www.sk.ee/en/repository/ldap
found=$(ldapsearch -x -H ldaps://esteid.ldap.sk.ee -b c=EE "(serialNumber=PNOEE-$kood)" | sed -n 's/cn::\? \(.*\)$/\1/p' | uniq)
[ -z "${found%%*=}" ] && found=`echo $found|base64 -d`;[ ! -z "$found" ] && echo $kood $found;
done;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment