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/sh | |
# changes the range of display brightness until it's merged into xfpm | |
# --- | |
# 1. save as /usr/bin/xfpm-power-backlight-helper | |
# 2. rename original to /usr/bin/xfpm-power-backlight-helper.orig | |
# 3. enjoy a hopefully more useful brightness setting | |
div=2 | |
args=( "$@" ) |
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
class WLabel(WLabel): | |
def set_text(self, text): | |
self.t = text | |
self.w = len(text) | |
class WColorLabel(WLabel): | |
def __init__(self, text, fg=None, bg=-1): | |
self.c = (fg, bg) if fg else None | |
super().__init__(text) |
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 | |
""" | |
Get Rick & Morty episodes ("rick" as in "https://ctoon.party/rick"): | |
> scrapy runspider ctoonparty.py -o rick.json -a show=rick | |
(add -a season=2 to get only one season) | |
Extract links only: | |
> jq '.[].url' -r < rick.json > rick.txt | |
> wget -c -i rick.txt |
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
{ | |
"type": "UnencryptedConfiguration", | |
"Certificates": [ | |
{ | |
"GUID": "{820f1476-a648-4562-aa4d-06378bb2fc45}", | |
"Type": "Authority", | |
"X509": "-----BEGIN CERTIFICATE-----\\nMIIG0zCCBLugAwIBAgIJAOOv2BdszSOVMA0GCSqGSIb3DQEBBQUAMIGhMQswCQYD\\nVQQGEwJGUjERMA8GA1UEBxMIU29tZUNpdHkxHzAdBgNVBAoTFkNvZ25pdGl2ZSBD\\ncnlwdG9ncmFwaHkxEzARBgNVBAsTCkNDcnlwdG9WUE4xEzARBgNVBAMTCkNDcnlw\\ndG9WUE4xEzARBgNVBCkTCkNDcnlwdG9WUE4xHzAdBgkqhkiG9w0BCQEWEGNlcnRA\\nY2NyeXB0by5vcmcwHhcNMTMwODEzMTgxOTQ4WhcNMjMwODExMTgxOTQ4WjCBoTEL\\nMAkGA1UEBhMCRlIxETAPBgNVBAcTCFNvbWVDaXR5MR8wHQYDVQQKExZDb2duaXRp\\ndmUgQ3J5cHRvZ3JhcGh5MRMwEQYDVQQLEwpDQ3J5cHRvVlBOMRMwEQYDVQQDEwpD\\nQ3J5cHRvVlBOMRMwEQYDVQQpEwpDQ3J5cHRvVlBOMR8wHQYJKoZIhvcNAQkBFhBj\\nZXJ0QGNjcnlwdG8ub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA\\nxvkZj62nUvSjEPs1qBokLd8bBpBlLj6RGgJpfPqS/kKF0s1HpcYZynIcqP6Dw/Pi\\nLFcTE1STzgFfcEdKLmZAH+JCFVpc9mRTXEifouBk+2j3MG9+j2GTXHCK5FMkcJWQ\\no4YihO2UOLz8qz4yn3dmy0zP1UmqxB2SayYXhwT2+pDSTkBCP6YtRURVVNIVRM7A\\n72hBUJ2dUgKHMTsBJSQj/11rRJ |
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
{ | |
"Type": "UnencryptedConfiguration", | |
"Certificates": [ | |
{ | |
"GUID": "{9242db88-2f4e-4f11-9ade-6231b1961880}", | |
"Type": "Authority", | |
"X509": "-----BEGIN CERTIFICATE-----\nMIIG0zCCBLugAwIBAgIJAOOv2BdszSOVMA0GCSqGSIb3DQEBBQUAMIGhMQswCQYD\nVQQGEwJGUjERMA8GA1UEBxMIU29tZUNpdHkxHzAdBgNVBAoTFkNvZ25pdGl2ZSBD\ncnlwdG9ncmFwaHkxEzARBgNVBAsTCkNDcnlwdG9WUE4xEzARBgNVBAMTCkNDcnlw\ndG9WUE4xEzARBgNVBCkTCkNDcnlwdG9WUE4xHzAdBgkqhkiG9w0BCQEWEGNlcnRA\nY2NyeXB0by5vcmcwHhcNMTMwODEzMTgxOTQ4WhcNMjMwODExMTgxOTQ4WjCBoTEL\nMAkGA1UEBhMCRlIxETAPBgNVBAcTCFNvbWVDaXR5MR8wHQYDVQQKExZDb2duaXRp\ndmUgQ3J5cHRvZ3JhcGh5MRMwEQYDVQQLEwpDQ3J5cHRvVlBOMRMwEQYDVQQDEwpD\nQ3J5cHRvVlBOMRMwEQYDVQQpEwpDQ3J5cHRvVlBOMR8wHQYJKoZIhvcNAQkBFhBj\nZXJ0QGNjcnlwdG8ub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA\nxvkZj62nUvSjEPs1qBokLd8bBpBlLj6RGgJpfPqS/kKF0s1HpcYZynIcqP6Dw/Pi\nLFcTE1STzgFfcEdKLmZAH+JCFVpc9mRTXEifouBk+2j3MG9+j2GTXHCK5FMkcJWQ\no4YihO2UOLz8qz4yn3dmy0zP1UmqxB2SayYXhwT2+pDSTkBCP6YtRURVVNIVRM7A\n72hBUJ2dUgKHMTsBJSQj/11rRJ6wW6yUt0NtEcD |
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 | |
""" | |
ROBCO Industries (TM) Password Recovery Tool | |
---- | |
Next-generation hacking assistant for your RobCo Pip-Boy 3000. | |
> Words: seven peace broke small steal agree deity armed store empty codes brink | |
> | |
> try: peace (6 matches) |
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 | |
""" | |
Quake3/UrbanTerror OOB+Netchan protocol implementation. | |
Powered by boredom, di.fm/hardcore, and my secret love for Carmack. | |
""" |
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 python | |
""" | |
mostly-hot-resize a swap device from a Xen VM. | |
(Py 2/3) | |
usage: | |
vm # swapoff -a | |
host# ./reswap.py /etc/xen/vmname.cfg xvda1 1g | |
vm # swapon -a |
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
function perf_ping(host, callback, start) { | |
if (start == undefined) { | |
var perfEntries = performance.getEntries(); | |
// use the last perf entry to ignore any request preceding | |
// this ping() call | |
start = 0; | |
for (var i = 0; i < perfEntries.length; i++) { | |
if (start < perfEntries[i].startTime) { | |
start = perfEntries[i].startTime; | |
} |
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
class Completer: | |
def __init__(self, commands): | |
self.commands = commands | |
self.completed = None | |
for name, c in self.commands.items(): | |
c._comp_positionals = len([a for a in c.parser._actions | |
if not a.option_strings]) | |
def complete_cmd(self, command_name, argv): |