Skip to content

Instantly share code, notes, and snippets.

View arnaudbos's full-sized avatar
😶‍🌫️

Arnaud Bos arnaudbos

😶‍🌫️
View GitHub Profile
@arnaudbos
arnaudbos / aes_string.py
Last active December 22, 2015 00:38
AES Encrypt/Decrypt string
from Crypto.Cipher import AES
import base64
import hashlib
import os
# the block size for the cipher object; must be 16, 24, or 32 for AES
BLOCK_SIZE = 32
# the character used for padding--with a block cipher such as AES, the value
# you encrypt must be a multiple of BLOCK_SIZE in length. This character is
@arnaudbos
arnaudbos / compress_pdf.md
Created February 11, 2022 10:05 — forked from ahmed-musallam/compress_pdf.md
How to compress PDF with ghostscript

How to compress PDF using ghostscript

As a developer, it bothers me when someone sends me a large pdf file compared to the number of pages. Recently, I recieved a 12MB scanned document for just one letter-sized page... so I got to googlin, like I usually do, and found ghostscript!

to learn more abot ghostscript (gs): https://www.ghostscript.com/

What we are interested in, is the gs command line tool, which provides many options for manipulating PDF, but we are interested in compressign those large PDF's into small yet legible documents.

credit goes to this answer on askubuntu forum: https://askubuntu.com/questions/3382/reduce-filesize-of-a-scanned-pdf/3387#3387?newreg=bceddef8bc334e5b88bbfd17a6e7c4f9