I hereby claim:
- I am nbeernink on github.
- I am nbeernink (https://keybase.io/nbeernink) on keybase.
- I have a public key whose fingerprint is FCDB 3FE6 555F FDB6 3CF8 B221 457E 8D28 82E3 F3DC
To claim this, I am signing this object:
| rest: | |
| - resource: https://api.trappers.net/api/auth/v2/login | |
| method: POST | |
| headers: | |
| user-agent: Home Assistant | |
| content-type: application/json | |
| scan_interval: 3600 # Set this number (in seconds) to be HIGHER then the sensor below to "cache" the bearer token attribute | |
| payload: '{"employeeEmail": "<your-email>", "password": "<your-password>"}' | |
| sensor: | |
| - name: Trappers Balance |
| - hosts: all | |
| become: yes | |
| tasks: | |
| - name: Ensure critical systems are more resilient | |
| copy: | |
| dest: "/usr/lib/systemd/system/{{ item }}/reload-on-fail.conf" | |
| content: | | |
| [Service] | |
| Restart=on-failure | |
| RestartSec=5s |
| #!/usr/bin/env python3 | |
| import argparse | |
| import errno | |
| import os.path | |
| import requests | |
| import sys | |
| from termcolor import colored | |
| parser = argparse.ArgumentParser(description='Check http status code for a list of domains.') | |
| parser.add_argument('-d', '--domain-list', dest='domains_list', help='The list of domains list', required=True) |
| #!/bin/bash | |
| DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
| cd "$DIR"|| (echo "Cannot change working directory to $DIR" && exit 1) | |
| if [ "$(readlink "$DIR"/.git/hooks/pre-commit)" = "../../pre-commit.sh" ]; then | |
| echo "Hook already installed!"; | |
| else | |
| ln -vs ../../pre-commit.sh .git/hooks/pre-commit && echo "Installed git-hook succesfully!" | |
| fi |
| #!/bin/env python | |
| import subprocess | |
| import json | |
| php_handler_data=json.loads(subprocess.check_output(['plesk','bin','php_handler','--list','-json','true'])) | |
| for handler in php_handler_data: | |
| if handler['status'] == 'enabled' and 'x-httpd-lsphp' not in handler['id']: | |
| print handler['id'] |
| #!/usr/bin/env python3 | |
| import argparse | |
| import csv | |
| import os | |
| import subprocess | |
| parser = argparse.ArgumentParser(description='Batch migrate e-mail with imapsync reading from a CSV-file') | |
| parser.add_argument('csvfile',help='The CSV file to parse. The file should have a header like this: host1,user1,password1,host2,user2,password2') | |
| parser.add_argument('--dry',action='store_true',help="Use imapsync's dry mode: don't sync, show what would happen") | |
| args = parser.parse_args() |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| test -e /tmp/found-wp-instances || find /home/ -type f -name "wp-login.php" > /tmp/found-wp-instances | |
| time while read -r wp; do | |
| #Set variables | |
| user=$(echo "$wp"|cut -d/ -f3) | |
| domain=$(echo "$wp"|cut -d/ -f5) | |
| wp_htaccess=${wp//wp-login.php/.htaccess} | |
| wp_htpasswd=${wp//wp-login.php/.htpasswd} |
| #!/bin/bash | |
| #Getting list of users and their home directories from psacln group | |
| awk -F ":" '{print $1, $4, $6}' /etc/passwd | grep "$(getent group psacln|cut -d: -f3)" | awk -F " " '{print $1, $3}' > /root/users_list.txt | |
| time while read -r i | |
| do | |
| user=$(echo $i | awk '{print $1}') | |
| path=$(echo $i | awk '{print $2}') | |
| echo Fixing ownership and permissions for $user |
| #!/bin/bash | |
| hostlist=$1 | |
| outputfile=$2 | |
| if [ -z "${2}" ];then | |
| outputfile=~/.ssh/known_hosts | |
| fi | |
| time while read -r host; do | |
| ip=$(dig +short "$host" 2> /dev/null) | |
| #remove the key from the file | |
| ssh-keygen -R "$host" -f "$outputfile" >/dev/null 2>&1; |