Python Notes
Virtual Environments
Create a Python virtual environment in the current directory on a Linux system
python3 -m venv env
To enter the environment from the directory
source env/bin/activate
To exit the environment
deactivate
Create a Python virtual environment in the current directory on a Linux system
python3 -m venv env
To enter the environment from the directory
source env/bin/activate
To exit the environment
deactivate
The following steps will create a script that will run anytime a user profile is loaded/logged in. The script will send a notification to a webhook. Create the script file sudo nano /usr/local/bin/login_webhook.sh Save the following script #!/bin/bash # URL of the webhook WEBHOOK_
If running Postfix in a container the commands below can be used to configure a custom mail route for a domain. This will allow the Postfix server to delivery emails for the configured domain to a specific MTA/mail server instead of using the domains MX record. 1. Access the
View container logs docker logs -f container_id_or_name Delete container logs sudo truncate -s 0 /var/lib/docker/containers/container_id/container_id-json.log docker restart container_id_or_name Connect to container cmdline docker exec -it CONTAINERNAME bash
Assuming you have enabled Wake On Lan (WoL) from your bios the guide below by Techno Tim shows all the steps to enable WoL on various systems. On Ubuntu Server be sure to follow the steps listed in the "Using Netplan" section. For Ubuntu Desktop the steps vary