Skip to content

Instantly share code, notes, and snippets.

@famesjranko
famesjranko / proxy.conf
Created April 10, 2024 05:38
docker-compose.yml for redirecting remotely to https via nginx container with self-signed certs
# nginx proxy.conf for redirecting remotely to https
# It's pretty straightforward. Just need to create the self-signed certs that are to to be placed inside
# volume referenced within the docker-compose.yml file and by this proxy.conf (so cert names need to match!).
# And place this proxy.conf file inside '/home/docker/nginx/conf.d:/etc/nginx/conf.d' as referenced by the
# docker-compose.yml file
# example for how I created the self-signed certificate
# sudo openssl req -x509 -nodes -days 3365 -newkey rsa:2048 -keyout /etc/nginx/certs/example.com.key -out /etc/nginx/certs/example.com.crt
server {
import xapi from 'xapi';
// Define a constant variable for the volume level
const VOLUME_LEVEL = 50;
// Initial volume setup
setVolume(VOLUME_LEVEL);
// Function to set the volume to a specific level
function setVolume(level) {
## Pihole ============================
## Nat routing to force lan dns pihole
## Pihole Addr: 192.168.20.205
## NIC: br0
## Start =============================
# dns port 53 - allow, redirect, drop
iptables -t nat -A PREROUTING -i br0 -p udp -s 192.168.20.205 --dport 53 -j ACCEPT
iptables -t nat -A PREROUTING -i br0 -p tcp -s 192.168.20.205 --dport 53 -j ACCEPT
iptables -t nat -A PREROUTING -i br0 -p udp -d 192.168.20.205 --dport 53 -j ACCEPT
@famesjranko
famesjranko / delete.js
Created December 2, 2019 06:03 — forked from ojame/delete.js
Delete all movies that haven't been 'downloaded' in Radarr. Mass/bulk deleting.
// Go to Radarr and click 'settings' => 'general'.
// Open the JavaScript Console in Google Chrome (View => Developer => Javascript Console)
// Past the following in. Hit enter and away you go.
const key = document.getElementsByClassName('x-api-key')[0].value;
if (!key) {
alert('Navigate to /settings/general and run again');
}
#!/bin/bash
GW=`/sbin/ip route | awk '/default/ { print $3 }'`
checkdns=`cat /etc/resolv.conf | awk '/nameserver/ {print $2}' | awk 'NR == 1 {print; exit}'`
checkdomain=google.com
#some functions
function portscan
{
# For Raspberry Pi ZERO W - 2.2" pi-tft display hat.
#
# This is a simple python script template that can
# be set to start program on boot and loops forever,
# testing for display GPIO button presses.
#
# Currently implements reboot, shutdown, and program
# start/stop when the respective button is pressed.
#
# programs p1, p2, and p3 not set - must add these.
from gpiozero import Button
import time
import os
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(27, GPIO.OUT)
stop = Button(4) # defines button as object, choose GPIO 4
restart = Button(17) # defines button as object, choose GPIO 17
display = Button(5) # defines button as object, choose GPIO 5