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
To add the repo: | |
argocd repo add https://github.com/foxutech/kubernetes.git --username foxutech --password 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 | |
To create a application: | |
# argocd app create kustom-check --repo https://github.com/foxutech/kubernetes.git --path kustomize/overlays/prod/ --dest-server https://kubernetes.default.svc --dest-namespace argocdtest | |
To Add the Cluster to ArgoCD | |
# argocd cluster add staging-azure | |
To check the list of Clusters |
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 | |
# bash script to send messages to Microsoft Teams. | |
function usage { | |
echo "ALERT!" | |
echo "description: send messages to Microsoft Teams channels" | |
echo "special notes: You'll need to change the teamsUrl variable to contain your webhook from Teams." | |
echo "usage: ${0} -b \"Message contents\"" | |
echo " -m Message body" | |
echo " -h This help info" | |
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
import boto3 | |
import datetime | |
def lambda_handler(event, context): | |
print("Connecting to RDS") | |
client = boto3.client('rds') | |
for snapshot in client.describe_db_snapshots(DBInstanceIdentifier='test-db-final', MaxRecords=5)['DBSnapshots']: | |
if create_ts < datetime.datetime.now - datetime.timedelta(days=3): | |
print ("Deleting snapshot id:", snapshot['DBSnapshotIdentifier']) |
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 datetime import datetime, timedelta, timezone | |
import boto3 | |
class Ec2Instances(object): | |
def __init__(self, region): | |
print("region "+ region) | |
self.ec2 = boto3.client('ec2', region_name=region) | |
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
Step1: On management node, create the config file(if not exists) | |
# vim /var/lib/mysql-cluster/config.ini {{ replace IP with your node server hostname/IP }} | |
[[ copy the config.ini file in attachment ]] | |
We can now start the manager by executing the ndb_mgmd binary and specifying its config file using the -f flag: | |
# ndb_mgmd -f /var/lib/mysql-cluster/config.ini | |
Step2: enable executable permission to the script |
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 | |
hostname=foxu.tech | |
sleep_time=2 | |
count=0 | |
success_count=0 | |
max_count=$((1*6)) | |
while [ $count -lt $max_count ]; | |
do |
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 | |
set -e | |
CLUSTER= | |
FAMILY= | |
taskdef=$(aws ecs list-task-definitions --output text --query taskDefinitionArns[0]) | |
for i in $taskdef; do | |
echo taskdef = $taskdef | |
if [ "$taskdef" == "None" ]; then |
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 | |
set -e | |
source /etc/ecs/ecs.config | |
CONTAINERS_ID=$(aws ecs list-container-instances --cluster $ECS_CLUSTER --output text --query 'containerInstanceArns') | |
echo $(CONTAINERS_ID) | |
INSTANCE_ID=$(curl http://169.254.169.254/latest/meta-data/instance-id) | |
echo $(INSTANCE_ID) | |
DATE=$(date +%Y-%m-%d-%H:%M) | |
read -p "enter aws-account-id: " aws-account-id | |
read -p "enter SNS topic: " topic |
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
import xlrd | |
from lxml import etree | |
import xml.etree.ElementTree as ET | |
# create the file structure | |
data = ET.Element('openSCENERIO') | |
wb = xlrd.open_workbook("sample.xlsx") | |
sh = wb.sheet_by_index(0) | |
conditiongroup = "" | |
condition = "" |
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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: logging-configmap | |
namespace: logging | |
data: | |
logstash.yml: | | |
http.host: "0.0.0.0" | |
path.config: /usr/share/logstash/pipeline | |
## Disable X-Pack |
NewerOlder