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 | |
output_csv="aerospike_cluster_stats.csv" | |
# Check if the output CSV exists and if not, write the header | |
if [[ ! -f "$output_csv" ]]; then | |
echo "Node,Namespace,Device Total Bytes,Device Total (MB/GB/TB),Device Used Bytes,Device Used (MB/GB/TB),Device Free %,Device Available %,High Water Disk %,Memory Total Bytes,Memory Total (MB/GB/TB),Memory Used Bytes,Memory Used (MB/GB/TB),Memory Free %,High Water Memory %,Stop Writes %" > "$output_csv" | |
else | |
mv -f "$output_csv" "${output_csv}-$(date +%s)" | |
echo "Node,Namespace,Device Total Bytes,Device Total (MB/GB/TB),Device Used Bytes,Device Used (MB/GB/TB),Device Free %,Device Available %,High Water Disk %,Memory Total Bytes,Memory Total (MB/GB/TB),Memory Used Bytes,Memory Used (MB/GB/TB),Memory Free %,High Water Memory %,Stop Writes %" > "$output_csv" |
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
list_vm_gcp() { | |
gcloud compute instances list --project $1 '--format=json(NAME:sort=0,ZONE:sort=1,MACHINE_TYPE,PREEMPTIBLE,INTERNAL_IP,EXTERNAL_IP,STATUS,creationTimestamp:sort=2)' | jq -r '.[] |[.name, (.zone | split("/")[-1]), (.machineType | split("/")[-1]), .scheduling.preemptible, .networkInterfaces[0].networkIP, (.networkInterfaces[0].accessConfigs[0].natIP // "N/A"), .status, .creationTimestamp] | @tsv'| sort -t$'\t' -k8,8 -k2,2 -k1,1 | column -t | |
} |
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
#python3 /custom-scripts/gmail_attachment_download.py --download_dir /opt/gmail_attachment_download/ --target_subject ".*spending.*" --start_date "16-May-2024" --end_date "18-May-2024" | |
#python3 /custom-scripts/gmail_attachment_download.py --download_dir /opt/gmail_attachment_download/ --target_subject ".*spending.*" | |
#python3 /custom-scripts/gmail_attachment_download.py -h | |
import imaplib | |
import email | |
import os | |
import argparse | |
import re | |
from datetime import datetime, timedelta |
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 install epel-release | |
sudo yum install certbot-nginx | |
#if it is not working, follow the below steps: | |
sudo python3 -m venv /opt/certbot/ | |
sudo /opt/certbot/bin/pip install --upgrade pip | |
sudo /opt/certbot/bin/pip install certbot certbot-nginx | |
sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot | |
sudo certbot --nginx | |
sudo systemctl reload nginx |
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 | |
# Get the hostname | |
host=$(hostname -i) | |
# Set the input variable based on the hostname | |
if [[ $host == *"172.16.25.137"* ]]; then | |
input="m1=172.16.25.137:8001, s-m2=172.16.25.138:7001, s-m3=172.16.25.139:6001" | |
elif [[ $host == *"172.16.25.138"* ]]; then | |
input="m2=172.16.25.138:8002, s-m1=172.16.25.137:7002, s-m3=172.16.25.139:6002" |
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 | |
function list_folders_recursive { | |
local folder="$1" | |
# Fetch folder names | |
local folders=$(gcloud resource-manager folders list --folder="$folder" --format="csv[no-heading](name)") | |
# Check if folders is empty | |
if [ -z "$folders" ]; then | |
return |
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://medium.com/@rakeshsaw/workload-identity-secured-way-to-access-google-cloud-apis-from-gke-workloads-44882ec5036a | |
#https://luandy-4171.medium.com/how-does-gke-workload-identify-work-with-iam-service-account-b996656284f8 | |
#https://stackoverflow.com/questions/75948510/access-to-google-cloud-storage-from-an-autopilot-gke-cluster | |
#https://bijukunjummen.medium.com/gke-autopilot-and-workload-identity-a2732cf256de | |
#https://docs.ray.io/en/latest/cluster/kubernetes/user-guides/gke-gcs-bucket.html | |
# Set variables | |
CLUSTER_NAME="<YOUR_CLUSTER_NAME>" | |
PROJECT_ID="<YOUR_PROJECT_ID>" | |
NAMESPACE="default" # Change if your workloads are deployed in a different namespace |
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
DECLARE active_logical_price_per_gb NUMERIC DEFAULT 0.02; | |
DECLARE long_term_logical_price_per_gb NUMERIC DEFAULT 0.01; | |
DECLARE active_physical_price_per_gb NUMERIC DEFAULT 0.04; | |
DECLARE long_term_physical_price_per_gb NUMERIC DEFAULT 0.02; | |
WITH storage AS | |
( | |
SELECT DISTINCT | |
tb.table_schema AS dataset, | |
tb.table_name, | |
total_rows, |
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
upstream fastcgi_backend { | |
server unix:/run/php/php7.4-fpm.sock; | |
} | |
server { | |
server_name example.com; | |
listen 127.0.0.1:8080; | |
set $MAGE_ROOT /var/www/html/webfolder; | |
fastcgi_buffers 16 16k; | |
fastcgi_buffer_size 32k; |
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
{ | |
graphitePort: 2003, | |
graphiteHost: "graphite", | |
port: 8125, | |
mgmt_adress: "127.0.0.1", | |
mgmt_port: 8126, | |
backends: [ "./backends/graphite" ], | |
graphite: { | |
legacyNamespace: false, | |
globalPrefix: "stats", |
NewerOlder