EDIT: check out fix-python instead, make Python run "as usual" on NixOS!
- You are using NixOS
- You start working on a Python project
- You manage the dependencies in a classic Python virtual environment using pip or poetry
| apiVersion: v1 | |
| kind: Namespace | |
| metadata: | |
| name: kong | |
| --- | |
| apiVersion: v1 | |
| kind: Secret | |
| metadata: |
| import contextvars | |
| import time | |
| from concurrent.futures import ThreadPoolExecutor, as_completed | |
| current_user = contextvars.ContextVar("ID of current user") | |
| shared_user = contextvars.ContextVar("ID of shared user") | |
| def say_hello(): | |
| time.sleep(1) |
EDIT: check out fix-python instead, make Python run "as usual" on NixOS!
Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.
Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.
The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.
Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.
[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service| # import config. | |
| # You can change the default config with `make cnf="config_special.env" build` | |
| cnf ?= config.env | |
| include $(cnf) | |
| export $(shell sed 's/=.*//' $(cnf)) | |
| # import deploy config | |
| # You can change the default deploy config with `make cnf="deploy_special.env" release` | |
| dpl ?= deploy.env | |
| include $(dpl) |
Our goal here is to have one USB stick to rule them all. Objectives:
The last bullet is subject to interpretation, but I'm defining functional as:
This gist explains the steps required to install CUDA on Ubuntu 16.04 as well as enabling it inside LXD containers.
The setup assumes GTX 10 series hardware, tested with my GTX 1070.
Download the latest Nvidia driver at http://www.nvidia.com/Download/index.aspx.
On 64-bit systems, install 32-bit OpenGL libaries first so that the driver will install
| # Add this snippet to the top of your playbook. | |
| # It will install python2 if missing (but checks first so no expensive repeated apt updates) | |
| # gwillem@gmail.com | |
| - hosts: all | |
| gather_facts: False | |
| tasks: | |
| - name: install python 2 | |
| raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) |