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 | |
# Returns host IP for AWS EC2 | |
curl http://169.254.169.254/latest/meta-data/public-ipv4 |
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
{ | |
"annotations": { | |
"list": [ | |
{ | |
"builtIn": 1, | |
"datasource": "-- Grafana --", | |
"enable": true, | |
"hide": true, | |
"iconColor": "rgba(0, 211, 255, 1)", | |
"name": "Annotations & Alerts", |
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
- alert: container_down | |
expr: absent(container_last_seen{job="cadvisor",name="rabbitmq"}) | |
for: 30s | |
labels: | |
severity: critical | |
annotations: | |
summary: "Container down" | |
description: "{{ $labels.instance }} {{ $labels.name }} container is down for more than 30 seconds." |
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
# | |
# Based on https://hub.docker.com/_/sonarqube | |
# | |
version: "3.7" | |
services: | |
sonarqube: | |
container_name: sonarqube |
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 | |
aws ecr get-login --no-include-email | sh | |
# to read the authentication string only, so it can be used in apps. | |
#aws ecr get-authorization-token --output text --query 'authorizationData[].authorizationToken' --region eu-central-1 \ | |
# | base64 -d | cut -d: -f2 |
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 | |
# Creates Jenkins credentials with username and password, | |
# made for Harbor Robot Accounts, but can be used for any username/password json file | |
# @author thabet.amer@gmail.com | |
# @since Jenkins 2.222.1 | |
# @params json file with {"name":"","token":""} tags | |
# @output Jenkins credential with ID name "harbor-NAME" |
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 groovy | |
/* | |
* Runs shell command and prints back stdout and stderr | |
*/ | |
command='ls -al' | |
println new ProcessBuilder('sh','-c',command).redirectErrorStream(true).start().text |
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 | |
# tested on Mongo 3.6 | |
DB='test' | |
USR='admin' | |
PSW='admin'' | |
BACKUP_FOLDER="$DB-backup" | |
COLLECTIONS=$(mongo localhost:27017/$DB -u $USR -p $PSW --authenticationDatabase admin --quiet --eval "db.getCollectionNames()" | tr -d '\[\]\"[:space:]' | tr ',' ' ') |
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 | |
# Copies all tagged images with defined tag to a new one - using Harbor Retag feature. | |
# config vars | |
SRC_TAG="latest" | |
DST_TAG="v1" | |
HARBOR_API_URL="https://hostname/api" | |
HARBOR_USR="username" | |
HARBOR_PSW="password" |
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
# | |
# Enables SMTP Auth for Office365 emails, so you can send emails via a script for application. | |
# Shall be run via Powershell terminal. | |
# | |
# Define your email address that will send emails via SMTP auth | |
$emailAddress = 'test@test.com' | |
# asks for email/password | |
$UserCredential = Get-Credential |