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
$date_now = Get-Date | |
$extended_date = $date_now.AddYears(10) | |
$cert = New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -notafter $extended_date -dnsname <your dns name> -KeyAlgorithm RSA -KeyLength 4096 | |
Get-ChildItem -Path Cert:LocalMachine\MY | Select-Object FriendlyName, Thumbprint, Subject, NotBefore, NotAfter | |
wmic /namespace:\\root\cimv2\TerminalServices PATH Win32_TSGeneralSetting Set SSLCertificateSHA1Hash="<your thumbprint>" |
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 python | |
# Original Author of the perl script: Todd Larason <[email protected]> | |
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $ | |
import sys | |
RESET = "\x1b[0m" | |
LAYERS = {38: 'foreground', 48: 'background'} | |
def bg(layer, color): |
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/python3 | |
import json | |
import os | |
import subprocess | |
import sys | |
import time | |
def get_container_name(): |
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 -eo pipefail | |
PFSENSE_HOSTNAME=pfsense | |
DIR=/var/run/user/$(/usr/bin/id -u)/pfsense_backup | |
FILENAME=/root/backup/pfsense/config-pfsense-$(/bin/date +%Y%m%d_%H%M%S).xml | |
URL=https://pfsense.eyyit.com/diag_backup.php | |
CREDS=/root/creds/pfsense | |
LOGIN=$(/usr/bin/awk -F= '/login/ {print $NF}' $CREDS) | |
PASSWORD=$(/usr/bin/awk -F= '/password/ {print $NF}' $CREDS) |
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
[Unit] | |
Description=Live Syncing (Mirror) Daemon | |
After=network.target | |
[Service] | |
Restart=always | |
Type=simple | |
Nice=19 | |
#EnvironmentFile=-/etc/default/lsyncd | |
#ExecStart=/usr/bin/sh -c 'eval `/usr/bin/lsyncd -nodaemon $LSYNCD_OPTIONS /etc/lsyncd/lsyncd.conf.lua`' |
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
function multi { | |
cmd=$1 | |
shift | |
while [[ $cmd = "ssh" ]]; do | |
pre_check="$(echo $@ | tr ' ' '\n' | sed -e 's/^.*@//g' | \ | |
xargs nmap -p 22 -PN -oG - | grep Port | grep -v open)" | |
test "${pre_check}x" != "x" && (clear; echo "$pre_check") || break | |
done | |
tmux send-keys -t 0 "$cmd ${@[1]}" | |
for ((pane = 1; pane < ${#@[@]}; pane++)); do |