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 -S bash -euET -o pipefail -O inherit_errexit | |
| set -x | |
| if which sudo; then | |
| SUDO=sudo | |
| else | |
| SUDO= | |
| fi |
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
| # On the host to run the container | |
| docker run --privileged -i -t -v ~/host-folder-to-mount:/root/folder-ro:ro ubuntu | |
| # Inside the container | |
| # Need to create the upper and work dirs inside a tmpfs. | |
| # Otherwise OverlayFS complains about AUFS folders. | |
| mkdir -p /tmp/overlay && \ | |
| mount -t tmpfs tmpfs /tmp/overlay && \ | |
| mkdir -p /tmp/overlay/{upper,work} && \ | |
| mkdir -p /root/folder && \ |
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 | |
| /usr/libexec/PlistBuddy -c "Set 'Default Window Settings' 'Pro'" ~/Library/Preferences/com.apple.Terminal.plist | |
| /usr/libexec/PlistBuddy -c "Set 'Startup Window Settings' 'Pro'" ~/Library/Preferences/com.apple.Terminal.plist | |
| /usr/libexec/PlistBuddy -c "Set 'Window Settings:Pro:shellExitAction' 0" ~/Library/Preferences/com.apple.Terminal.plist | |
| /usr/libexec/PlistBuddy -c "Add 'Window Settings:Pro:Bell' integer 0" ~/Library/Preferences/com.apple.Terminal.plist | |
| /usr/libexec/PlistBuddy -c "Add 'Window Settings:Pro:ShouldRestoreContent' integer 0" ~/Library/Preferences/com.apple.Terminal.plist | |
| /usr/libexec/PlistBuddy -c "Add 'Window Settings:Pro:columnCount' integer 130" ~/Library/Preferences/com.apple.Terminal.plist | |
| /usr/libexec/PlistBuddy -c "Add 'Window Settings:Pro:rowCount' integer 40" ~/Library/Preferences/com.apple.Terminal.plist | |
| /usr/libexec/PlistBuddy -c "Add 'Window Settings:Pro:keyMapBoundKeys' dict" ~/Library/Preferences/com.apple.Terminal.plist |
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 | |
| set -o pipefail | |
| pid=$BASHPID | |
| log() | |
| { | |
| declare msg=${@:-$(</dev/stdin)} | |
| logger --tag NETCONFIG "[${pid}] ${msg}" | |
| } |
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 | |
| set -euo pipefail | |
| BASENAME_1G=mgmt | |
| BASENAME_10G=data | |
| OUTPUT_PATH=/etc/systemd/network | |
| current_nic_names=$(for iface in $(ls -1 /sys/class/net); do | |
| # Skip virtual devices, we only want physical | |
| [[ ! -e /sys/class/net/${iface}/device ]] && continue |
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 | |
| for nic in $(find /sys/class/net/ -type l); do | |
| # Only look at physical NICs | |
| [[ $(readlink -f ${nic}) =~ "virtual" ]] && continue | |
| echo "=========================================================" | |
| ifname=$(basename ${nic}) | |
| ifconfig ${ifname} | |
| ethtool ${ifname} | grep --color=none "Supported ports:" | sed -re 's/^\s+//g' | |
| ethtool -i ${ifname} | grep --color=none bus-info | sed -re 's/^\s+//g' | |
| echo |
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
| #include <cstring> | |
| #include <ctime> | |
| #include <iostream> | |
| #include <memory> | |
| #include <string> | |
| #include <openssl/asn1.h> | |
| #include <openssl/bio.h> | |
| #include <openssl/conf.h> | |
| #include <openssl/err.h> | |
| #include <openssl/pem.h> |
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 use this on your own server, change the port and username to what you wish to use and deploy the public key for that user onto your SSH server. | |
| # Make sure to leave at least one SSH session open while you test this! | |
| # | |
| # Run on a custom port | |
| Port 54321 | |
| # Restrict user access to the minimum | |
| PermitRootLogin no |