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
let VMs = Heartbeat | |
| where OSType == 'Linux' | |
and Category != 'Azure Monitor Agent' | |
and ResourceId != '' | |
| project Computer, TimeGenerated, ClusterId = substring(Computer, 0, 20), VM = tostring(split(ResourceId, "/")[-1]) | |
| summarize arg_max(TimeGenerated, *) by Computer; | |
let Clusters = DatabricksClusters | |
| where ActionName in ('create', 'startResult') | |
| extend ResponseTxt = parse_json(Response) | |
| where ResponseTxt.statusCode == 200 |
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
let ClustersInitializations = DatabricksClusters | |
| distinct ActionName, Response, RequestParams, TimeGenerated | |
| where ActionName in ('create', 'start', 'restart') and TimeGenerated > ago(30d) | |
| extend ResponseTxt = parse_json(Response) | |
| where ResponseTxt.statusCode == 200 | |
| extend ResponseResultTxt = parse_json(tostring(ResponseTxt.result)) | |
| extend RequestParamsTxt = parse_json(RequestParams) | |
| project ClusterId = case(ActionName == 'create', ResponseResultTxt.cluster_id, | |
ActionName in ('start', 'restart'), RequestParamsTxt.cluster_id, ''), | |
InitializationTime = TimeGenerated, |
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 | |
log_file=snyk-scan-$(date '+%s%3N').log | |
export SNYK_TOKEN=$1 | |
private_docker_registry=$2 | |
nexus_repo_url=$3 | |
log() { | |
printf "$(date '+%F %T') - %s\n" "$1" | |
} |
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
#!/usr/bin/python3 | |
from datetime import datetime | |
import logging | |
import os | |
import requests | |
def get_params(): | |
if 'JENKINS_URL' not in os.environ or 'JENKINS_ADMIN_USERNAME' not in os.environ or 'JENKINS_ADMIN_PASSWORD' not in os.environ: |
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
version: '3' | |
services: | |
mysql: | |
image: mariadb:10.3.12 | |
container_name: mysql | |
restart: always | |
volumes: | |
- mysql_data:/var/lib/mysql | |
environment: |
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
--- | |
- hosts: localhost | |
gather_facts: no | |
vars: | |
aws_region: "eu-west-2" | |
tasks: | |
- name: Find Ubuntu Server 18.04 LTS AMIs | |
ec2_ami_facts: | |
region: '{{ aws_region }}' | |
owners: 099720109477 |
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
--- | |
- hosts: remote | |
gather_facts: no | |
tasks: | |
- name: Make the volumes backup | |
archive: | |
path: /var/lib/docker/volumes | |
dest: volumes.tar.gz | |
- name: Make the backup available (requires vault-password-file) | |
uri: |
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 | |
docker run --name openldap -d -p 389:389 osixia/openldap:1.2.1 | |
if [ $? -ne 0 ]; then | |
echo "Error on running the OpenLDAP Docker image." | |
exit 1 | |
fi | |
until ldapsearch -x -b dc=example,dc=org -D cn=admin,dc=example,dc=org -w admin | grep "dn: dc=example,dc=org" | |
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
FROM jenkins/jenkins:lts | |
LABEL maintainer "Gustavo Muniz do Carmo <[email protected]>" | |
ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false" | |
COPY config-maven.groovy /usr/share/jenkins/ref/init.groovy.d/ | |
COPY config-sonarqube.groovy /usr/share/jenkins/ref/init.groovy.d/ | |
COPY harden-jenkins.groovy /usr/share/jenkins/ref/init.groovy.d/ | |
COPY default-user.groovy /usr/share/jenkins/ref/init.groovy.d/ |
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
--- | |
- name: Install the Zabbix agent | |
yum: | |
name: http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-agent-3.4.8-1.el7.x86_64.rpm | |
- name: Configure the Zabbix agent | |
replace: | |
path: /etc/zabbix/zabbix_agentd.conf | |
regexp: '{{item.regexp}}' | |
replace: '{{item.replace}}' | |
with_items: |
NewerOlder