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 / ap-5r-launch.sh
Created February 17, 2018 04:18
ap-5r-launch.sh
#!/bin/bash
# Settings
SWGOH_USER=
SWGOH_PASS=
BOT1_TOKEN=
BOT2_TOKEN=
# First Instance
docker run --rm -it --name bot1 \
@ronoaldo
ronoaldo / Slic3r_bundle_20190902.ini
Created September 2, 2019 12:55
Slic3r Settings - 2019-09-02
# generated by Slic3r 1.3.1-dev on Mon Sep 2 09:47:57 2019
[filament:3D Prime - PETG]
bed_temperature = 0
bridge_fan_speed = 75
compatible_printers =
cooling = 1
disable_fan_first_layers = 3
end_filament_gcode = "; Filament-specific end gcode \n;END gcode for filament\n"
extrusion_multiplier = 1
@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";
@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 / 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 / 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 / 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 / dialogflow.sh
Last active November 1, 2021 13:50
Sample Dialogflow CX client library in Bash
#!/bin/bash
# Copyright 2021 Ronoaldo JLP <[email protected]>
# 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 / 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 / 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