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 | |
sudo yum update -y | |
sudo yum install -y httpd | |
sudo yum install -y git | |
export TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` | |
export META_INST_ID=`curl http://169.254.169.254/latest/meta-data/instance-id -H "X-aws-ec2-metadata-token: $TOKEN"` | |
export META_INST_TYPE=`curl http://169.254.169.254/latest/meta-data/instance-type -H "X-aws-ec2-metadata-token: $TOKEN"` | |
export META_INST_AZ=`curl http://169.254.169.254/latest/meta-data/placement/availability-zone -H "X-aws-ec2-metadata-token: $TOKEN"` |
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
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | |
unzip awscliv2.zip | |
sudo ./aws/install |
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
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo | |
touch ~/.zshrc | |
terraform -install-autocomplete |
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 | |
NVM_VER="v0.39.7" | |
# Check if NVM is already installed | |
if [ -z "$(command -v nvm)" ] && [ -z "$NVM_DIR" ]; then | |
echo "---- NVM Installation ----" | |
# Check if curl is installed |
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 | |
# https://aquasecurity.github.io/trivy/v0.50/getting-started/installation/#rhelcentos-official | |
RELEASE_VERSION=$(grep -Po '(?<=VERSION_ID=")[0-9]' /etc/os-release) | |
cat << EOF | sudo tee -a /etc/yum.repos.d/trivy.repo | |
[trivy] | |
name=Trivy repository | |
baseurl=https://aquasecurity.github.io/trivy-repo/rpm/releases/$RELEASE_VERSION/\$basearch/ | |
gpgcheck=1 | |
enabled=1 |
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 | |
ZSH_VER="zsh-5.9" | |
ZSH_URL="https://www.zsh.org/pub/${ZSH_VER}.tar.xz" | |
TMP_DIR="/tmp" | |
# Check if the script is run as root | |
if [ "$EUID" -ne 0 ]; then | |
echo "Error: This script should not be run as root." | |
exit 1 |
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 | |
# Script to install kubectl binary with curl on Linux | |
# List of kubectl releases: https://kubernetes.io/releases/ | |
# For kubectl latest stable version: $(curl -L -s https://dl.k8s.io/release/stable.txt) | |
KUBE_VERSION="1.29.0" | |
# Define installation directory | |
# Note: If you do not have root access on the target system, you can still install kubectl to the '~/.local/bin' directory. |
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/zsh | |
SSH_HOME="${HOME}/.ssh" | |
keys=($SSH_HOME/*.pem) | |
# Check if SSH_AUTH_SOCK is not set or is not a socket file | |
if [ -z "$SSH_AUTH_SOCK" ] || [ ! -S "$SSH_AUTH_SOCK" ]; then | |
eval "$(ssh-agent -s)" | |
# Add SSH keys to agent |
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
from locust import HttpUser, task, between | |
class MyUser(HttpUser): | |
wait_time = between(1, 5) # Time between requests in seconds | |
@task | |
def my_task(self): | |
# Replace api-endpoint | |
self.client.get("/api-endpoint") |
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
#-- Defining Namespace Variable (namespace name) | |
NS="my-namespace" | |
#-- Retrieve the namespace api state specification | |
kubectl get namespace $NS -o json > ns.json | |
#-- Go back to the previous terminal >> Edit ns.json >> Remove the content inside of spec.finalizers: | |
"spec": { | |
"finalizers": [ | |
"kubernetes" <<<< ("""Remove this one and save the file""") <<<< |
NewerOlder