Skip to content

Instantly share code, notes, and snippets.

View prenagha's full-sized avatar

Padraic Renaghan prenagha

View GitHub Profile
@prenagha
prenagha / feed.xml
Last active October 4, 2022 15:51
NY Times book feedbin full content error
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:nyt="http://www.nytimes.com/namespaces/rss/2.0" version="2.0">
<channel>
<title>NYT &gt; Books</title>
<link>https://www.nytimes.com/section/books</link>
<atom:link href="https://rss.nytimes.com/services/xml/rss/nyt/Books.xml" rel="self" type="application/rss+xml"/>
<description/>
<language>en-us</language>
<copyright>Copyright 2022 The New York Times Company</copyright>
<lastBuildDate>Tue, 04 Oct 2022 15:40:16 +0000</lastBuildDate>
This file has been truncated, but you can view the full file.
Date/Time: 2021-09-10 14:50:15.467 -0400
End time: 2021-09-10 15:48:19.923 -0400
OS Version: macOS 11.5.2 (Build 20G95)
Architecture: x86_64h
Report Version: 32
Share With Devs: Yes
Data Source: Stackshots
Shared Cache: 0C9EB0DE-F5CE-3AFC-8F08-0C6DB1E7FC44 slid base address 0x7fff20035000, slide 0x35000
@prenagha
prenagha / jamf.md
Created June 16, 2020 01:23 — forked from a7ul/jamf.md
removing all restrictions on jamf managed macos device - Provided you have root access.

REMOVE JAMF RESTRICTIONS ON MAC

REMOVE ONLY RESTRICTIONS

sudo jamf removeMDMProfile removes all restrictions

sudo jamf manage brings back all restrictions and profiles

REMOVE ALL RESTRICTIONS AND DISABLE JAMF BINARIES WHILE KEEPING YOUR ACCESS TO VPN AND OTHER SERVICES

sudo jamf removeMDMProfile removes all restrictions

@prenagha
prenagha / raindrop-add.sh
Created March 2, 2020 02:45
Add Link to Raindrop
#!/usr/local/bin/bash
URL="$1"
if [ -f "${URL}" ]
then
URL=`cat ${URL}`
fi
/usr/bin/curl --fail --silent \
--data "{ \"link\": \"${URL}\", \"collection\": { \"\$ref\":\"collections\", \"\$id\": 111 }}" \
@prenagha
prenagha / eagle-filer-bookmark-export.applescript
Created January 24, 2020 00:52
Eagle Filer export to Bookmark HTML file
#
# Export items from Eagle Filer into standard Netscape bookmark HTML format
# Suitable for importing into other services like Raindrop
# Select all records in Eagle Filer then run this script
#
set _filename to choose file name with prompt "Export Bookmarks" default name "eagle-bookmarks.html"
tell application "EagleFiler"
set _records to selected records of browser window 1
set _file to open for access _filename with write permission
set _lf to ASCII character 10
@prenagha
prenagha / RedirectCanonical.js
Created September 2, 2019 15:45
Lambda@Edge to redirect from non-canonical (example.net) to canonical (example.com)
'use strict';
/**
* Deploy this Lambda@Edge, in Origin Request event,
* to a CloudFront distribution that hosts the
* NON-Canonical domains. It will redirect everything
* to the canonical version of the URL.
* And let CloudFront and browsers cache the redirect.
*/
exports.handler = (event, context, callback) => {
@prenagha
prenagha / DefaultIndexHTML.js
Created September 2, 2019 15:44
Lambda@Edge to redirect to default HTML page
'use strict';
const path = require('path');
/**
* Redirects URI to default document.
* Any URI without an extension is assumed to be
* a directory reference and will have '/index.html'
* appended to the URI.
* Useful as Lambda@Edge on CloudFront Origin Request event
@prenagha
prenagha / LogRetainManager.py
Last active October 31, 2018 16:48
Lambda CloudWatch Log Retention Manager
import boto3
import os
def lambda_handler(event, context):
default_region = os.environ.get('AWS_REGION', 'us-east-1')
retain_days = int(os.environ.get('RETAIN_DAYS', '30'))
session = boto3.Session()
client = session.client('ec2', region_name=default_region)
@prenagha
prenagha / log-retain-manager-policy.json
Last active June 18, 2023 12:44
Set the retention days on any AWS CloudWatch log group that isn't set yet
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "SetLogRetain",
"Effect": "Allow",
"Action": [
"logs:DescribeLogGroups",
"ec2:DescribeRegions",
"logs:PutRetentionPolicy"
@prenagha
prenagha / DebugEvent.js
Created October 16, 2018 22:27
Lambda@Edge CloudFront Debugging Sample Records
'use strict';
/**
* Lambda@Edge to log CloudFront event and context.
* Note: this runs in Lambda@Edge which means it runs in a variety
* of regions, the region closest to the browser making the request.
* So be sure and check other regions if you don't see the logs in
* CloudWatch in the region you normally use.
*
* https://medium.com/@jbesw/postcards-from-lambda-the-edge-11a43f215dc1