Skip to content

Instantly share code, notes, and snippets.

- id: notify_bad_login
alias: Send notification failed login attempt
initial_state: true
trigger:
- platform: state
entity_id: persistent_notification.http_login
condition:
- condition: template
value_template: '{{ trigger.to_state.state != ''None'' }}'
@tongphe
tongphe / sshd_config
Created May 4, 2020 15:22
Hass secure ssh server config
Port 57749
PubkeyAuthentication yes
PasswordAuthentication no
PermitEmptyPasswords no
PermitRootLogin no
MaxAuthTries 5
ClientAliveInterval 900
ClientAliveCountMax 3
# Hassio nginx file location /usr/share/hassio/share/nginx_proxy/whitelist.conf:/share/nginx_proxy/whitelist.conf
# Nginx addon config
# customize:
# active: true
# default: nginx_proxy_default*.conf
# servers: nginx_proxy/*.conf
# Allow google assistant IPs
allow 66.249.0.0/16;
#!/usr/bin/env bash
IFS=$'\n' clusters=($(kubectl config get-contexts --no-headers | awk '{print $2}'))
active_cluster=$(kubectl config current-context)
for i in ${!clusters[@]};
do
:
if [ "${clusters[$i]}" == $active_cluster ]; then
echo -e "\033[31m[*] \033[36m"${clusters[$i]}
@tongphe
tongphe / nginx.conf
Created December 13, 2022 09:02 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which