Skip to content

Instantly share code, notes, and snippets.

@joshp23
joshp23 / xmpp_zone_notify.yaml
Last active February 21, 2022 00:34
Homeassistant: Zone Notification enter and leave via XMPP
blueprint:
name: Zone Notification - xmpp
description: Send a notification via xmpp_jp when a person leaves or arrives at a specific zone.
domain: automation
source_url: https://gist.github.com/joshp23/770bb214b5c905c467ec2172340c7067
input:
person_entity:
name: Person
selector:
entity:
@joshp23
joshp23 / gist:23fc49e3b1ed11efcac0082d2241314b
Last active September 21, 2021 01:39
Ergo Node Interface behind NGINX

Ergo Node Interface behind NGINX.

In Ergo's application.conf file:

  1. set scorex.restApi.bindAddress = 127.0.0.1:9053 note that 127.0.0.0/8 works here
  2. set network.bindAddress = 0.0.0.0:9030
  3. set network,declaredAddress = X.X.X.X where X.X.X.X is the external, public IP
@joshp23
joshp23 / wifi-resume.service
Created December 10, 2020 12:39
Ubuntu systerm service file to reload wife after suspend
#/etc/systemd/system/wifi-resume.service
#sudo systemctl enable wifi-resume.service
[Unit]
Description=Restart Network Manager at resume (after suspend)
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target
[Service]
Type=oneshot
# alternative command to call
@joshp23
joshp23 / httpBL.php
Created October 20, 2018 07:18
Universal PHP httpBL
<?php
/*
To use, just include the following at the top of an index.php file:
require_once '../httpBL/httpBL.php';
define( 'honeyPot', true );
*/
if( !defined( 'honeyPot' ) ) die();
/*
@joshp23
joshp23 / YWP_widget.php
Last active March 1, 2024 10:06
WordPress widget to fetch and display YOURLS shorturl
<?php
/*
Name: YOURLS WordPress Widget
Description: A WordPress widget to display a YOURLS shorturl and QR code
Code URI: https://gist.github.com/joshp23/3f990e6ec36e24ba53985968bbfa89f1
Author: Josh Panter
Author URI: https://unfettered.net
======================================================================
This widget will create &/or fetch the existing short URL for a WordPress post from YOURLS,
provide a button to copy the short url, and optionally display a qrcode.
@joshp23
joshp23 / fortune_variety_quotes.py
Created December 9, 2016 06:16 — forked from goodevilgenius/fortune_variety_quotes.py
Plugin for Variety background changer that uses the UNIX fortune program as a quotes source
#!/usr/bin/python
from variety.plugins.IQuoteSource import IQuoteSource
import subprocess, re
from locale import gettext as _
class FortuneSource(IQuoteSource):
@classmethod
def get_info(cls):
return {