Skip to content

Instantly share code, notes, and snippets.

View balvisio's full-sized avatar

Bruno Alvisio balvisio

View GitHub Profile
@balvisio
balvisio / casesafe.sh
Created December 13, 2017 14:52 — forked from scottsb/casesafe.sh
Create and manage a case-sensitive disk-image on macOS (OS X).
#!/bin/bash
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
MOUNT_POINT="${CASE_SAFE_MOUNT_POINT:-${HOME}/casesafe}"
VOLUME_PATH="${CASE_SAFE_VOLUME_PATH:-${HOME}/.casesafe.dmg.sparseimage}"
VOLUME_NAME="${CASE_SAFE_VOLUME_NAME:-casesafe}"
VOLUME_SIZE="${CASE_SAFE_VOLUME_SIZE:-60g}"

FWIW: I didn't produce the content present here. I've just copy-pasted it from somewhere over the Internet, but I cannot remember exactly the original source. I was also not able to find the author's name, so I cannot give him/her the proper credit.


Effective Engineer - Notes

What's an Effective Engineer?

@balvisio
balvisio / ca.md
Created April 7, 2019 19:13 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@balvisio
balvisio / explanation.md
Created June 16, 2019 15:42 — forked from masak/explanation.md
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@balvisio
balvisio / gist:adeaf5757e967e8a7c8ad8426b8687a7
Created December 8, 2019 17:56
How to capture HTTP2 packages using Wireshark
gRPC is based on HTTP/2. So we have to analyze packages to solve some difficult problems related to the protocol. This wiki introduces how to do this using Wireshark because capturing packages of HTTP/2 is a little different with HTTP/TCP.
HTTP/2 via TLS is not covered in this wiki
Download Wireshark of recent versions.
Add your port to HTTP protocols:
Open Preferences
Select Protocols>HTTP. HTTP2 works too, but HTTP is enough
Add your HTTP/2 port like(50051) to TCP ports
Click OK to save the config
@balvisio
balvisio / segmentation_metrics.py
Created August 31, 2021 19:24 — forked from ilmonteux/segmentation_metrics.py
Semantic segmentation metrics in Keras and Numpy. IoU, Dice in both soft and hard variants. Mean metrics for multiclass prediction. See https://ilmonteux.github.io/2019/05/10/segmentation-metrics.html for discussion
import numpy as np
import keras.backend as K
import tensorflow as tf
def metrics_np(y_true, y_pred, metric_name, metric_type='standard', drop_last = True, mean_per_class=False, verbose=False):
"""
Compute mean metrics of two segmentation masks, via numpy.
IoU(A,B) = |A & B| / (| A U B|)
Dice(A,B) = 2*|A & B| / (|A| + |B|)
@balvisio
balvisio / mlflow_deployment_instructions.md
Last active January 29, 2024 17:30
Instructions to create a MLflow server in AWS

Types of MLflow Server Setups

There are multiple variants with respect to how the artifacts are handled: (Reference: https://mlflow.org/docs/latest/tracking.html#how-runs-and-artifacts-are-recorded)

a. In this scenario, for artifact logging, the MLflow client interacts with the remote Tracking Server and artifact storage host:

  • The MLflow client uses RestStore to send a REST request to fetch the artifact store URI location from the Tracking Server
  • The Tracking Server responds with an artifact store URI location (an S3 storage URI in this case)
  • The MLflow client creates an instance of an S3ArtifactRepository, connects to the remote AWS host using the boto client libraries, and uploads the artifacts to the S3 bucket URI location

Direct Access to Artifact Store

@balvisio
balvisio / foo.sh
Created August 12, 2022 18:10 — forked from waylan/foo.sh
Simple bash subcommands. Each subcommand is implemented as a function. For example, `sub_funcname` is called for `funcname` subcommand.
#!/bin/sh
ProgName=$(basename $0)
sub_help(){
echo "Usage: $ProgName <subcommand> [options]\n"
echo "Subcommands:"
echo " bar Do bar"
echo " baz Run baz"
echo ""