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
import multiprocessing | |
from subprocess import run, PIPE | |
import os | |
import gc | |
def worker(x): | |
return x * x | |
def n_files_open(): | |
return len(files_open()) |
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
// ==UserScript== | |
// @name Avoid Slack Redirect | |
// @namespace slackrediravoid | |
// @include https://*.slack.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
let si = window.setInterval(clearanchors, 2000); | |
function clearanchors(){ | |
let anchors = document.querySelectorAll('a[href^="https://slack-redir"]'); |
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
import boto3 | |
import io | |
import csv | |
from functools import partial | |
s3c = boto3.client('s3') | |
def logging_read(read, amt): | |
print('READ {}'.format(amt)) | |
return read(amt) |
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
param( | |
[parameter(mandatory=$true)] | |
[string]$infile, | |
[parameter(mandatory=$true)] | |
[string]$outfile | |
) | |
# https://msdn.microsoft.com/en-us/vba/excel-vba/articles/workbook-saveas-method-excel |
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
import win32serviceutil | |
class StopStartService: | |
STARTED, STOPPED = 4, 1 | |
def __init__(self, service_name, timeout=5): | |
self.service_name = service_name | |
self.timeout = timeout | |
def __enter__(self): |
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
def mystery_fun(sess : requests.Session): | |
pass | |
sess_arg = inspect.signature(mystery_fun).parameters['sess'] | |
inspect.getmembers(sess_arg.annotation, inspect.isfunction) |
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
# WARNING: this doesn't work properly | |
import asyncio | |
import ssl | |
import socket | |
# included logging to try to figure out why this wasn't working... | |
import logging | |
logging.basicConfig() | |
logging.getLogger('asyncio').setLevel(logging.DEBUG) |
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.6 | |
import re | |
from subprocess import run, PIPE | |
from pathlib import Path | |
import requests | |
import zipfile | |
import io | |
import pickle | |
import urllib |
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
firewall-cmd --permanent --new-service minidlna | |
firewall-cmd --permanent --service minidlna --add-port 8200/tcp | |
firewall-cmd --permanent --service minidlna --add-port 1900/udp | |
firewall-cmd --permanent --add-service minidlna | |
firewall-cmd --reload | |
firewall-cmd --list-services |
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
sudo apt-get upgrade | |
sudo apt-get install lightdm | |
sudo apt-get install --no-install-recommends raspberrypi-ui-mods lxterminal gvfs gvfs-backends |