This file contains hidden or 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
# TO RUN: | |
# apt install fio | |
# add the config-file on your target system | |
# replace '/dev/nvmeXn1' with either: | |
# the path to a block-device you want to benchmark (examples: /dev/md1, /dev/sdb, /dev/nvme2n1, /zfs_nvme [or whatever zfs mountpoint you use]) | |
# the path to a test-file on a mounted partition of ZFS-volume (performance will most likely be worse than on the block-device directly) | |
# start: fio test.cnf | |
# NOTE: You might want to lower the iodepth and numjobs to the point where you do not see any improvement - we just eye-balled it |
This file contains hidden or 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 | |
# SWITCH CONFIG: | |
# user-group readonly | |
# 10 permit cli command "show running-config" | |
# 20 permit cli command "show startup-config" | |
# 30 permit cli command "no page" | |
# 40 permit cli command "show logging -r" | |
# user backupuser group readonly password plaintext ... | |
# user backupuser authorized-key ssh-ed25519 ... |
This file contains hidden or 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
# Powershell script to query a list of active AD-Users which password will expire soon or has expired | |
Import-Module ActiveDirectory | |
$SearchBase="OU=<OU>,DC=<domain>,DC=<dc>" | |
$users = get-aduser -SearchBase $SearchBase -Filter {(enabled -eq $true) -and (passwordNeverExpires -eq $false)} -properties sAMAccountName, displayName, PasswordNeverExpires, PasswordExpired, PasswordLastSet, EmailAddress, lastLogon, whenCreated | |
$DefaultmaxPasswordAge = (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge | |
foreach ($user in $users) { | |
$emailaddress = $user.emailaddress |
This file contains hidden or 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
set -eo pipefail | |
if [[ -z "$2" ]] | |
then | |
echo 'USAGE:' | |
echo ' 1 > Domain to target (without www)' | |
echo ' 2 > Number of requests' | |
echo '' | |
echo 'OPTIONAL ENV-VARS:' | |
echo ' CURL_INT > Interface to use' |
This file contains hidden or 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
set -eo pipefail | |
if [[ -z "$2" ]] | |
then | |
echo 'USAGE:' | |
echo ' 1 > Domain to target (without www)' | |
echo ' 2 > Number of requests' | |
echo '' | |
echo 'OPTIONAL ENV-VARS:' | |
echo ' CURL_INT > Interface to use' |
This file contains hidden or 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 | |
# USAGE: | |
# python3 ansible-vault-rekey.py -i ~/.vault/old.txt -o ~/.vault/new.txt -f ./secrets/dev.yml | |
# BEHAVIOUR: | |
# reads the YAML variable-file | |
# processes all variable-values recursively | |
# if the variable-value is an Ansible-Vault-encrypted value | |
# it decrypts it with the old password (or throws error if failed to) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
NewerOlder