This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import glob | |
all_bookmarks = [] | |
md_file = open("bookmarks.md", "w+") # saving in markdown file, if no file exists using '+' creates one | |
files = [file for file in glob.glob("JSONBookmarks/*")] # using glob to read all files from the folder | |
for file_name in files: | |
print(file_name) | |
with open(file_name) as bk: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# vim:set et sw=4: | |
# | |
# certdata2bundle.py | |
# retrieves CA certificates from the Mozilla/NSS root trust store in base64/DER | |
# format and re-encodes them as a concatenated PEM bundle sans metadata | |
# writes all CA certificates to /etc/ssl/cacerts.pem | |
# | |
# Copyright (C) 2019 Kevin M. Gallagher <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the number of pages in the PDF. (On a Mac you can do `pages=$(mdls -raw -name kMDItemNumberOfPages $PDF)`) | |
pages=$(pdftk $PDF dump_data | grep NumberOfPages | awk '{print $2}') | |
# Get the number of 16-page booklets | |
booklets=$(($pages/16)) | |
if [[ $(($pages%16)) -gt 0 ]]; then | |
booklets=$(($booklets+1)) | |
fi | |
# Determine where to split the book for the half-size | |
booksplit=$(($booklets/2)) | |
# Determine at what page to split the book |