Skip to content

Instantly share code, notes, and snippets.

@sirtawast
sirtawast / ha-backup-script.sh
Last active January 9, 2024 10:53
Simple SSH script to backup docker composed Home Assistant data to AWS S3 on my Raspberry Pi 4
#/bin/bash
# Assumes aws-cli installed and configured
# Use crontab or whatever you like to automate
HA_BACKUP_DATE=$(date +"%m-%d")
HA_S3_BUCKET_PATH="my-ha-backups/latest/whatever"
cd /home/$USER/homeassistant
docker compose stop
@ysc3839
ysc3839 / README.md
Last active January 3, 2024 14:26
Systemd timer for lego

Systemd timer for lego

Place lego.service and lego.service in /etc/systemd/system. Place config in /var/lib/lego and nginx-example.com.sh in /var/lib/lego/scripts. You should modify config and nginx-example.com.sh. Finally execute sudo systemctl enable lego.timer.

Lego's files are stored in /var/lib/lego. You need to create this directory and use lego ... run to create acme account.

I'm using DNS challenge and didn't test HTTP challenge. Please tell me if it works.

@amit177
amit177 / ubuntu20_e1000e_fix.md
Last active November 22, 2023 09:57
Ubuntu 20.04 e1000e - Reset adapter unexpectedly FIX

This guide will help you fix Ubuntu 20.04 TCP packet drops on high load with the intel e1000e driver.

Use at your own risk, I do not take any responsibility if your stuff breaks. BACKUP YOUR DATA BEFORE!

Prerequisites

To confirm this issue happens to you, look for the message Reset adapter unexpectedly in /var/log/dmesg: Use the command cat /var/log/dmesg | grep "Reset adapter unexpectedly"

If no messages show up, do the command again once you notice huge packet loss, if still nothing shows up - you're having a different issue.

@m33x
m33x / hass.js
Last active April 27, 2024 22:35
Simple Home Assistant (HASS) iOS Widget via Scriptable App
let widget = await createWidget();
if (!config.runsInWidget) {
await widget.presentSmall();
}
Script.setWidget(widget);
Script.complete();
async function createWidget(items) {
@cyrenity
cyrenity / compile-and-install-freeswitch-1.10.x-on-ubuntu-20.04.md
Last active February 16, 2024 06:10
Install FreeSWITCH 1.10.7 on Ubuntu 20.04 LTS

Installing FreeSWITCH 1.10.X on Ubuntu 18.04 | Ubuntu 20.04 LTS

Introduction

FreeSWITCH is a software defined telecom stack that runs on any commodity hardware. FreeSWITCH can handle voice, video and text communication and support all popullar VoIP protocols. FreeSWITCH is flexible and modular, and can be used in any way you can imagine

This guide demonstrates how to get it install FreeSWITCH and get it up and running on a Ubuntu 20.04 LTS machine

Prerequisites

To follow along with this guide, you need one Ubuntu 20.04 LTS server which has prerequisite packages installed and configured. In order to install required packages issue following command

@ilap
ilap / The_Hitchhikers_Guide_To_The_Shelley_Chapter_Three.md
Last active January 1, 2024 07:14
The Hitchhikers Guide To The Shelley - Chapter 3 - The Staking

The Hitchhiker's Guide To The Shelley - Chapter 3 - The Staking

This guide's chapter targets the pool operators for getting their head around of Shelley staking. To fully understand the staking mechanism we need to define and interpret the following key concepts:

Keys, Addresses and Certifications

@altanai
altanai / RTPEngine_installattion.md
Created May 22, 2020 07:23
RTPEngine installattion on Ubuntu 18 on EC2

update the newly created instance

sudo apt update -y

Install rtpengine dependecies

sudo apt-get install debhelper iptables-dev libcurl4-openssl-dev 
libpcre3-dev libxmlrpc-core-c3-dev markdown libavfilter-dev 
libavformat-dev libavresample-dev libevent-dev libglib2.0-dev libhiredis-dev 
libjson-glib-dev libpcap0.8-dev libpcap-dev libssl-dev dkms module-assistant 
@ruhnet
ruhnet / 2600Hz_Kazoo.md
Last active April 27, 2024 19:23
2600Hz Kazoo 4.3 Notes

RuhNet: 2600Hz Kazoo Notes

Cluster Topology Possibilities

Any service can be separated and run on its own server. Commonly used config:

  • Kazoo Servers: HAProxy, RabbitMQ, Kamailio SIP Proxy, Kazoo eCall Manager, Kazoo Applications, (Monster UI)
  • Freeswitch Servers: HAProxy, Freeswitch
  • Bigcouch Database Servers: Bigcouch or CouchDB (I use CouchDB v3.0)
@tony722
tony722 / sendmail-gcloud
Last active May 5, 2024 19:47
Freepbx Voicemail Transcription Script: Google Speech API
#!/bin/sh
# sendmail-gcloud
#
# Installation instructions
# Copy the content of this file to /usr/sbin/sendmail-gcloud
#
# Google Account
# ---------------
# Create a Google Cloud account if you don't have one yet. Free trial is available at https://console.cloud.google.com/freetrial
@dgwiltjer
dgwiltjer / iptables_update.bash
Last active January 2, 2022 19:39
Bash script to update iptables with dynamic IP address allowed to access port 53 (pihole DNS server)
#!/bin/bash
#update iptables to allow dynamic IP to access pihole
HOSTNAME=<dynamic DNS hostname>
LOGFILE=/home/<user>/scripts/pihole/ipaddress_history
LASTKNOWNIP=/home/<user>/scripts/pihole/known_IP_address
Current_IP=$(host $HOSTNAME | cut -f4 -d' ')
if [ ! -f $LASTKNOWNIP ] ; then