sudo apt-get build-dep freerdp2-shadow-x11
sudo apt-get install ninja-build
sudo apt install libpam0g-dev # might be unnecessary?
git clone https://github.com/FreeRDP/FreeRDP/
cd FreeRDP/
cmake -GNinja -DWITH_SERVER=ON
cmake --build .
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# jnm 20210526 | |
set -e | |
test -e kpi && test -e kobo-install || ( | |
echo 'This script must be run from the directory where `kpi` and `kobo-install` reside.' | |
exit 1 | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# there's probably some way to teach postgres to do this itself | |
import datetime | |
# convenience scribbles | |
dd = [x - datetime.timedelta(days=1) for x in [datetime.date(2021, y, 1) for y in [4,5,6,7,8,9]]] | |
def print_quick(*args): | |
print(*args, end='', flush=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- assumptions (many!) | |
-- you have a table called "nodestore_node" | |
-- you know how many rows it has and will stop this function manually | |
-- when its offset grows too large | |
-- the "id" column is a varchar | |
-- the "data" column is TOASTed | |
-- some of the TOAST storage is corrupt(!) | |
-- length(data) fails, revealing the corruption | |
-- you don't care about "data" and are happy to TRUNCATE any corrupted values | |
-- no one else is using the database (there is NO LOCKING) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import csv | |
import signal | |
import sys | |
from collections import Counter, defaultdict | |
TOP_URLS = 25 | |
TIMESTAMP_GRANULARITY_MINUTES = 10 | |
TIMESTAMP_FIELD_INDEX = 1 | |
URL_FIELD_INDEX = 13 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
headers = {'Authorization': 'token <ahem>', 'Accept': ' application/vnd.github.inertia-preview+json'} | |
# e.g. from https://api.github.com/repos/jnm/cuddly-doodle/projects | |
get_url = 'https://api.github.com/projects/columns/2942196/cards' | |
# e.g. from https://api.github.com/orgs/kobotoolbox/projects | |
post_url = 'https://api.github.com/projects/columns/2942356/cards' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="tumblr-post" data-href="https://embed.tumblr.com/embed/post/1GjIG-_i_PMG0qAkoklkwQ/161507154717" data-did="2bd38ed99a4c97a215bb75c2085abf410fffcbbc"><a href="http://nancy-elsner-archive.tumblr.com/post/161507154717/a-gay-icon-batmanissue455oct1990">http://nancy-elsner-archive.tumblr.com/post/161507154717/a-gay-icon-batmanissue455oct1990</a></div> <script async src="https://assets.tumblr.com/post.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// mapReduce idea credit: http://stackoverflow.com/a/2308036 | |
db.instances.mapReduce( | |
function() { | |
// map | |
for(var key in this) { | |
emit(key, null); | |
} | |
}, | |
function(key, values) { | |
// reduce |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import sys | |
import xml | |
import hashlib | |
import getpass | |
import datetime | |
from collections import OrderedDict | |
from django.conf import settings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head><title>download test</title></head> | |
<body> | |
<input type="text" id="status" style="width: 100%"> | |
<div id="log"></div> | |
<script> | |
/* | |
mostly cookbooked from | |
https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Monitoring_progress |
NewerOlder