Skip to content

Instantly share code, notes, and snippets.

View mdzidic's full-sized avatar
:octocat:

Marko Dzidic mdzidic

:octocat:
View GitHub Profile
@mdzidic
mdzidic / multi-mount.sh
Created July 17, 2019 14:17
Mount and decrypt multiple directories at once
#!/bin/bash
DEST="/mnt"
PASS="PassForDecryption"
for i in ./* ; do
if [ -d "$i" ]; then
SRC=$(basename "$i")
echo Mounting $SRC to $DEST/$SRC
sudo mount -t ecryptfs -o key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=no,passwd=$PASS $SRC $DEST/$SRC
@mdzidic
mdzidic / batch-rename.sh
Last active July 17, 2019 14:20
Batch file extension rename based on fidentify output
#!/bin/bash
$fileExtension="eCryptfs"
for f in *.$fileExtension; do
newExtension=$(fidentify $f | awk '{print $2}')
mv -- "$f" "${f%.eCryptfs}.$newExtension"
done

Keybase proof

I hereby claim:

  • I am mdzidic on github.
  • I am mdzidic (https://keybase.io/mdzidic) on keybase.
  • I have a public key ASA5g-RM7NrWPNIlVanX2348svth5jYWdxlq-V5H8qXDzAo

To claim this, I am signing this object: