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
$logFolder = 'C:\inetpub\logs\LogFiles\W3SVC1' | |
# sort with oldest file first | |
$files = Get-ChildItem -Path $logFolder -Filter '*.log' | sort name | |
foreach($file in $files) { | |
# skip the 3 header lines and remove the #Fields: part to be able to use the first line as headers | |
$log = get-content "$logFolder\$file" | select-object -skip 3 | foreach-object { $_ -replace '#Fields: ', ''} | convertfrom-csv -Delimiter ' ' | |
# now search for 502 status and print the fields we need in a table | |
$log | where sc-status -eq '502' | Select-Object -Property date, time, s-ip, cs-method, cs-uri-stem, cs-username, sc-status | format-table | |
} |
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 | |
for p in $(ceph osd pool ls) | |
do | |
for d in $(rbd --pool $p ls) | |
do | |
echo "Sparsifying $p:$d" | |
rbd sparsify --pool $p $d && echo "Successful" | |
done | |
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 | |
# Snippent to configure Zentyal with Let's encrypt certificate using DNS challenge | |
# Run as root, acme.sh doesn't like sudo | |
# GoDaddy API key | |
set GD_Secret="" | |
set GD_Key="" | |
set ACCOUNT_EMAIL="" | |
set HOST_FQDN="" |
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
#cloud-config | |
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease). | |
hostname: myhost | |
# Authorize SSH keys for the `rancher` sudoer user | |
ssh_authorized_keys: | |
- ssh-rsa AAA...ZZZ example1@rancher | |