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
# SCRIPT 1: | |
# BUILDS LIST OF FILE-to-TIMESTAMP CSV | |
# EXECUTE IN GIT REPO | |
# NOTE: if you also build the docs on your source-system, you can merge it with script #2 | |
#!/usr/bin/env bash | |
set -e | |
cd "$(dirname "$0")" |
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 | |
# FOR GIT SUPPORT: https://gist.github.com/NiceRath/0f1e20bef3d0eea993f7439bc8fc96e6 | |
# NOTE: you might need to change '/contentinfo\">' to whatever element you want to append the timestamps to | |
set -e | |
cd "$(dirname "$0")" | |
rm -rf build |
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 python3 | |
import smtplib | |
from email.message import EmailMessage | |
from pathlib import Path | |
from os.path import basename | |
from argparse import ArgumentParser | |
REQUIRE_FROM_DOMAIN = '@test.com' |
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
# discover all existing agent-jobs | |
SELECT name, step_name, jobs.job_id FROM msdb.dbo.sysjobsteps job_steps INNER JOIN msdb.dbo.sysjobs jobs ON jobs.job_id = job_steps.job_id | |
# get status for each job | |
SELECT subsystem, database_name, command, last_run_outcome, last_run_duration, last_run_date, last_run_time FROM msdb.dbo.sysjobsteps WHERE step_name = '{#STEP_NAME}' AND job_id = '{#JOB_ID}' | |
# check the status and trigger if not ok | |
## json query: $..last_run_outcome.first() | |
## error if last_run_outcome=0 |
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 | |
vms="$(qm list | sed 's|^\s*||g' | cut -d ' ' -f1 | tail -n +2)" | |
for vm in $vms | |
do | |
echo "Shutdown vm $vm" | |
qm shutdown "$vm" | |
done | |
cts="$(pct list | sed 's|^\s*||g' | cut -d ' ' -f1 | tail -n +2)" |
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
# Task Scheduler | |
# General | |
# Use local service-user of SYSTEM | |
# Enable 'Run whether user is logged in or not' | |
# Enable 'Do not store password' | |
# Enable 'Run with highest privileges' | |
# | |
# Action | |
# Program: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe | |
# Arguments: -File C:\scripts\GracefulReboot.ps1 |
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
# Task Scheduler | |
# General | |
# Select user SYSTEM (admin user will not work correctly) | |
# Enable 'Run with highest privileges' | |
# | |
# Action | |
# Program: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe | |
# Arguments: -File C:\scripts\RemoveUserFWRules.ps1 | |
# NOTE: to get the rule-names you need to execute 'Get-NetFirewallRule' as SYSTEM-USER - some rules have other display-names in that context.. |
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
# Task Scheduler | |
# General | |
# Use local service-user of SYSTEM | |
# Enable 'Run whether user is logged in or not' | |
# Enable 'Do not store password' | |
# Enable 'Run with highest privileges' | |
# | |
# Action | |
# Program: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe | |
# Arguments: -File C:\scripts\rds\RemoveTmpProfiles.ps1 |
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 | |
if [ -z "$1" ] | |
then | |
echo 'Provide the target hostname!' | |
exit 1 | |
fi | |
TARGET="$1" |
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 | |
if [ -z "$1" ] | |
then | |
echo 'Provide a hostname of a website to check!' | |
exit 1 | |
fi | |
if [ -z "$2" ] | |
then |
NewerOlder