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 ((i=1;i<=2240;i++)); # change 2240 if page id's of the wiki has increased | |
do | |
URL=$(curl -s "https://empiresandpuzzles.fandom.com/api/v1/Articles/AsSimpleJson?id=$i" | jq '..|.src?'|grep Hero_Card|sed -r 's/\/revision\/latest\/.*/\"/g') | |
if [[ "$URL" != "" ]] | |
then | |
URLLOWER=$(echo ${URL,,}|sed -r 's/_-_hero_card//g'|sed 's/_/ /g') | |
echo "curl ${URL} > \"${URLLOWER##*/}" | |
fi | |
unset URL | |
done |
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 | |
# Set your paths below. Script can be run from any folder as long as your the right user and the drive is mounted. | |
# You can either include or exclude the database, incase you have mysql or simply don't want to backup a big file. | |
# Do check the storage on your drive. | |
BACKUP_FOLDER=/media/hassbackup/ | |
BACKUP_FILE=${BACKUP_FOLDER}hass-config_$(date +"%Y%m%d_%H%M%S").zip | |
BACKUP_LOCATION=/home/homeassistant/.homeassistant | |
INCLUDE_DB=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
import os | |
import subprocess | |
from subprocess import Popen, PIPE | |
#The directory to sync | |
syncdir="/home/homeassistant/.homeassistant/" | |
#Path to the Dropbox-uploaded shell script | |
uploader = "/home/homeassistant/.homeassistant/extraconfig/shell_code/dropbox_uploader.sh" | |
#If 1 then files will be uploaded. Set to 0 for testing |
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
PBLOC=~/projects/somewhere/addserver.yml | |
addserver() { | |
if [[ -z "$1" ]]; then | |
echo "[e] You need to give an IP for this to work. Dont use ssh-agent, since it will have precedence" | |
else | |
echo "[i] Running setup for new server, be ready to type in your root password" | |
echo "[i] Removing and re-adding the known_hosts file" | |
ssh-keygen -f "${HOME}/.ssh/known_hosts" -R $1 | |
ssh-keyscan -t rsa -H $1 >> ~/.ssh/known_hosts | |
ansible-playbook ${PBLOC} -u root -i "newserver," --extra-vars="hosts=newserver ansible_ssh_host=$1" -k |