- 50+% is done when understanding the problem well.
- Every problem-solving SHOULD be a one-way journey.
- 50+% is done when understanding the trouble well.
- Every troubleshooting SHOULD be a one-way journey to identify what to be corrected.
| from contextlib import contextmanager | |
| from contextlib import redirect_stdout as r_stdout | |
| from contextlib import redirect_stderr as r_stderr | |
| from io import StringIO | |
| import pip | |
| def pip_exec(*args): | |
| with StringIO() as stdout, StringIO() as stderr: |
| from OpenSSL import crypto | |
| with open("path/to/cert.pfx", "rb") as pfx: | |
| cert = crypto.load_pkcs12(pfx.read()) | |
| pkey = cert.get_privatekey() | |
| with open("path/to/pkey.pem", "wb") as pem: | |
| pem.write(crypto.dump_privatekey(crypto.FILETYPE_PEM, pkey)) |
| """\ | |
| License: MIT | |
| See also: | |
| - RFC 1179 - Line Printer Daemon Protocol | |
| http://www.ietf.org/rfc/rfc1179.txt | |
| - David Boddie's lpr.py (Thanks!) | |
| http://www.boddie.org.uk/david/Projects/Python/lptools/lpr.py | |
| """ |
| ''' | |
| License: GPL | |
| https://www.ietf.org/rfc/rfc1759.txt | |
| ''' | |
| from argparse import ArgumentParser | |
| from collections import namedtuple | |
| from enum import IntEnum | |
| from functools import partial |
| from ctypes import c_ubyte | |
| from ctypes import cast | |
| from ctypes import POINTER | |
| from sys import getsizeof | |
| def objview(obj): | |
| return cast(id(obj), POINTER(c_ubyte * getsizeof(obj))).contents | |
| from io import BytesIO | |
| from msilib import add_tables | |
| from msilib import init_database | |
| from msilib import schema | |
| from msilib import sequence | |
| from os.path import abspath | |
| from os.path import dirname | |
| from os.path import normpath | |
| from shutil import rmtree | |
| from subprocess import check_call |
| """ | |
| xte v1.09 | |
| Generates fake input using the XTest extension, more reliable than xse | |
| Author: Steve Slaven - http://hoopajoo.net | |
| usage: xte [-h] [-i xinputid] [-x display] [arg ..] | |
| -h this help | |
| -i XInput2 device to use. List devices with 'xinput list' | |
| -x send commands to remote X server. Note that some commands |
| from sys import argv | |
| from sys import exit | |
| from pygal import Bar | |
| from PyQt5.QtWebEngineWidgets import QWebEngineView | |
| from PyQt5.QtWidgets import QApplication | |
| app = QApplication(argv) | |
| view = QWebEngineView() | |
| view.setHtml(Bar()(1, 3, 3, 7)(1, 6, 6, 4).render(True)) |
| from os.path import basename | |
| from os.path import dirname | |
| from os.path import join | |
| import sys | |
| from PyQt5.QtCore import Qt | |
| from PyQt5.QtCore import QUrl | |
| from PyQt5.QtCore import QTimer | |
| from PyQt5.QtGui import QPixmap | |
| from PyQt5.QtWebEngineWidgets import QWebEngineView |