Skip to content

Instantly share code, notes, and snippets.

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

Marcelo Costa mesmacosta

🏠
Working from home
View GitHub Profile
@justinshenk
justinshenk / idle-shutdown.sh
Last active October 28, 2025 17:01
Google Cloud Platform (GCP) instance idle shutdown
#!/bin/bash
# Add to instance metadata with `gcloud compute instances add-metadata \
# instance-name --metadata-from-file startup-script=idle-shutdown.sh` and reboot
# NOTE: requires `bc`, eg, sudo apt-get install bc
# Modified from https://stackoverflow.com/questions/30556920/how-can-i-automatically-kill-idle-gce-instances-based-on-cpu-usage
threshold=0.1
count=0
wait_minutes=60
while true
@mesmacosta
mesmacosta / encoder
Last active September 8, 2018 23:25
Loggings springboot
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include
resource="org/springframework/boot/logging/logback/base.xml" />
<include
resource="org/springframework/boot/logging/logback/defaults.xml" />
<springProperty scope="context" name="springAppName"
source="spring.application.name" />
@chrislovecnm
chrislovecnm / gke-ip-aliasing-networking-example.asc
Last active April 30, 2021 14:18
GKE IP Aliasing Example

GKE IP Alaising Example

This is a demo of creating the subnets needed for a GKE Cluster

Create The Network

Create the base network for GKE.

@noamtamim
noamtamim / README.md
Last active May 6, 2026 02:10
Markdown with PlantUML

How to use PlantUML with Markdown

PlantUML is a really awesome way to create diagrams by writing code instead of drawing and dragging visual elements. Markdown is a really nice documentation tool.

Here's how I combine the two, to create docs with embedded diagrams.

Step 0: Setup

Get the command-line PlantUML from the download page or your relevant package manager.

@ErickWendel
ErickWendel / linkedin-post-analytics-example.mjs
Last active April 1, 2026 09:00
Example of how to get post Analytics such as Views from a Linkedin post
// paste this file on a empty directory
// npm i axios
// You should go to your browser on Cookie session and get JSESSIONID and li_at from Linkedin Section
const JSESSIONID = 'YOUR JSESSIONID'
const liAT = 'YOUR li_at'
import axios from 'axios'
const headers = {