Skip to content

Instantly share code, notes, and snippets.

View michaelact's full-sized avatar
🧐
Who are you?

michaelact

🧐
Who are you?
View GitHub Profile
@michaelact
michaelact / build.sh
Last active November 25, 2021 08:51
Install NPM package from artifact registry inside Container Image | Must be have Service Account file!
#!/bin/bash
set -e
gcloud auth activate-service-account \
--project=$GCP_PROJECT \
--key-file=${GCP_KEY_FILENAME:-service_account.json}
gcloud artifacts print-settings npm \
--project=$GCP_PROJECT \
@michaelact
michaelact / filebeat.yml
Last active October 1, 2021 15:46
Filebeat configuration depends on environment variables. Use case: when you want to run multiple filebeat service but in 1 created docker image. Let's contribute to provide a lot of flexibility configuration!
filebeat.inputs:
- type: container
paths:
- "/usr/share/dockerlogs/data/*/*.log"
ignore_older: ${IGNORE_OLDER:10m}
multiline.pattern: ${MULTILINE_PATTERN}
multiline.negate: ${MULTILINE_NEGATE:false}
multiline.match: ${MULTILINE_MATCH:after}
processors:
@michaelact
michaelact / main.tf
Created August 3, 2021 14:58
Integrate your github.com/localstack/localstack with Terraform!
provider "aws" {
region = "us-east-1"
s3_force_path_style = true
skip_credentials_validation = true
skip_metadata_api_check = true
skip_requesting_account_id = true
endpoints {
apigateway = "http://localhost:4567"
cloudformation = "http://localhost:4581"
@michaelact
michaelact / bar-docker-debian.sh
Last active July 5, 2021 04:52
How to backup your Docker Swarm Cluster?
#!/bin/bash
service docker stop
if [ $# -eq 2 ]
then
if [ $1 = 'backup' ]
then
tar -czvf $2 /var/lib/docker/swarm
elif [ $1 = 'restore' ]