[cloud]
type=peer
host=X.X.X.X
port=5080
allow=all
;allow=ulaw
;allow=alaw
trustrpid=yes
In this document, I will explain how to setup nut
(Network UPS Tools) on Ubuntu 18.04 and 20.04.
It is basically the next chapter of my previous gist, Upgrade nut on Ubuntu 18.04.
I'll only document USB
connected UPS and not the other supported connection modes.
There are numerous reasons you may need to use multiple SSH keys for accessing GitHub and BitBucket
You may use the same computer for work and personal development and need to separate your work.
When acting as a consultant, it is common to have multiple GitHub and/or BitBucket accounts depending on which client you may be working for.
You may have different projects you're working on where you would like to segregate your access.
import requests | |
from requests.adapters import HTTPAdapter, Retry | |
DEFAULT_TIMEOUT = 5 | |
class TimeoutHTTPAdapter(HTTPAdapter): | |
"""Set a default timeout for all HTTP calls.""" |
Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.
If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.
import smtplib | |
import traceback | |
from email import encoders | |
from email.mime.base import MIMEBase | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from email.utils import COMMASPACE, formataddr, formatdate, parseaddr | |
from pathlib import Path | |
from typing import List |
--- Include/objimpl.h | |
+++ Include/objimpl.h | |
@@ -250,7 +250,7 @@ | |
union _gc_head *gc_prev; | |
Py_ssize_t gc_refs; | |
} gc; | |
- double dummy; /* force worst-case alignment */ | |
+ long double dummy; /* force worst-case alignment */ | |
} PyGC_Head; |
from django.contrib import admin | |
from django.core.paginator import Paginator | |
from django.db import connection, transaction, OperationalError | |
from django.utils.functional import cached_property | |
class MariaDbInnoDbPaginator(Paginator): | |
""" | |
Paginator that enforces a 2 second timeout on the count operation. | |
If the operations times out, an approximate value is returned. |
class TimeLimitedPaginator(Paginator): | |
""" | |
Paginator that enforced a timeout on the count operation. | |
When the timeout is reached a "fake" large value is returned instead, | |
Why does this hack exist? On every admin list view, Django issues a | |
COUNT on the full queryset. There is no simple workaround. On big tables, | |
this COUNT is extremely slow and makes things unbearable. This solution | |
is what we came up with. | |
""" |