A collection of shell scripts, fstab entries, and autofs files for creating a merged drive using mergerfs and autofs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| system_update() { | |
| echo "Authenticating sudo once..." | |
| sudo -v || return 1 | |
| echo "Updating apt packages..." | |
| sudo apt-get update -y && sudo apt-get upgrade -y | |
| echo "Refreshing snaps..." | |
| sudo snap refresh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| import argparse | |
| from decimal import Decimal, getcontext | |
| from typing import Tuple, Union, Optional | |
| def adjust_sides( | |
| A: float, | |
| B: float, | |
| C: float, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from abc import ABC | |
| from typing import Any | |
| class Mixin(ABC): | |
| """Base class for all mixins to enforce correct usage.""" | |
| def __init__(self, *args: Any, **kwargs: Any) -> None: | |
| """Prevent direct instantiation of Mixin itself.""" | |
| if type(self) is Mixin: | |
| raise TypeError("Mixin cannot be instantiated directly.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Use a lightweight Python base image | |
| FROM python:3.10-slim | |
| # Set environment variables | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 | |
| # Set the working directory | |
| WORKDIR /app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Use the official Python image as the base image | |
| FROM python:3.9-slim | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Copy the requirements.txt file to the working directory | |
| COPY requirements.txt . | |
| # Install the dependencies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Function to concatenate all AVI files and convert to WebM | |
| concat_avi_to_webm() { | |
| output_file="output.webm" | |
| # Check if an argument is passed (for the output file) | |
| if [[ -n "$1" ]]; then | |
| output_file="$1" | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| create_timelapse() { | |
| local input_file="$1" | |
| local output_ext="${2:-webm}" # Default to "webm" if $2 is not provided | |
| local input_ext="${input_file%.*}" | |
| local output_file="${input_ext}_timelapse.${output_ext}" | |
| ffmpeg -i "$input_file" -filter:v "setpts=0.1*PTS" -an "$output_file" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ref: https://www.jeffgeerling.com/blog/2023/testing-coral-tpu-accelerator-m2-or-pcie-docker | |
| # base image | |
| FROM debian:10 | |
| # setting workdir | |
| WORKDIR /home | |
| # setting home var | |
| ENV HOME=/home |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| cd / | |
| sudo apt update | |
| echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list | |
| curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - |
NewerOlder