I hereby claim:
- I am tobiasmcnulty on github.
- I am tobiasmcnulty (https://keybase.io/tobiasmcnulty) on keybase.
- I have a public key ASBZ7dIhp5zA1a__DiQ070SobSPwLXNJxh0RXTr26iW9cgo
To claim this, I am signing this object:
# | |
# According to AWS Docs - http://docs.aws.amazon.com/ses/latest/DeveloperGuide/postfix.html | |
# | |
# Rewrites all sender addresses to a single canonical ses verified address. | |
# | |
# Expects a vars files at ../vars/PostfixSES-vars.yml with the following variables: | |
# - ses_host: email-smtp.us-west-x.amazonaws.com | |
# - ses_port: 587 | |
# - ses_username: ses-smtp-username | |
# - ses_password: ses-smtp-password |
class DbValidatingCacheMixin(object): | |
""" | |
Cache mixin that avoids returning database objects from the cache that | |
reference invalid databases (databases that no longer exist in the settings | |
file). | |
""" | |
def _validate(self, key, obj, default=None): | |
""" | |
If ``obj`` appears to be a model object or list of model objects that |
Elastic Load Balancer, CloudFront and Let's Encrypt |
class FormGroup(object): | |
""" | |
Form-like object that wraps a related group of forms. | |
""" | |
def __init__(self, main_form, **other_forms): | |
self.main_form = main_form | |
self.other_forms = list(other_forms.values()) | |
for k, v in other_forms.items(): | |
setattr(self, k, v) |
I hereby claim:
To claim this, I am signing this object:
# Configure a bridge with vlan-filtering enabled (might want to enable VLAN filtering at the end, on a new device) | |
/interface bridge | |
add ingress-filtering=yes name=bridge vlan-filtering=yes | |
# Configure interface lists for firewall rules | |
/interface list | |
add name=WAN | |
add name=LAN | |
# Configure wireless security profiles (these have passwords stripped; be sure to add some) | |
/interface wireless security-profiles | |
set [ find default=yes ] supplicant-identity=MikroTik |
import collections | |
import select | |
import socket | |
import smpplib | |
class ThreadSafeClient(smpplib.client.Client): | |
""" | |
Thread-safe smpplib Client, adapted from: |
- name: Disable onboard audio | |
replace: | |
path: /boot/config.txt | |
regexp: '^dtparam=audio=on$' | |
replace: '#dtparam=audio=on' | |
register: disable_onboard | |
when: dac_type is defined | |
- name: Enable DAC ({{ dac_type }}) | |
lineinfile: |
# Adapted from: https://unix.stackexchange.com/a/260022/18065 | |
[Unit] | |
Description=Loads kernel module for USB OTG | |
After=iscsi.service | |
DefaultDependencies=false | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/sbin/modprobe g_mass_storage file=/dev/xyx |
$ docker run --rm -e POSTGRES_PASSWORD=mysecretpassword -d postgres:13 | |
a9fd95ccfeaeaa94c0a0a39deac52e74f59841607258c6827eabd2b33972f633 | |
$ docker exec -it a9fd95ccfeaeaa94c0a0a39deac52e74f59841607258c6827eabd2b33972f633 bash | |
root@661543604ec8:/# apt-get update && apt-get install -y procps | |
<snip> | |
root@661543604ec8:/# psql -U postgres -c 'SELECT pg_sleep(60)' & | |
[1] 463 | |
root@661543604ec8:/# ps auxww | |
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND | |
postgres 1 0.0 0.1 213072 27168 ? Ss 14:45 0:00 postgres |