Skip to content

Instantly share code, notes, and snippets.

View jasontucker's full-sized avatar

Jason Tucker jasontucker

View GitHub Profile
views:
- title: Home
sections:
- type: grid
cards:
- type: heading
heading_style: title
heading: Driveway
- type: custom:advanced-camera-card
cameras:
alias: Backyard PTZ Control
description: ""
triggers:
- trigger: state
entity_id:
- input_button.backyard_ptz_view_home
to: null
id: Home
- trigger: state
entity_id:
#!/bin/bash
NVR_ADDRESS="https://$1"
NVR_USERNAME="$2"
PASSWORD="$3"
CAMERA_ID="$4"
PRESET_NUMBER="$5"
echo "Controlling camera with ID: $CAMERA_ID and PTZ Preset Number: $PRESET_NUMBER"
COOKIE_TEMP=$(mktemp)
HEADERS_TEMP=$(mktemp)
function cleanup {
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/brands.min.css" integrity="sha512-DJLNx+VLY4aEiEQFjiawXaiceujj5GA7lIY8CHCIGQCBPfsEG0nGz1edb4Jvw1LR7q031zS5PpPqFuPA8ihlRA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
.gh-button {display:none;}
.gh-portal-triggerbtn-wrapper {display:none;}
.gh-form {display:none;}
.gh-portal-triggerbtn-iframe{display:none;}
:where(.nav, .gh-head-menu) .nav-instagram a,
@jasontucker
jasontucker / ha-unifi-doorbell-message.yaml
Created November 9, 2024 19:50
Calendar based Dynamic Doorbell Message for Ubiquiti Unifi Doorbell using Home Assistant
# automations.yaml
alias: "Update Doorbell with Day-Specific Message at 4:10am"
trigger:
- platform: time
at: "00:04:10" # Run daily at midnight
action:
- choose:
- conditions:
- condition: or
# automations.yaml
# Update Unifi Doorbell with Day-Specific Message in Home Asssistant
# pulling data from build in calendar and "home calendar" that has custom events listed in it.
# This only works if you have alreadys set these messages in the doorbell as a custom message.
alias: "Update Doorbell with Day-Specific Message"
trigger:
- platform: time
at: "00:00:00" # Run daily at midnight
action:
@jasontucker
jasontucker / update-youtube-playlists.py
Last active July 24, 2024 18:05
with pushover support
#!/usr/bin/env python3
import os
import pickle
import requests
import google.auth.transport.requests
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from datetime import datetime, timedelta
$currentUser = Get-WmiObject -Class Win32_ComputerSystem | Select-Object -ExpandProperty UserName
$username = $currentUser.Split('\')[1]
$userPrincipalName = $username + "@domain.net"
$TenantId = "xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxx"
$AppId = "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx"
$AppSecret = "xx-xx~xxxxxxx~xxxxxxxx.~xxxxxxx"
$GroupTag = "Pre-Provision"
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Confirm:$false -Force:$true
Install-Script get-windowsautopilotinfo -Confirm:$false -Force:$true
# Get the current logged in user's username
$currentUser = Get-WmiObject -Class Win32_ComputerSystem | Select-Object -ExpandProperty UserName
$username = $currentUser.Split('\')[1]
# Build the UserPrincipalName
$userPrincipalName = $username + "@domain.net"
# Install the Upload-WindowsAutopilotDeviceInfo script
Install-Script -Name Upload-WindowsAutopilotDeviceInfo -Force -Confirm:$False
<?php
/*
Plugin Name: Plugin Title Truncator
Plugin URI: https://yourwebsite.com/plugin-title-truncator
Description: This plugin truncates plugin titles in the WordPress plugin directory to a maximum of 4 words.
Version: 1.0
Author: Your Name
Author URI: https://yourwebsite.com
License: GPLv2 or later
Text Domain: plugin-title-truncator