Skip to content

Instantly share code, notes, and snippets.

View shawnhank's full-sized avatar

Shawn Hank shawnhank

View GitHub Profile
(*
The Hit List Mail Import
Copyright © 2012 Potion Factory LLC.
Licensed under a Creative Commons Attribution 3.0 License: http://creativecommons.org/licenses/by/3.0/
To customize this script, copy it first to:
@shawnhank
shawnhank / gist:db0603d2ad6b2ff8f96f4aa783388fbd
Created April 14, 2023 20:13 — forked from BrettBukowski/gist:5347463
Filter emails in Mail.app with regular expressions
-- Mail.app can't run a "Contains" filter with a regex,
-- so you can't filter on HTML content. Until now.
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
try
repeat with theMessage in theMessages
-- Getting the content as string converts all HTML tags to '?' and just leaves text content
set theBody to quoted form of (theMessage's content as string)
-- It's awkwardly hard to get sed to work w/ mult. lines, so collapse newlines
set theCommandString to "echo " & theBody & " | tr '\\n' ' ' | sed \"s/brett Author/*MATCHED*(&)/\"" as string
@shawnhank
shawnhank / Mail - Update Rule.applescript
Created April 14, 2023 20:11 — forked from logic2design/Mail - Update Rule.applescript
This will add either the Sender's email address or the Sender's Domain to a Mail rule.
#################################################################################
# Title: Mail - Update Rule
#################################################################################
#Iain Dunn
#Logic2design.com
#[email protected]
# Contributors, inspration and sources
# https://leancrew.com/all-this/2021/06/hey-i-sped-up-apple-mail-rules/
@shawnhank
shawnhank / mail-to-day-one.applescript
Created April 14, 2023 20:11 — forked from poritsky/mail-to-day-one.applescript
Create Day One Entry From Selected Message in Apple Mail (Requires Day One CLI)
(*
Apple Mail to Markdown Formatted Day One Entry
!!! IMPORTANT !!!
Requires the Day One Command Line Interface. Download and install from here:
http://dayoneapp.com/tools/
Adapted from 'Apple Mail -- Text File Exporter w/ Basic Header Info' by Justin Lancy:
http://veritrope.com/code/apple-mail-export-to-text-file-w-basic-header-info
@shawnhank
shawnhank / txt_to_reminders.applescript
Created April 8, 2023 17:44 — forked from n8henrie/txt_to_reminders.applescript
Demonstration of using AppleScript with Reminders.app
--taken from http://benguild.com/2012/04/11/how-to-import-tasks-to-do-items-into-ios-reminders/#comment-1346894559
--set theFileContents to (read file "Users:n8henrie:Desktop:Reminders.txt") -- Change this to the path to your downloaded text file with your tasks in it! (Note the : instead of a / between folders) Or, just name them Reminders.txt and put them in your downloads folder
--set theLines to paragraphs of theFileContents
set theLines to {"task name 1", "task name 2"}
repeat with eachLine in theLines
tell application "Reminders"
set mylist to list "Your List Name"
tell mylist
make new reminder at end with properties {name:eachLine, due date:date "7/10/2014 3:00 PM"}
@shawnhank
shawnhank / add_cloudflare_ips.sh
Created February 1, 2023 10:01 — forked from dduvnjak/add_cloudflare_ips.sh
Add CloudFlare IP addresses to an EC2 Security Group using awscli
# first we download the list of IP ranges from CloudFlare
wget https://www.cloudflare.com/ips-v4
# set the security group ID
SG_ID="sg-00000000000000"
# iterate over the IP ranges in the downloaded file
# and allow access to ports 80 and 443
while read p
do
@shawnhank
shawnhank / letsencrypt-acme-guide.md
Created February 1, 2023 03:35 — forked from ammgws/letsencrypt-acme-guide.md
Using acme.sh script to renew LetsEncrypt certs using non-standard SSL port

1. Install acme.sh shell script

git clone https://github.com/Neilpang/acme.sh.git
cd acme.sh
./acme.sh --install

Optionally, set the home dir and/or account info (if already have one).
If was previously using LetsEncrypt's certbot, can probably get account info from /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/*/regr.json.

@shawnhank
shawnhank / riot-matrix-workshop.md
Created December 13, 2022 05:00 — forked from attacus/riot-matrix-workshop.md
Create your own encrypted chat server with Riot and Matrix

This guide is unmaintained and was created for a specific workshop in 2017. It remains as a legacy reference. Use at your own risk.

Running your own encrypted chat service with Matrix and Riot

Workshop Instructor:

This workshop is distributed under a CC BY-SA 4.0 license.

What are we doing here?

@shawnhank
shawnhank / com.apple.SetupAssistant.managed.plist
Created November 21, 2022 17:28 — forked from aarondavidpolley/com.apple.SetupAssistant.managed.plist
Skip All macOS Setup Assistant Items for new user login: Plist to upload into Jamf Pro Application & Custom Settings Profile Payload
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SkipAppearance</key>
<true/>
<key>SkipCloudSetup</key>
<true/>
<key>SkipPrivacySetup</key>
<true/>