This file contains 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
if WinExist("ahk_class VNCviewer") | |
; Remove titlebar: | |
WinSet, Style, -0xC40000, ahk_exe vncviewer.exe | |
; This assumes two 1920x1200 monitors side by side, the leftmost | |
; of which is the primary monitor (so that 0,0 is its top left corner): | |
WinMove, , , 0, 0, 3840, 1200 |
This file contains 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 | |
# ~/.xsession | |
systemctl --user import-environment DISPLAY XAUTHORITY | |
systemctl --user restart xdg-desktop-portal-gtk | |
i3 |
This file contains 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 | |
# This script works, but a nicer version is now available at https://github.com/acarapetis/shroudstone | |
from pathlib import Path | |
from typing import NamedTuple | |
from urllib.request import urlopen | |
from datetime import datetime, timezone, timedelta | |
from time import sleep | |
import json | |
import pandas as pd |
This file contains 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
"""CLI tool to stream CSV (from stdin) to parquet""" | |
import sys | |
from pathlib import Path | |
from typing import TextIO | |
import pandas as pd | |
CHUNKSIZE=2**16 # ~65k rows per parquet chunk | |
def convert(instream: TextIO, outdir: Path, chunksize=CHUNKSIZE): |
This file contains 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
from concurrent.futures import ProcessPoolExecutor, wait, FIRST_COMPLETED | |
from typing import Iterable, Set | |
from time import sleep | |
class Task: | |
_tasks = {} # job registry: see run_job below | |
def __init__(self, fun, name=None, deps=None, **kwargs): | |
self.do_work = fun | |
self.deps = set(deps or []) |
This file contains 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 boto3 | |
from collections import defaultdict | |
ris = boto3.client("ec2").describe_reserved_instances()["ReservedInstances"] | |
ri_counts = defaultdict(lambda: 0) | |
for ri in ris: | |
if ri["State"] == "active": | |
ri_counts[ri["InstanceType"]] += ri["InstanceCount"] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
grammar NotJSON | |
rule document | |
(space value space) { | |
capture(:value).value | |
} | |
end | |
rule value | |
number | str | hash | |
end |
This file contains 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
# This file may be used to create an environment using: | |
# $ conda create --name <env> --file <this file> | |
# platform: linux-64 | |
affine=2.2.2=py_0 | |
alabaster=0.7.12=py_0 | |
amptools=1.1.7=py_0 | |
asn1crypto=0.24.0=py35_3 | |
atomicwrites=1.2.1=py_0 | |
attrs=18.2.0=py_0 | |
autopep8=1.4.3=py_0 |
This file contains 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 | |
# | |
# "Wacom Rotation" can be 0, 1, 2 or 3 where 1 is +90, 2 is -90 and 3 is 180 in degrees | |
# "Wacom ISDv4 E3" id=11 | |
# "Wacom ISDv4 E3" eraser id=12 | |
# "Wacom ISDv4 E3" id=13 | |
# | |
# using device numbers of the stylus (10) or screen (12) is fragile as they can | |
# change however "Wacom ISDv4 E3" is not unique afaict |
NewerOlder