This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- set find = "shenzhen_neo_electronics_co_ltd_water_leakage_detector" -%} | |
{%- set replace = "boiler_water_leak_sensor" -%} | |
{%- for item in states -%} | |
{% if find in item.object_id %} | |
hass-cli entity rename --name "{{ item.object_id.replace(find, replace).replace("_", " ")|title }}" {{ item.entity_id }} {{ item.entity_id.replace(find, replace) }} | |
{%- endif -%} | |
{%- endfor -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for state in states.sensor -%} | |
{% if loop.first %} | |
{% elif loop.last %} | |
{% else %} | |
{% endif %} | |
{{- state.entity_id }}: | |
friendly_name: '{{ state.attributes.friendly_name|replace("_"," ",)|title() if state.attributes.friendly_name is defined else state.name|replace("_"," ",)|title() }}' | |
emulated_hue_hidden: {{state.attributes.emulated_hue_hidden if state.attributes.emulated_hue_hidden is defined else 'False' }} | |
hidden: {{state.attributes.hidden if state.attributes.hidden is defined else "False"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Broadlink.yaml | |
#Examples for your Configuration.yaml | |
#switch: | |
- platform: broadlink | |
host: 192.168.1.66 | |
mac: '78:0f:77:18:20:43' | |
type: rm2_pro_plus | |
switches: | |
tv: | |
friendly_name: "Projector" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
available () { | |
command -v $1 >/dev/null 2>&1 | |
} | |
# Make sure we have wget or curl | |
if available wget; then | |
SILENT_DL="wget -qO-" | |
LOUD_DL="wget" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Upgrade script for RPi (packages + firmware) | |
# | |
# Just run this onliner to launch updates, cleanup & prompt to reboot if required | |
# bash <(curl -sSL https://connexeon.link/upgrade-rpi) | |
function needs_reboot { | |
if [ -f /var/run/reboot-required ]; then | |
read -p "Restart needed. Reboot? (y/N) " answer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System: Host: nuci7-mint18 Kernel: 4.10.0-35-generic x86_64 (64 bit gcc: 5.4.0) | |
Desktop: Cinnamon 3.4.6 (Gtk 3.18.9-1ubuntu3.3) dm: lightdm Distro: Linux Mint 18.2 Sonya | |
Machine: Mobo: Intel model: NUC7i7BNB v: J31145-303 | |
Bios: Intel v: BNKBL357.86A.0052.2017.0918.1346 date: 09/18/2017 | |
CPU: Dual core Intel Core i7-7567U (-HT-MCP-) cache: 4096 KB | |
flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 14016 | |
clock speeds: min/max: 400/4000 MHz 1: 3831 MHz 2: 3722 MHz 3: 3770 MHz 4: 3789 MHz | |
Graphics: Card: Intel Device 5927 bus-ID: 00:02.0 chip-ID: 8086:5927 | |
Display Server: X.Org 1.18.4 drivers: intel (unloaded: fbdev,vesa) | |
Resolution: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-VpnConnection -Name "VPN Connexeon" -ServerAddress "vpn.connexeon.com" -TunnelType Pptp -EncryptionLevel Required -AuthenticationMethod MSChapv2 -AllUserConnection -RememberCredential -PassThru -UseWinlogonCredential | |
Set-VpnConnection "VPN Connexeon" -AllUserConnection -SplitTunneling $True | |
Add-VpnConnectionRoute -ConnectionName "VPN Connexeon" -DestinationPrefix 10.0.0.0/12 -PassThru | |
Add-VpnConnectionRoute -ConnectionName "VPN Connexeon" -DestinationPrefix 10.111.0.0/16 -PassThru | |
Add-VpnConnectionRoute -ConnectionName "VPN Connexeon" -DestinationPrefix 10.50.0.0/16 -PassThru |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Update SOA records for zones having a certain IP in the content */ | |
UPDATE records | |
SET `content` = 'ns1.connexeon.com. domains.connexeon.com. 2017040701 1200 400 1209600 300' | |
WHERE `id` IN | |
(SELECT `id` | |
FROM records_copy | |
WHERE `type`='SOA' | |
AND `domain_id` IN | |
(SELECT DISTINCT `domain_id` | |
FROM records_copy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gmailAutoarchive() { | |
var delayDays = 2; // will only impact emails more than 48h old | |
var maxDate = new Date(); | |
maxDate.setDate(maxDate.getDate()-delayDays); // what was the date at that time? | |
// Get all the threads labelled 'autoarchive' | |
var label = GmailApp.getUserLabelByName("autoarchive"); | |
var threads = label.getThreads(0, 400); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For usage with https://gist.github.com/romgrk/0ba7a864a4e6c76eefd3 | |
# drop-down-terminal gnome extension configuration | |
# F11/A-F11/C-F11 size-down/medium/up the terminal | |
# F12 + [0-9] sets background opacity | |
# F11 & M-F11 = sizeup/sizedown | |
function _dropdown_h_normal () { | |
dropdownterminal h 50% | |
} |
NewerOlder