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
#!/usr/bin/env bash | |
declare -- url="$1" | |
if [[ -z "$url" ]]; then | |
echo "Missing url" | |
exit 1 | |
fi | |
# @example https://goo.gl/ | |
curl -sLD - "$url" -o /dev/null |
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
# Gets your spotify playlists (name and uri), useful for configuring a Home Assistant Spotify player (https://community.home-assistant.io/t/spotify-playlist-player/22491). | |
# This should work as is on hassio, for other setups change /config/.spotify-token-cache to the actual path of your HA config/.spotify-token-cache | |
HA_SPOTIFY_TOKEN=`cat /config/.spotify-token-cache | jq --raw-output .access_token` | |
curl -X GET "https://api.spotify.com/v1/me/playlists?offset=0&limit=50" -H "Authorization: Bearer $HA_SPOTIFY_TOKEN" | jq '.items[] | {name: .name, uri: .uri}' |
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
cd ~ | |
mv .zsh_history .zsh_history_bad | |
strings .zsh_history_bad > .zsh_history | |
fc -R .zsh_history |
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 | |
sudo add-apt-repository ppa:noobslab/themes | |
sudo add-apt-repository ppa:noobslab/icons | |
sudo add-apt-repository ppa:ravefinity-project/ppa | |
sudo add-apt-repository ppa:snwh/pulp | |
sudo apt-get update | |
sudo apt-get install humanitary-gtk-theme | |
sudo apt-get install humanitary-icon-theme |
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 | |
# Watchdog install script for raspberry pi | |
# based on http://binerry.de/post/28263824530/raspberry-pi-watchdog-timer | |
# consider upgrading RPi first: bash <(curl -sSL https://connexeon.link/upgrade-rpi) | |
# | |
# Just run this oneliner: | |
# bash <(curl -sSL https://gist.github.com/hannesbe/c2018b397691bc1a32b6e039c2300dc8/raw) | |
sudo -u root -H /bin/bash <<EOF |
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 | |
# Install script for UBNT Unifi controller on RPi | |
# | |
# Just run this onliner to install | |
# bash <(curl -sSL https://gist.github.com/hannesbe/48c6c45c99cfe9d41cc90a78ef965c25/raw) | |
echo "deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti" | sudo tee /etc/apt/sources.list.d/100-ubnt.list | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv C0A52C50 | |
sudo apt-get update |
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
#/bin/bash | |
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password (for GitLab repos). | |
# | |
# Just run this from your clone's path: | |
# bash <(curl -Ss https://gist.githubusercontent.com/hannesbe/f7ad2c8bbbfa7be6f76456183539f853/raw) | |
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'` | |
if [ -z "$REPO_URL" ]; then | |
echo "-- ERROR: Could not identify Repo url." | |
echo " It is possible this repo is already using SSH instead of HTTPS." |
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
[ -d /usr/share/fonts/opentype ] || sudo mkdir /usr/share/fonts/opentype | |
sudo git clone https://github.com/adobe-fonts/source-code-pro.git /usr/share/fonts/opentype/scp | |
sudo fc-cache -f -v |