Skip to content

Instantly share code, notes, and snippets.

View laprice's full-sized avatar

Larry Price laprice

View GitHub Profile
@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

@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 / 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 / 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
for chunk in $( find . -type f -name "*.txt" ); do wc $chunk;echo $chunk; echo "---";done
6 26 205 ./assets/dramatis.txt
./assets/dramatis.txt
---
93 893 5108 ./assets/nerve_slaves_of_the_sky_lords.txt
./assets/nerve_slaves_of_the_sky_lords.txt
---
91 828 4901 ./chapters/chapter_1.txt
./chapters/chapter_1.txt
---
@laprice
laprice / exclusive_subscription.md
Last active August 29, 2015 14:17
Ethereum DApp Spec.

#summary: A contract to sell a regular update of a small (max 8kb) piece of information for n periods to an audience of at most m subscribers.

#requirements:

  • The publisher must deliver the updates to receive payment.
  • The information must be encrypted in transit.
  • It must not be possible for a non-subscriber to access the information.
  • Contracts must be transferable after creation.
  • Subscribers must be able to transfer their interest in the update stream; an act which must prevent the seller from accessing the updates once the contract has been sold.
  • All of the subscribers must be able to access their updates simultaneously.
@laprice
laprice / gist:e9be53d0263a398e4cf1
Created January 6, 2015 19:52
block ips not in north-america from connecting to port 25 ( blunt-instrument )
# Generated by iptables-save
*filter
:INPUT ACCEPT [5452:537465]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [6729:868771]
-A INPUT -s 202.0.0.0/8 -p tcp -m tcp --dport 25 -j DROP
-A INPUT -s 0.0.0.0/4 -p tcp -m tcp --dport 25 -j DROP
-A INPUT -s 16.0.0.0/6 -p tcp -m tcp --dport 25 -j DROP
-A INPUT -s 20.0.0.0/7 -p tcp -m tcp --dport 25 -j DROP
-A INPUT -s 22.0.0.0/8 -p tcp -m tcp --dport 25 -j DROP
alter table test add column tsv tsvector;
update test set tsv = to_tsvector('english',tune::text);
create index test_tsv_ts_idx on test using gin(tsv);
-- note that this is a full text index on the full json object not a selection of keys.
package main
import (
_ "github.com/lib/pq"
"database/sql"
)
import "os"
import "log"
gistup