Skip to content

Instantly share code, notes, and snippets.

View laprice's full-sized avatar

Larry Price laprice

View GitHub Profile
@laprice
laprice / how_i_count_the_days
Created April 13, 2016 06:21
This is how I derive the date I will let myself back onto hacker news. After setting noprocrast to a million minutes.
laprice=# select now() + '887835m'::interval;
?column?
-----------------------------
2017-12-18 07:49:14.3668-08
(1 row)
laprice=# select 24 * 60;
?column?
----------
1440
@laprice
laprice / s3_signed_url.py
Created May 2, 2016 20:01
generate signed download link for a specific object in a bucket using a profile using boto3
#!/usr/bin/env python3
import boto3
session = boto3.Session(profile_name='the_profile')
s3 = session.client('s3')
url = s3.generate_presigned_url(
ClientMethod='get_object',
Params={ 'Bucket':'bucket_name', 'Key':'object_name'},
ExpiresIn=604800) # 7 days
@laprice
laprice / realias.py
Last active December 9, 2017 03:17
read ansible inventory and create shell aliases for quick ssh access.
#!/usr/bin/env python
import subprocess
import json
import os
inv = subprocess.getoutput('ansible-inventory --list')
h = json.loads(inv)
hosts = h['_meta']['hostvars']
@laprice
laprice / wapo_letter_to_opinions.md
Last active July 14, 2022 14:54
Text of letter sent to Washington Post regarding "The disgraceful fact check that wasn't."

The disgraceful fact check that wasn't.

As a subscriber to the Post I was extremely dismayed to see this story from Glenn Kessler purporting to be a fact check regarding an incident mentioned by President Biden.

https://www.washingtonpost.com/politics/2022/07/09/one-source-story-about-10-year-old-an-abortion-goes-viral/

Mr. Kessler's article brings up serious questions of journalistic ethics, partisan corruption of the Post's editorial stance and basic moral decency. Since Mr. Kessler was unable to verify the truth of an event that turned out to actually have happened it suggests at a minimum that he is incompetent at the job he has assigned himself; discovering and verifying the facts of the matter he chose to write about. Given the volatile nature of the topic; the implicit partisan thrust of the column cannot be overlooked; and it is disgusting. Framing an opinion as a fact check, as a factual debunking of an incident of tragic sexual abuse is a gross misuse of the platform the Post has chosen to give