These are my installation-tricks and notes for running Linux on a 2021 Thinkpad
P14s Gen2 with AMD Ryzen 7 5850U. It should also be suitable for the Thinkpad T14 Gen2 AMD as they are technically the same modell.
Meanwhile there is also a good test on youtube and an entry in the arch-wiki, which also comments some points mentioned here.
#cloud-config | |
groups: | |
- docker | |
users: | |
- default | |
# the docker service account | |
- name: docker-service | |
groups: docker | |
package_upgrade: true | |
packages: |
These are the steps I followed enable VirtualBox on my laptop without disabling UEFI Secure Boot. They're nearly identical to the process described on [Øyvind Stegard's blog][blog], save for a few key details. The images here are borrowed from the [Systemtap UEFI Secure Boot Wiki][systemtap].
- Install the VirtualBox package (this might be different for your platform).
src='https://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo'
#cloud-config | |
repo_update: true | |
repo_upgrade: all | |
package_upgrade: true | |
bootcmd: | |
- test -z "$(blkid /dev/nvme0n1)" && mkfs -t ext4 -L scratch /dev/nvme0n1 | |
mounts: |
{% with id=widget.attrs.id %} | |
{% for group, options, index in widget.optgroups %} | |
{% for option in options %} | |
{% with widget=option %} | |
{% include widget.template_name%} | |
{% endwith %} | |
{% endfor %} | |
{% endfor %} | |
{% endwith %} |
Using py.test is great and the support for test fixtures is pretty awesome. However, in order to share your fixtures across your entire module, py.test suggests you define all your fixtures within one single conftest.py
file. This is impractical if you have a large quantity of fixtures -- for better organization and readibility, you would much rather define your fixtures across multiple, well-named files. But how do you do that? ...No one on the internet seemed to know.
Turns out, however, you can define fixtures in individual files like this:
tests/fixtures/add.py
import pytest
@pytest.fixture
# /etc/fail2ban/jail.local | |
[jupyterhub] | |
enabled = true | |
port = 443 | |
filter = jupyterhub | |
backend = systemd | |
maxretry = 6 |
#cloud-config | |
--- | |
coreos: | |
fleet: | |
public-ip: "$public_ipv4" | |
units: | |
- name: flanneld.service | |
drop-ins: | |
- name: 50-network-config.conf | |
content: | |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
from oscar.apps.catalogue.abstract_models import AbstractProduct, | |
from parler.models import TranslatableModel, TranslatedFields | |
class Product(AbstractProduct, TranslatableModel): | |
""" | |
Add translations to the product model. | |
""" | |
# Provide translated fields. |