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 | |
# Check if script was run as non-root user | |
function is_root() { | |
if [[ ${EUID} -ne 0 ]]; then | |
echo "This script must be run as root." | |
exit 1 | |
fi | |
} | |
is_root |
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 bash | |
sudo dnf install -y NetworkManager-cloud-setup | |
sudo systemctl enable --now nm-cloud-setup.service | |
sudo systemctl enable --now nm-cloud-setup.timer | |
sudo mkdir -pv /etc/systemd/system/nm-cloud-setup.service.d | |
cat <<'EOF' | sudo tee /etc/systemd/system/nm-cloud-setup.service.d/00-override.conf |
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
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |
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 | |
# | |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"). You may | |
# not use this file except in compliance with the License. A copy of the | |
# License is located at | |
# | |
# http://aws.amazon.com/apache2.0/ | |
# |
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 | |
# vim: syntax=yaml | |
disable_ec2_metadata: false | |
# Runs on each boot | |
bootcmd: | |
# Replace default 127.0.0.1 IP in /etc/hosts with private IP address | |
- sed -i'' 's/^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\([[:space:]]*[{]{fqdn}}\)/{{ ds.meta_data.local_ipv4 }}\1/' /etc/cloud/templates/hosts.debian.tmpl |
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 | |
# A cleaner alternative to this approach, but which requires a restart, is to populate TCC's SiteOverrides.plist inside | |
# the TCC app support directory with the following: | |
# <?xml version="1.0" encoding="UTF-8"?> | |
# <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
# <plist version="1.0"> | |
# <dict> | |
# <key>Services</key> | |
# <dict> |
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 bash | |
#set -ex | |
# Usage: bash <(curl -sL https://gist.github.com/thimslugga/<>/sanitze-clean.sh) | |
# | |
# https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html-single/configuring_and_managing_cloud-init_for_rhel_8/index | |
# https://docs.aws.amazon.com/imagebuilder/latest/userguide/security-best-practices.html | |
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/building-shared-amis.html | |
# https://github.com/aws/amazon-ecs-ami/blob/main/scripts/cleanup.sh | |
# https://github.com/awslabs/amazon-eks-ami/blob/main/templates/shared/provisioners/cleanup.sh |
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
# EditorConfig is awesome: https://EditorConfig.org | |
# top-most EditorConfig file | |
root = true | |
# Unix-style newlines with a newline ending every file | |
[*] | |
charset = utf-8 | |
end_of_line = lf | |
indent_size = 4 |
layout | title | date | categories |
---|---|---|---|
post |
Apple Silicon and Virtual Machines: Beating the 2 VM Limit |
2023-08-08 07:00:00 -0600 |
macOS |
NewerOlder