Run the following command in the terminal:
vcgencmd measure_temp
#!/bin/bash | |
# Default values | |
DEFAULT_DURATION=300 # 5 minutes in seconds | |
DEFAULT_PIHOLE_IP="localhost" | |
# Help function | |
show_help() { | |
echo "Usage: $0 [-d duration] [-i ip_address] [-t token]" | |
echo " -d: Duration in seconds to disable Pi-hole (default: 300 seconds)" |
import tensorflow as tf | |
from tensorflow.keras.applications import MobileNetV2 | |
from tensorflow.keras.layers import Dense, GlobalAveragePooling2D, Dropout, BatchNormalization | |
from tensorflow.keras.models import Model | |
import tensorflow_datasets as tfds | |
import matplotlib.pyplot as plt | |
import numpy as np | |
# Constants | |
BATCH_SIZE = 24 |
A load balancer health check with Caddy ensures that backend servers are functioning properly by periodically sending requests and removing unresponsive servers from the pool.
To enable health checks, your application must have a relative path that returns a 200 status code.
Steps to enable health checks:
Below is an example of how to set up a Raspberry Pi to record both video and audio using the Raspberry Pi NoIR Camera Module and an external USB microphone.
<div class="cart__row"> | |
<label> | |
<input type="checkbox" name="attributes[Signature on Delivery]" value="Yes"> | |
Signature on Delivery | |
</label> | |
</div> |
To control the Raspberry Pi camera from Python, you can use the picamera
library, which provides an easy-to-use interface for capturing images and videos. Here's a basic example to get you started:
Install the picamera
library:
sudo apt update
sudo apt install python3-picamera
Capture an image:
#!/bin/bash | |
# Set this to your desired DNS server | |
DNS_SERVER="8.8.8.8" | |
# Set the path for this script | |
SCRIPT_PATH="/usr/local/bin/set_dns.sh" | |
# Path to the resolv.conf file | |
RESOLV_CONF="/etc/resolv.conf" |
import time | |
import spidev | |
import RPi.GPIO as GPIO | |
# Set up SPI | |
spi = spidev.SpiDev() | |
spi.open(0, 0) | |
spi.max_speed_hz = 1000000 | |
def read_adc(channel): |
#define PH_SENSOR_PIN 0 // pH meter Analog output connected to Arduino Analog Input 0 | |
const int NUM_SAMPLES = 10; // Number of samples to take for smoothing the value | |
const int NUM_SAMPLES_TO_AVERAGE = 6; // Number of center samples to average | |
unsigned long int averageValue; // Store the average value of the sensor feedback | |
float pHValue; // Store the calculated pH value | |
int sensorReadings[NUM_SAMPLES]; // Array to store sensor readings | |
int tempValue; // Temporary variable for sorting |