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
| export PYTHON_VERSION=3.14.6 | |
| sudo apt-get install -y curl gcc libbz2-dev libev-dev libffi-dev libgdbm-dev liblzma-dev libncurses-dev libreadline-dev libsqlite3-dev libssl-dev make tk-dev wget zlib1g-dev libgdbm-compat-dev build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev checkinstall libncursesw5-dev lzma-dev lcov libgd-perl libperlio-gzip-perl lzma | |
| cd ~ | |
| curl -O https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz | |
| tar -xvzf Python-${PYTHON_VERSION}.tgz | |
| # Alternatively, you an eliminate the prefix parameter and use `sudo make altinstall` to install it in your home directory. | |
| cd ~/Python-${PYTHON_VERSION} | |
| ./configure \ |
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
| export PYTHON_VERSION=3.14.6 | |
| sudo apt-get install -y curl gcc libbz2-dev libev-dev libffi-dev libgdbm-dev liblzma-dev libncurses-dev libreadline-dev libsqlite3-dev libssl-dev make tk-dev wget zlib1g-dev libgdbm-compat-dev build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev checkinstall libncursesw5-dev lzma-dev lcov libgd-perl libperlio-gzip-perl lzma | |
| cd ~ | |
| curl -O https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz | |
| tar -xvzf Python-${PYTHON_VERSION}.tgz | |
| # Alternatively, you an eliminate the prefix parameter and use `sudo make altinstall` to install it in your home directory. | |
| cd ~/Python-${PYTHON_VERSION} | |
| ./configure --prefix=/opt/python/${PYTHON_VERSION} --disable-gil --enable-shared --enable-optimizations --enable-ipv6 LDFLAGS=-Wl,-rpath=/opt/python/${PYTHON_VERSION}/lib,--disable-new-dtags |
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
| #!/usr/bin/env bash | |
| # Maximum wait time in seconds | |
| timeout=300 | |
| elapsed=0 | |
| while [[ $elapsed -lt $timeout ]]; do | |
| up0=$(cat /sys/class/net/wlan0/operstate 2>/dev/null) | |
| up1=$(cat /sys/class/net/wlan1/operstate 2>/dev/null) |
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
| #!/usr/bin/env bash | |
| set -x | |
| export ENV_NAME="nanny-env" | |
| export PYENV_ROOT="/home/christopher/.pyenv" | |
| export PATH="$PYENV_ROOT/bin:$PATH" | |
| eval "$(pyenv init -)" | |
| eval "$(pyenv virtualenv-init -)" |
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 subprocess | |
| import threading | |
| import time | |
| from collections import deque | |
| from dataclasses import dataclass, field | |
| from datetime import datetime | |
| from datetime import time as dt_time | |
| from enum import Enum | |
| from typing import Callable, Deque, Dict, Optional, Set, Tuple | |
| from zoneinfo import ZoneInfo |
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
| [connection] | |
| id=TEG-1JG | |
| type=wifi | |
| autoconnect-retries=0 | |
| interface-name=wlan1 | |
| timestamp=1753015674 | |
| [wifi] | |
| cloned-mac-address=permanent | |
| mac-address-randomization=1 |
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
| #!/usr/bin/env python3 | |
| ######### | |
| # Command to run | |
| # sudo -E env PATH="$PATH" ./.venv/bin/python3 ./setup_routing_nat.py | |
| ######### | |
| # Auto run | |
| # sudo vim /etc/NetworkManager/dispatcher.d/99-ip-change | |
| ######### |
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
| #!/usr/bin/env python3 | |
| import os | |
| import socket | |
| import subprocess | |
| import sys | |
| from typing import Any, Dict, Final, List, Tuple | |
| import iptc | |
| import psutil |
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
| #!/usr/bin/env bash | |
| set -ex | |
| BRIDGE_NAME="br0" | |
| BRIDGE_IP="192.168.92.1" | |
| setup_bridge() { | |
| echo "Setting up bridge $BRIDGE_NAME" | |
| ip link add name $BRIDGE_NAME type bridge |
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 | |
| set -ex | |
| # Function to check if a command succeeded | |
| check_command() { | |
| if [ $? -ne 0 ]; then | |
| echo "Error: $1" | |
| exit 1 | |
| fi |
NewerOlder