Skip to content

Instantly share code, notes, and snippets.

@mpalet
mpalet / bw_export_kp.py
Last active Mar 31, 2020 — forked from mohamedadaly/bw_export_kp.py
Export Bitwarden to KeePass 2 XML format
View bw_export_kp.py
#!python
"""
Exports a Bitwarden database into a KeePass file (kdbx) including file attachments, custom fields and folder structure.
It can also export an unencrypted XML KeePass file conforming to KeePass 2 XML format.
It requires keepassxc-cli, if not available it can still export KeePass 2 XML
- https://github.com/keepassxreboot/keepassxc
Usage: bw_export_kp.py [-h] [-x] [-d] [-bw-password None] [-kee-password None]
View gist:fb31428df4f59616d0ea20f0e18bbbc4

Removes UTF-8 NFD diacritics (osx) in path recursively replacing them for the simple ascii transliteration. Eg: À > A

find . -print | ggrep -P "[\x{00FF}-\x{FFFF}]" | while read f; do
  newfile="$(echo $f | sed -e 's/À/A/g;s/Á/A/g;s/Ä/A/g;s/à/a/g;s/á/a/g;s/ä/a/g;s/È/E/g;s/É/E/g;s/Ë/E/g;s/è/e/g;s/é/e/g;s/ë/e/g;s/Ì/I/g;s/Í/I/g;s/Ï/I/g;s/ì/i/g;s/í/i/g;s/ï/i/g;s/Ò/O/g;s/Ö/O/g;s/Ó/O/g;s/ò/o/g;s/ó/o/g;s/ö/o/g;s/Ù/U/g;s/Ú/U/g;s/Ü/U/g;s/ù/u/g;s/ú/u/g;s/ü/u/g' | iconv -f utf-8-mac -t ascii//TRANSLIT)"
  mv -v "$f" "$newfile"
done

Removes normalized UTF-8 diacritics (unix) in path recursively replacing them for the simple ascii transliteration. Eg: À > A

You can’t perform that action at this time.