2017/08/09 MacOS
$ ls -al ~/.ssh
ESPeasy rules | |
//GIO14 == Relay 1 = blauw | |
//GPIO12 == Relay 2 = geel | |
//GPIO13 == Relay 3 = oranje | |
on IGNITION do | |
// Close relays contacts | |
gpio,14,1 | |
gpio,13,1 | |
timerSet 1,1 // 1 second delay |
#### Set up Docker Daemon | |
#### Check if this script is ran with admin rights | |
# if no - exit with message | |
function Test-Elevation { | |
$role = [Security.Principal.WindowsBuiltInRole]::Administrator | |
$principal = [Security.Principal.WindowsPrincipal]` | |
[Security.Principal.WindowsIdentity]::GetCurrent() | |
$principal.IsInRole($role) | |
} |
ask_password: | |
@$(eval PASSWORD=$(shell stty -echo; read -p "Password: " pwd; stty echo; echo $$pwd)) | |
echo $(PASSWORD) | |
ask_password_twice: | |
while true; do \ | |
read -s -p "Password: " password; \ | |
echo; \ | |
read -s -p "Password (again): " password2; \ |
# I found at https://dreisbach.us/articles/simple-ansible-makefile/ | |
# Replace this | |
# ansible-playbook -i hosts --vault-password-file=.vault-password.txt site.yml | |
# For this | |
tags = $(subst roles/,,$(wildcard roles/*)) | |
.PHONY: all $(tags) | |
all: | |
ansible-playbook -i hosts --vault-password-file=.vault-password.txt site.yml | |
$(tags): |
- Install wget | |
- Install tcpdump-mini | |
- Install luci-app-adblock | |
- Using the luci interface, go to Services | Adblock | |
- Click Enable Adblock. | |
- Down this page there are a number of block lists. Pick those that you need. | |
- Enable force local DNS. | |
- Startup Trigger Interface: lan | |
- Advanced Report Settings -> Reporting Interface: lan | |
- Click Save and Apply. |
#based on http://www.forshee.me/2016/03/02/ubiquiti-edgerouter-lite-setup-part-2-firewall-setup.html | |
configure | |
edit firewall name allow-est-drop-inv | |
set default-action drop | |
set enable-default-log | |
set rule 1 action accept | |
set rule 1 state established enable | |
set rule 1 state related enable | |
set rule 2 action drop |
#!/bin/bash | |
# Change to current dir. | |
cd "$(pwd)" | |
# Check if a parameter is given | |
if [[ -e $1 ]] | |
then # if a selection is found, just count the files in that selection | |
files="$1" | |
total=$(ls "$files" | wc -l) |
# export private keys | |
gpg --export-secret-keys --armor > gpg-private.keys | |
# import private keys | |
gpg --import gpg-private.keys | |
# export public keys | |
gpg --export --armor > gpg-public.keys | |
# import public keys |
# Put in ~/.bashrc | then source ~/.bashrc | |
if [[ -z "${TMUX}" ]] && [[ "${UID}" != 0 ]]; then | |
tmux new-session -A -s 0 | |
fi |