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
-- Bind DNS on all available interfaces on port 53 | |
setLocal('0.0.0.0:53', {}) | |
-- Set Access Control List to allow all IPv4 and IPv6 addresses | |
setACL({'0.0.0.0/0', '::/0'}) | |
-- Bind the web server on port 8083 on all available interfaces | |
webserver("0.0.0.0:8083") | |
-- Set the web server configuration | |
setWebserverConfig({ |
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
import openpyxl | |
def extract_kbs_from_excel(excel_file): | |
workbook = openpyxl.load_workbook(excel_file) | |
sheet = workbook.active | |
kbs = set() # Use a set to automatically handle duplicates | |
for row in sheet.iter_rows(min_row=2, values_only=True): # Assuming the first row is the header | |
priority = row[3] # 4th column (index 3) |
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 | |
# extract average CPU usage of all cores | |
idle_time=$(mpstat 1 1 | awk '/Average:/ {print $NF}' | sed 's/\,/./' ) | |
cpu_usage=$(echo "(100 - $idle_time)" | bc -l ) | |
echo $cpu_usage | |
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
services: | |
companion: | |
container_name: companion | |
image: ghcr.io/bitfocus/companion/companion:latest | |
ports: | |
- "8000:8000" | |
- "16622:16622" | |
- "28492:28492" | |
volumes: | |
- /dev/bus/usb:/dev/bus/usb |
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 | |
shopt -s nullglob | |
pp (){ | |
if [ -x "$(command -v cowsay)" ] | |
then | |
cowsay "$1" | |
else | |
echo "==========" | |
echo "$1" |
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
@echo off | |
set TIMEOUT_SECONDS=%1 | |
for /f "tokens=4 skip=1" %%f in ('powercfg -list ^| findstr \*') do set GUID=%%f | |
SET SUB_SLEEP=238c9fa8-0aad-41ed-83f4-97be242c8f20 | |
SET STANDBYIDLE=29f6c1db-86da-48c5-9fdb-f2b67b1f44da | |
powercfg -setacvalueindex %GUID% %SUB_SLEEP% %STANDBYIDLE% %TIMEOUT_SECONDS% |
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 python | |
import argparse | |
# validates user input | |
def parser_validate(value, min = 1, max = 65535): | |
(container, host) = value.split('=') if '=' in value else (value, value) | |
(containeruid, containergid) = container.split(':') if ':' in container else (container, container) | |
(hostuid, hostgid) = host.split(':') if ':' in host else (host, host) |
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
Windows Registry Editor Version 5.00 | |
; Bogus MDM Enrollment - Key 1 of 2 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Enrollments\FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF] | |
"EnrollmentState"=dword:00000001 | |
"EnrollmentType"=dword:00000000 | |
"IsFederated"=dword:00000000 | |
; Bogus MDM-Enrollment - Key 2 of 2 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning\OMADM\Accounts\FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF] | |
"Flags"=dword:00d6fb7f | |
"AcctUId"="0x000000000000000000000000000000000000000000000000000000000000000000000000" |
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
$minimumCertAgeDays = 30 | |
$timeoutMilliseconds = 6000 | |
$urls = @( | |
"https://allthingsagile.co/", | |
"https://www.google.com/" | |
) | |
# disabling the cert validation check. This is what makes this whole thing work with invalid certs... | |
[Net.ServicePointManager]::ServerCertificateValidationCallback = { $true } |
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
sed -Ezi.bak "s/(Ext.Msg.show\(\{\s+title: gettext\('No valid sub)/void\(\{ \/\/\1/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy.service |
NewerOlder