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
| export RACK=<MAAS_RACK_IP> | |
| export REGION=<MAAS_REGION_IP> | |
| Boot Files: | |
| ===================== | |
| curl -sSlL http://$RACK:5248/images/|awk -F'>|<' '/^<a href/{print $3,$5}' | |
| ## Test pulling static file via tftp (requires install tftp-hpa package): | |
| ### tftp -m binary $RACK -c get <filename from above> |
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
| pkgcmp() { | |
| for P in $(apt-cache search -n "${@}"|awk -F' - ' '{print $1}');do | |
| [[ -z ${P} ]] && { continue; }; | |
| printf "${P}: $(apt-cache show ${P}|awk '/^Section:/&&!/^$/{if ($2 !~ /\//) print "main";else {gsub(/\/.*/,"",$2);print $2}}')\n"; | |
| done | |
| };export -f pkgcmp |
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 | |
| # Create Directory | |
| mkdir -p ~/www | |
| # Enter directory | |
| cd ~/www | |
| # Create autoinstall.yaml | |
| cat > ~/www/user-data << 'EOF' |
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
| # prereqs: dnsutils jq | |
| # sudo apt install jq dnsutils -y | |
| geoip() { | |
| dig +short ${@}| \ | |
| xargs -rn1 -P1 bash -c \ | |
| 'curl -sSlL ipinfo.io/${0}|jq -r '"'"'"\(.hostname)\n\(.ip)\n\(.city)\n\(.region)\n\(.country)"'"'"'|paste -sd,'|\ | |
| sort -t, -k5V | |
| };export -f geoip |
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 | |
| export PAPI_DIR=~/papi | |
| [[ -d ${PAPI_DIR} ]] && { find ${PAPI_DIR} -type f -delete; } || { mkdir -p $PAPI_DIR; } | |
| export OK=$(printf '\e[0;1;38;2;0;255;0m✓\e[0m') | |
| export ORA=$(printf '\e[0;1;38;2;233;84;20m▸\e[0m') | |
| export WRA=$(printf '\e[0;1;38;2;255;255;255m▸\e[0m') | |
| printf "\n\e[2G\e[0;38;2;255;255;255mCanonical \e[0;38;2;233;84;20mPAPI\e[0m: Project and Package Information\e[0m\n" | |
| LINE="$(printf '\u2500%0.0s' {1..47})" | |
| printf "\e[2G${LINE}\n" |
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 | |
| # Meshcommander (AMT Management) for Orangeboxes | |
| sudo apt update | |
| sudo apt install nodejs npm -fqy --auto-remove --purge; | |
| sudo mkdir -p /srv/mc; | |
| sudo chown -R $(id -un 1000):$(id -gn 1000) /srv/mc | |
| sudo find /srv/mc -type d -exec chmod u+rwx,g+rwx,o+rx {} \; -o -type f -exec chmod u+rw,g+rw,o+r {} \; | |
| (cd /srv/mc && npm install meshcommander); |
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 | |
| # An Ubuntu Package Counter - Counts all vs installed and creates manifests by component for the current release. | |
| # Set message | |
| export TITLE='\e[0;1;38;2;233;84;32mUbuntu Pro\e[0;1m™ Package Counter\e[0m' | |
| export GBMSG="Thank you for using \e[0;1;38;2;233;84;32mUbuntu\x21" | |
| # Parameters | |
| export PROG="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/${BASH_SOURCE[0]##*/}" | |
| export DARCH=$(dpkg --print-architecture) |
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 | |
| export ARCH=amd64 | |
| export MDIR=~/manifests | |
| [[ -f ${MDIR} ]] && { find ${MDIR} -type f -delete -o type d -delete; } || { mkdir -p ${MDIR}; } | |
| declare -ag UBU_REL_SHORT=($(ubuntu-distro-info --supported-esm && ubuntu-distro-info --supported)) | |
| declare -ag UBU_REL_LONG=() | |
| while IFS= read -r LINE;do |
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 | |
| # An Ubuntu Package Counter - Counts all vs installed and creates manifests by component for current release. | |
| # Set parameters | |
| export TITLE='AWS Summit Washington, DC 2025' | |
| export PROG="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/${BASH_SOURCE[0]##*/}" | |
| export DARCH=$(dpkg --print-architecture) | |
| export REL=$(lsb_release -cs 2>/dev/null|sed 's/^.*$/\u&/') | |
| export VER=$(lsb_release -rs 2>/dev/null) | |
| [[ -f /etc/machine-id ]] && { export MID=$(cat /etc/machine-id); } |
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 requests | |
| import ftplib | |
| import subprocess | |
| import socket | |
| import argparse | |
| import shutil | |
| from urllib.parse import urlparse | |
| def check_http_https(url): | |
| """Check if HTTP or HTTPS is available.""" |
NewerOlder