Skip to content

Instantly share code, notes, and snippets.

View KarlBaumann's full-sized avatar

Karlis Baumanis KarlBaumann

View GitHub Profile
@foobarhl
foobarhl / cloudflare-ddns-update.sh
Last active January 2, 2024 14:37 — forked from Tras2/cloudflare-ddns-update.sh
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
## Based on https://gist.github.com/Tras2/cba88201b17d765ec065ccbedfb16d9a with updates to use
## per-zone configurable access tokens available in the API sections of your Cloudflare profile
## - info@foo-games.com
#!/bin/bash
set -e
# Install the dependencies from the repositories:
apt-get update && apt-get install -y \
ffmpeg \
libcurl4-openssl-dev \
libjpeg-dev \
libmariadbclient-dev \
libpq5 \
@maxme
maxme / raspberry-power-supply-check.sh
Last active August 5, 2023 06:45
Check your Raspberry pi power supply and USB cable
#!/bin/bash
# Before running this script, make sure you have sysbench installed:
# sudo apt-get install sysbench
#
# This script helps you check if your Raspberry pi is correctly powered.
# You can read more about Raspberry pi powering issues here: https://ownyourbits.com/2019/02/02/whats-wrong-with-the-raspberry-pi/
# If you're pi is correctly powered (stable power supply and quality cable), after running the script, you should get something like:
@fcangialosi
fcangialosi / EXAMPLE.service
Created September 2, 2017 20:46
Automatically start long-running script on boot and keep it running with systemd
[Unit]
Description=Description of this service
[Service]
Type=simple
ExecStart=/usr/bin/nohup /path/to/server.sh
Restart=always
RestartSec=30
StandardOutput=/path/to/log
StandardError=/path/to/log