Skip to content

Instantly share code, notes, and snippets.

View diego021's full-sized avatar

Diego Arias diego021

View GitHub Profile
@diego021
diego021 / secure_my_pdf.sh
Last active April 9, 2019 04:58
Add/update metadata to an existing PDF file and encrypt it with random password.
#!/bin/bash
#
# Add/update metadata to an existing PDF file.
# Encrypt it with random password.
#
CREATOR="Diego Arias"
TITLE="Document title"
PRODUCER="GNU/Linux PDF"
KEYWORDS="keyword1, keyword2"
SUBJECT="Document subject"
@diego021
diego021 / create_luks_drive.sh
Created April 9, 2019 03:54
Create an encrypted (secure) partition for your flash drive.
#!/bin/bash
#
# Create an encrypted (secure) partition for your flash drive.
#
ROOT_UID=0
SUCCESS=0
FAIL=1
E_NOTROOT=87
E_MOUNTED=86
E_FORMAT=85
@diego021
diego021 / deduplicate.py
Last active May 27, 2024 21:10
Deduplicate files recursively on a given directory.
#!/usr/bin/env python3
"""Scan recursively a given directory and find duplicates files within it.
You can use this module as is by invoking it from the command shell:
~$ python3 deduplicate.py /path/to/scan
"""
import dataclasses
import hashlib