Skip to content

Instantly share code, notes, and snippets.

@tsuchm
Created December 10, 2019 00:18
Show Gist options
  • Save tsuchm/af7d9a237efe7d266b7aec8af6348646 to your computer and use it in GitHub Desktop.
Save tsuchm/af7d9a237efe7d266b7aec8af6348646 to your computer and use it in GitHub Desktop.
ldapsearch with Base64 decode
#!/bin/sh
/usr/bin/ldapsearch -o ldif-wrap=no "$@" | perl -MMIME::Base64 -Mutf8 -pe 's/^([-a-zA-Z0-9;]+):(:\s+)(\S+)$/$1.$2.&decode_base64($3)/e'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment