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
@ErickWendel
ErickWendel / linkedin-post-analytics-example.mjs
Last active July 22, 2022 12: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 = {
@noamtamim
noamtamim / README.md
Last active July 9, 2024 08:45
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.

@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.

@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" />
@JustinShenk
JustinShenk / idle-shutdown.sh
Last active July 10, 2024 12:12
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
@dannguyen
dannguyen / schemacrawler-sqlite-macos-howto.md
Last active June 30, 2024 18:52
How to use schemacrawler to generate schema diagrams for SQLite from the commandline (Mac OS)
@krnd
krnd / .style.yapf
Last active February 25, 2022 04:20
python-yapf
# .style.yapf
#
# DESCRIPTION
# Configuration file for the python formatter yapf.
#
# This configuration is based on the generic
# configuration published on GitHub.
#
# AUTHOR
# krnd
@stianlagstad
stianlagstad / pyodbc in Docker with MySQL and Oracle
Created December 21, 2017 21:47
This Dockerfile should get you going with pyodbc in Docker with the drivers to talk to MySQL and Oracle databases
FROM python:3
WORKDIR /usr/src/app
# Copy over the drivers
# MySQL ODBC Ansi
COPY drivers/mysql-connector-odbc-5.3.9-linux-ubuntu16.04-x86-64bit.tar.gz .
# Oracle 11.2
COPY drivers/oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm .
COPY drivers/oracle-instantclient11.2-odbc-11.2.0.4.0-1.x86_64.rpm .
@mariocj89
mariocj89 / python-logging.md
Last active June 16, 2024 16:51
Understanding logging in Python

Logging trees

Introduction

When applications are running in production, they become black boxes that need to be traced and monitored. One of the simplest, yet main, ways to do so is logging. Logging allows us - at the time we develop our software - to instruct the program to emit information while the system is running that will be useful for us and our sysadmins.

gcloud compute instance-groups unmanaged create taiwan \
--zone asia-east1-a
gcloud compute instance-groups unmanaged add-instances taiwan \
--instances $(kubectl get nodes \
--context taiwan \
--output=jsonpath='{range .items[*]}{.metadata.name},{end}') \
--zone asia-east1-a
gcloud compute instance-groups set-named-ports taiwan \