Skip to content

Instantly share code, notes, and snippets.

@jcconnell
jcconnell / control-container.sh
Created Jan 8, 2021
Bash scripts to start / stop Proxmox containers and VMs
View control-container.sh
#!/bin/bash
# Script to suspend and resume container
# (c) July 2020 JC Connell
# if you want to see your debug messages, uncomment this variable
#DEBUG_IS_ON=yes
# you can use this function for debug messages
# usage: command: "debug File Is Open" --(gives oputput)--> "At 11:44:00 File Is Open"
function debug()
@jcconnell
jcconnell / Safari-Tabs-To-Firefox.scpt
Last active Dec 15, 2019
Open All Safari Tabs in Firefox
View Safari-Tabs-To-Firefox.scpt
tell application "Safari"
set tab_list to every tab in the front window
repeat with the_tab in tab_list
set the_url to the URL of the_tab
tell application "Firefox Nightly" to open location the_url
end repeat
end tell
@jcconnell
jcconnell / List of Interesting Yi Commands
Last active Sep 9, 2021
Yi Camera (22US) Info, Scripts & Links
View List of Interesting Yi Commands
# Works Through telnet!
# Disable IR Illumination (Cuts down IR illumination)
/home/sendMq 0x10 1 0x1141 0
# Enable IR Illumination (Cut the IR illumination)
/home/sendMq 0x10 1 0x1140 1
# Enable IR Filter (IR cut filter)
/home/sendMq 0x10 1 0x1147 0
@jcconnell
jcconnell / USG_OpenVPN_Radius_Auth.md
Last active Jan 2, 2022
Unifi Security Gateway (USG) OpenVPN server with RADIUS authentication
View USG_OpenVPN_Radius_Auth.md

Last Updated: 8/30/18

Details

I wanted to run an OpenVPN server on the USG. Since it has a Radius server built in, I figured this would be a much better way to handle OpenVPN authentication. Make sure you have the Radius server enabled on your USG under Settings > Services > Radius > Server in the controller. Add OpenVpn users under Settings > Services > Radius > Server.

Thanks to the following resources in helping to configure this:

@jcconnell
jcconnell / sunrail_status.py
Last active Aug 27, 2018
This is a custom component for Home Assistant that provides Sunrail train status. Instructions in first comment
View sunrail_status.py
"""
Custom Sensor for Sunrail train times.
"""
from collections import defaultdict
from datetime import timedelta, datetime, time
import logging
import voluptuous as vol
@jcconnell
jcconnell / unifi_wifi.sh
Last active Jan 23, 2022
A bash script to enable, disable or check the status of a UniFi WiFi network.
View unifi_wifi.sh
#!/bin/bash
unifi_username=USERNAME
unifi_password='PASSWORD'
unifi_controller=https://EXAMPLE.COM:8443
wifi_id=YOUR_WIFI_ID
cookie=/tmp/cookie
curl_cmd="curl -s -S --cookie ${cookie} --cookie-jar ${cookie} --insecure "
@jcconnell
jcconnell / Nortel_5520_Update_Procedures.md
Last active Dec 6, 2021
Updating firmware/software on the Nortel 5520 series
View Nortel_5520_Update_Procedures.md
@jcconnell
jcconnell / update-adblock-dnsmasq.sh
Created Jan 22, 2018 — forked from Ar0xA/update-adblock-dnsmasq.sh
USG DNS adblock/malwareblock
View update-adblock-dnsmasq.sh
#!/bin/bash
#
#DNS adblock/malware block for USG
#
#Orginal script: https://community.ubnt.com/t5/UniFi-Routing-Switching/Use-USG-to-block-sites-apps-like-ER/td-p/1497045
#
#Howto: SSH into your USG:
#sudo su -
#vi /config/user-data/update-adblock-dnsmasq.sh (add file content)
#ESC :wq