Skip to content

Instantly share code, notes, and snippets.

View mitcdh's full-sized avatar

Mitchell Hewes mitcdh

View GitHub Profile
@mitcdh
mitcdh / Set Name to kMDItemTitle.applescript
Last active April 3, 2017 00:42
Devonthink script to set the name of any selected records to their kMDItemTitle metadata property
tell application id "DNtp"
try
set this_selection to the selection
set this_count to count of this_selection
if this_count > 0 then
show progress indicator "Renaming" steps this_count
repeat with this_item in this_selection
set this_metadata to meta data of this_item
try
set this_title to |kMDItemTitle| of this_metadata
@mitcdh
mitcdh / gist:e2af3f537a9c82df76bf5bfad7c12977
Last active June 6, 2017 01:33
Bash function to generate Junos address book entries
# e.g. host2j google.com [..] TRUST
# e.g. jhostset google.com [..] google-servers TRUST
function host2j()
{
ZONENAME="${@: -1}"
for HOSTNAME in "$@"
do
if [ "$HOSTNAME" != "$ZONENAME" ]
then
@mitcdh
mitcdh / gist:d5b8591717abde3fe7e59e340f64af1f
Last active September 19, 2016 00:39
Route53 Automated DNS Service Inline Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"route53:GetChange",
"route53:ListHostedZones",
"route53:ListHostedZonesByName",
"route53:GetHostedZoneCount"