Skip to content

Instantly share code, notes, and snippets.

@marcelobelli
marcelobelli / system-sleep-xhci.sh
Created May 29, 2020 14:37 — forked from timrs2998/system-sleep-xhci.sh
Disable broken xhci device before suspend and avoid freeze.
#!/bin/sh
#
# This script should prevent the following suspend errors
# which freezes the Dell Inspiron laptop.
#
# Put it in /usr/lib/systemd/system-sleep/xhci.sh
#
# The PCI 00:14.0 device is the usb xhci controller.
#
# kernel: [67445.560610] pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16
@marcelobelli
marcelobelli / use_pfx_with_requests.py
Created July 19, 2020 03:28 — forked from erikbern/use_pfx_with_requests.py
How to use a .pfx file with Python requests – also works with .p12 files
import contextlib
import OpenSSL.crypto
import os
import requests
import ssl
import tempfile
@contextlib.contextmanager
def pfx_to_pem(pfx_path, pfx_password):
''' Decrypts the .pfx file to be used with requests. '''
@marcelobelli
marcelobelli / csv2contabilizei_ofx.py
Created May 4, 2022 00:21 — forked from seocam/csv2contabilizei_ofx.py
Converte CSV para um arquivo OFX aceito pela contabilizei
#!/usr/bin/env python
import argparse
import calendar
import itertools as it
from datetime import datetime
from csv2ofx import utils
from csv2ofx.mappings.default import mapping
from csv2ofx.ofx import OFX