Skip to content

Instantly share code, notes, and snippets.

@ajorpheus
ajorpheus / pdfexpert_batch_ocr.applescript
Created July 20, 2024 11:30 — forked from nuclearsecrecy/pdfexpert_batch_ocr.applescript
Applescript to batch run OCR on many PDF files using PDF Expert
# Applescript to batch OCR PDFs using PDF Expert.
# By Alex Wellerstein. Last updated June 18, 2024. No copyright asserted -- released for public domain use.
# Absolutely no warranties, guarantees, promises, ANYTHING provided. Use at your own risk.
#
# Will automatically save and close each PDF after OCR completes.
# Assumes PDF Expert is the default program to open PDFs!
# Does not have robust error handling. Held together with duct tape.
# Just a temporary solution until Readdle actually supports batch operations.
# Seems to work on OS 14.3.1, with PDF Expert 3.10.4.
# Has not been extensively tested to see what happens if you try to do other work while it is running; could foul up.
@ajorpheus
ajorpheus / google_redirect_remove.user.js
Last active January 21, 2024 09:44 — forked from PolarBearGG/google_redirect_remove.js
Userscript to remove URL redirection from google sites
// ==UserScript==
// @name Google Redirect Remove
// @id google_redirect_remove
// @namespace scripts.zachbrowne.com
// @description Remove URL redirection from google sites
// @license GPL v3
// @include *://www.google.*/*q=*
// @include *://www.google.*/*tbs=*
// @include *://www.google.*/search?*
// @include *://www.google.*/webhp?*
@ajorpheus
ajorpheus / shell-setup.ps1
Created June 20, 2023 07:59 — forked from mikepruett3/shell-setup.ps1
Packages to install via scoop, winget, choco, and other tools...
<#
.SYNOPSIS
Script to Initialize my custom powershell setup.
.DESCRIPTION
Script uses scoop
.NOTES
**NOTE** Will configure the Execution Policy for the "CurrentUser" to Unrestricted.
Author: Mike Pruett
Date: October 18th, 2018
@ajorpheus
ajorpheus / query-sparsebundle-band-size.sh
Created May 17, 2023 11:02 — forked from sansumbrella/query-sparsebundle-band-size.sh
Query band size of a sparsebundle (also accessible in Info.plist of bundle)
# find out how big the sparse-band-size is in a mounted volume
hdiutil info -verbose | grep band-size
# default Time Machine sparsbundle virtual-band-size = 16384 (8MB)
# create-sparsebundle's virtual-band-size = 262144 (128MB)
@ajorpheus
ajorpheus / cwl_insights_parse_regex.sh
Created February 22, 2023 17:34 — forked from vatshat/cwl_insights_parse_regex.sh
An example of how to use regex in the parse statement of a CloudWatch Insights query
#!/usr/bin/env bash
query_string=$(cat << EndOfMessage
fields @timestamp, @logStream, headers.X-Amzn-Trace-Id, @transId, @message
| parse @message /(transactionId:[ ]?)(?<@transId>[a-zA-Z0-9]+)/
| filter @transId = a4c475516be5445a87fbb81bb7a4b365
EndOfMessage
) \
&& \
query_id=`aws logs start-query --log-group-name /aws/lambda/console_log \
@ajorpheus
ajorpheus / encrypt.txt
Created February 10, 2023 15:34 — forked from phrfpeixoto/encrypt.txt
Using SSH public key to encrypt a file or string
# Recently I had to send a password to someone over Skype. Since that's obviously not a good idea, I asked for
# the person's public SSH RSA key, and used it to encrypt the password itself.
# Convert the public key into PEM format
ssh-keygen -f path/to/id_rsa.pub -e -m pem > ~/id_rsa.pub.pem
# Using the public pem file to encrypt a string
echo "sometext" | openssl rsautl -encrypt -pubin -inkey ~/id_rsa.pub.pem > ~/encrypted.txt
@ajorpheus
ajorpheus / 1-setup.md
Created February 1, 2023 11:02 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS

Methods of Signing with a GPG Key on MacOS

Last updated September 21, 2022

This Gist explains how to do this using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

There has been a number of comments on this gist regarding some issues around the pinentry-program and M1 Macs. I've finally gotten a chance to try things out on an M1 and I've updated the documentation in 2-using-gpg.md to reflect my findings.

@ajorpheus
ajorpheus / aws_env
Created January 12, 2023 13:40 — forked from mjul/aws_env
Get environment variables from AWS profile (for use with docker-machine)
#!/bin/sh
# Set the AWS environment variables for an AWS profile
# Useful for docker-machine
#
# Example:
#
# aws_env profile-for-testing
#
# Further information:
# See the AWS CLI `aws configure`
@ajorpheus
ajorpheus / generateAwsCredsFile.js
Created January 11, 2023 22:47 — forked from bennyrw/generateAwsCredsFile.js
Generate AWS credentials file content from SSO
//
// Intended to be used as a bookmarklet that is executed when on the AWS Single Sign-On landing page,
// this script scans the named SSO application and its accounts (specified below) and generates the
// ~/.aws/credentials content and copies it to the clipboard ready to be used.
//
// the SSO application to use
const APPLICATION_TITLE = "AWS Account";
// specify the names of the accounts to include (case sensitive). Any that are not found will be ignored.
@ajorpheus
ajorpheus / ip-check.sh
Created December 22, 2022 17:25 — forked from FullStackIndie/ip-check.sh
Updated Ip-Check
#!/bin/bash
#Variable Declaration - Change These
HOSTED_ZONE_ID="Z0244******"
#test/dummy subdomain to see if my IP has changed
NAME="dynamic-dns.*********.net."
#My websites that need there IP address updated
CRITTER="development.*********.net."
IDENTITY="development.*********.net."
GATEWAY="development.*********.net."