Skip to content

Instantly share code, notes, and snippets.

View ronoaldo's full-sized avatar
🏠
Working from home

Ronoaldo Pereira ronoaldo

🏠
Working from home
View GitHub Profile
@ronoaldo
ronoaldo / bigtable.go
Created April 17, 2024 13:32
Demo - Cloud Bigtable from Go - Basic CRUD/Filter operations!
package main
import (
"context"
"flag"
"fmt"
"log"
"os"
"strings"
@ronoaldo
ronoaldo / multiarch.yaml
Created June 28, 2022 23:31
Github Workflow to build and push multiarch docker image
name: Create and publish a multiarch Docker image
on:
push:
branches:
- 'main'
- 'issue**'
- '**/issue**'
env:
@ronoaldo
ronoaldo / Dockerfile
Created May 31, 2022 20:19
MariaDB com acesso externo
FROM debian:bullseye
# Install do server
ENV DEBIAN_FRONTEND=noninteractive
RUN echo "mariadb-server mysql-server/root_password password 123456" | debconf-set-selections
RUN echo "mariadb-server mysql-server/root_password_again password 123456" | debconf-set-selections
RUN apt-get update && apt-get install mariadb-server -yq
# Configuração do acesso externo ao container
RUN sed -e 's/bind-address.*/bind-address = 0.0.0.0/g' -i /etc/mysql/mariadb.conf.d/50-server.cnf
@ronoaldo
ronoaldo / export-all-scc-findings.sh
Created November 24, 2021 21:00
Export all Google Cloud Security Command Center findings into a CSV file for easy management.
#!/usr/bin/env bash
# This script exports to the standard output all the security command center findings
# that you may have in your all your Google cloud organizations, in a CSV format.
gcloud organizations list --format='value(name)' | while read ORGANIZATION_ID ; do
gcloud scc findings list $ORGANIZATION_ID \
--format='csv(finding.category, finding.severity, finding.state, finding.eventTime, finding.externalUri)'
done
@ronoaldo
ronoaldo / dialogflow.sh
Last active November 1, 2021 13:50
Sample Dialogflow CX client library in Bash
#!/bin/bash
# Copyright 2021 Ronoaldo JLP <ronoaldo@gmail.com>
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
@ronoaldo
ronoaldo / clouddns-update
Created April 15, 2021 22:31
Update clouddns at boot/shutdown
#!/bin/bash
### BEGIN INIT INFO
# Provides: boxdns
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Updates the DNS dynamically
# Description: Updates the DNS of the box dynamically
@ronoaldo
ronoaldo / minetest-run.sh
Last active March 9, 2022 00:54
Using minetest with tmux and systemd
#!/bin/sh
while true ; do
echo "Starting server ..."
minetestserver --terminal
echo "Server crashed/terminated. Restarting ..."
sleep 3
done
@ronoaldo
ronoaldo / launch-gc-vm.sh
Last active April 21, 2021 00:45
Launch compute engine instance when connecting via SSH
#!/bin/bash
set -x
# Get command options
export project="$1"
export zone="$2"
export vm="$3"
echo "Launching instance $project/$zone/$vm ..."
# Alias with project/zone options
@ronoaldo
ronoaldo / plymouth-preview
Created November 12, 2020 23:06
Plymouth theme preview tool for Debian/Ubuntu
#!/bin/bash
# Check root
if [ ! $( id -u ) -eq 0 ]; then
echo Must be run as root. Trying sudo $0 $@
exec sudo $0 $@
exit $?
fi
# Install dependencies
@ronoaldo
ronoaldo / 50unattended-upgrades
Last active November 8, 2020 15:50
Follow kernel and firmware from debian backports
Unattended-Upgrade::Origins-Pattern {
"origin=Debian,codename=${distro_codename},label=Debian";
"origin=Debian,codename=${distro_codename},label=Debian-Security";
"o=Debian Backports,a=${distro_codename}-backports,l=Debian Backports";
};
Unattended-Upgrade::Package-Blacklist {
};
Unattended-Upgrade::AutoFixInterruptedDpkg "true";
Unattended-Upgrade::MinimalSteps "true";
Unattended-Upgrade::Remove-Unused-Dependencies "true";