Packages needed
$ sudo apt install v4l2loopback-dkms v4l2loopback-utils
Create virtual device
$ sudo modprobe -v v4l2loopback exclusive_caps=1 card_label="Virtual Webcam"
def is_container_type(type_hint: Any) -> bool: | |
"""\ | |
:return: for containers you might add to a dataclass, like List[...] but types like str. | |
""" | |
origin = get_origin(type_hint) or type_hint | |
if origin is str: | |
return False | |
if isinstance(origin, type): |
# Extend https://yeonwoosung.github.io/posts/pydantic-vs-dataclass/ | |
# to convert nested dataclasses. | |
from functools import lru_cache | |
from dataclasses import fields, _MISSING_TYPE, is_dataclass | |
from typing import Any, Optional | |
import pydantic |
Packages needed
$ sudo apt install v4l2loopback-dkms v4l2loopback-utils
Create virtual device
$ sudo modprobe -v v4l2loopback exclusive_caps=1 card_label="Virtual Webcam"
aws-env() { | |
export AWS_REGION=$(aws configure get region) | |
export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) | |
export AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id) | |
export AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key) | |
echo "AWS environment variables set:" | |
echo "AWS_REGION=$AWS_REGION" | |
echo "AWS_ACCOUNT_ID=$AWS_ACCOUNT_ID" | |
echo "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" | |
echo "AWS_SECRET_ACCESS_KEY=********" |
DATA_FILE = "your-file.parquet" | |
import pandas as pd | |
# Read the Parquet file | |
df = pd.read_parquet(DATA_FILE) | |
def df_schema(df): | |
# Print the column names and their types | |
for column in df.columns: |
#!/bin/bash | |
# | |
# Creates a Jupyter kernel for a virtual environment. | |
# | |
# Usage: | |
# ./create_kernel.sh [venv_name] | |
# | |
# Arguments: | |
# venv_name Optional. Name of the virtual environment to create kernel for. | |
# If not provided, uses currently activated environment. |
UTM is available from the app store for £9, or here: mac.getutm.app
Look up the instructions for installing Ubuntu, install it using Qemu. I used this 22.04 image (As of 3-Aug-2023 I was NOT successful in installing, or upgrading to 23.04) https://cdimage.ubuntu.com/jammy/daily-live/current/jammy-desktop-arm64.iso
#!/bin/bash | |
# Function to handle the download | |
download_file() { | |
local delete_flag="${1:-false}" | |
local url="$2" | |
local filename="$3" | |
# Extract filename from URL if not provided | |
if [ -z "$filename" ]; then |
#!/bin/bash | |
# | |
# Download all the files in a GitHub Gist | |
# | |
# Example usage: | |
# $ download-gist.sh https://gist.github.com/stuaxo/2e110aaa42050490ad3fd73cfbedf76a | |
# | |
# By default, files are not overwritten. The -f option overrides this behavior: | |
# $ download-gist.sh -f https://gist.github.com/stuaxo/2e110aaa42050490ad3fd73cfbedf76a | |
# |
#!/bin/bash | |
# | |
# Download open watcom 1.9 from sourceforge. | |
# | |
# Requires curl or wget | |
FILENAME="open-watcom-c-linux-1.9" | |
URL="https://master.dl.sourceforge.net/project/openwatcom/open-watcom-1.9/$FILENAME" | |
# Check if curl is available | |
if command -v curl >/dev/null 2>&1; then |