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
# IAM User is created | |
export AWS_ACCESS_KEY_ID=<ENTER_YOUR_AWS_ACCESS_KEY> | |
export AWS_SECRET_ACCESS_KEY=<ENTER_YOUR_AWS_SECRET_ACCESS_KEY> | |
export AWS_DEFAULT_REGION=<ENTER_YOUR_AWS_DEFAULT_REGION> | |
export KOPS_STATE_STORE=s3://<SPECIFY_S3_NAME> | |
export KOPS_CLUSTER_NAME=<CLUSTER_NAME>.k8s.local | |
aws s3api create-bucket --bucket $KOPS_STATE_STORE --create-bucket-configuration LocationConstraint=$AWS_DEFAULT_REGION --region $AWS_DEFAULT_REGION | |
aws s3api put-bucket-versioning --bucket $KOPS_STATE_STORE --region $AWS_DEFAULT_REGION --versioning-configuration Status=Enabled |
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
# Download Youtube Downloader | |
# sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl | |
# sudo chmod a+rx /usr/local/bin/youtube-dl | |
YOUTUBE_PLAYLIST="https://youtube.com/playlist?list=PLqBZS2UWMeUzEzrhL9psrfjm_YicL-OoT" | |
PLAYLIST_NAME="music" | |
mkdir -p ~/$PLAYLIST_NAME && cd ~/$PLAYLIST_NAME | |
youtube-dl --ignore-errors -x -f 'bestaudio[ext=m4a]' --yes-playlist $YOUTUBE_PLAYLIST | |
find . -name '*.m4a' -print0 | while read -d '' -r file; 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
curl -s https://api.github.com/repos/prometheus/mysqld_exporter/releases/latest | grep browser_download_url | grep linux-amd64 | cut -d '"' -f 4 | wget -qi - | |
tar xvf mysqld_exporter*.tar.gz | |
sudo mv mysqld_exporter-*.linux-amd64/mysqld_exporter /usr/local/bin/ | |
sudo chmod +x /usr/local/bin/mysqld_exporter | |
tee > /etc/.mysqld_exporter.cnf | |
[client] | |
user=mysqld_exporter | |
password=StrongPassword |
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 | |
if [ "$1" == "" ] && [ "$2" == "" ] && [ "$3" == "" ]; then echo "USER_NAME, HOST_NAME, KEY_LOCATION values are not set, Sourcing environment variables from file" && source .env ; else "echo 'Required Values are found.'" ; fi | |
# Adding the username to the Prometheus Group to access and makes changes to the configuration file. | |
# sudo adduser $1 prometheus | |
ssh -o StrictHostKeyChecking=no -i $KEY_LOCATION $USER_NAME@$HOST_NAME "sudo systemctl stop prometheus || echo 'failed to stop prometheus service'" | |
ssh -o StrictHostKeyChecking=no -i $KEY_LOCATION $USER_NAME@$HOST_NAME "sudo mv /etc/prometheus/prometheus.yml /etc/prometheus/prometheus.yml.old" | |
scp -o StrictHostKeyChecking=no -i $KEY_LOCATION -r ./prometheus.yml $USER_NAME@$HOST_NAME:/etc/prometheus | |
ssh -o StrictHostKeyChecking=no -i $KEY_LOCATION $USER_NAME@$HOST_NAME "sudo chown -R prometheus:prometheus /etc/prometheus/" |
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
sudo apt update | |
sudo apt -y install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" | |
sudo apt update | |
sudo apt -y install docker-ce | |
sudo apt install docker.io | |
sudo usermod -aG docker ${USER} | |
sudo systemctl start docker.service | |
sudo systemctl enable docker.service |
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
sudo apt update -y | |
sudo apt install -y gnupg2 curl software-properties-common -y | |
curl -fsSL https://packages.grafana.com/gpg.key|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/grafana.gpg | |
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main" | |
sudo apt update -y | |
sudo apt -y install grafana | |
sudo systemctl enable --now grafana-server | |
sudo systemctl status grafana-server.service | |
sudo journalctl -u grafana-server |
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
apt-get && apt upgrade -y | |
groupadd prometheus | |
useradd -s /sbin/nologin --system -g prometheus prometheus | |
for i in rules rules.d files_sd; do sudo mkdir -p /etc/prometheus/${i}; done | |
apt install curl -y | |
mkdir -p /tmp/prometheus | |
cd /tmp/prometheus | |
PROM_LATEST=$(curl -s https://api.github.com/repos/prometheus/prometheus/releases/latest | grep browser_download_url | grep linux-amd64 | cut -d '"' -f 4) | |
wget -qi – $PROM_LATEST | |
tar xvf prometheus*.tar.gz |
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
apt update && apt upgrade -y | |
apt install apache2 -y | |
systemctl status apache2 --no-pager | |
apt install mariadb-server mariadb-client -y | |
apt install php php-mysql -y | |
mysql -u root -p'root' -e'CREATE DATABASE wordpress_db;' | |
mysql -u root -p'root' -e"CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'password'"; | |
mysql -u root -p'root' -e"GRANT ALL ON wordpress_db.* TO 'wp_user'@'localhost' IDENTIFIED BY 'password'"; | |
mysql -u root -p'root' -e"FLUSH PRIVILEGES"; |
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
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: external-dns | |
namespace: default | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: external-dns |
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
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: external-dns | |
namespace: default | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: external-dns |
NewerOlder