Skip to content

Instantly share code, notes, and snippets.

View fvigotti's full-sized avatar
😊
Working hard

Francesco fvigotti

😊
Working hard
View GitHub Profile
@fvigotti
fvigotti / cifs-clean.sh
Last active May 12, 2018 16:35
cifs flexvolume
#!/bin/bash
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@fvigotti
fvigotti / Postfix: sender-dependent SASL authentication.md
Created October 26, 2018 14:21 — forked from zmwangx/Postfix: sender-dependent SASL authentication.md
Postfix: sender-dependent SASL authentication — relay to multiple SMTP hosts, or relay to the same host but authenticate as different users (e.g., two Gmail accounts)

This is a sequel to "Postfix: relay to authenticated SMTP".

I would like to send mail from two different Gmail accounts using Postfix. Here is the relevant section in the Postfix documentation: Configuring Sender-Dependent SASL authentication.

As a concrete example, here's how to set up two Gmail accounts (only relevant sections of the config files are listed below):

/etc/postfix/main.cf:
    # sender-dependent sasl authentication
    smtp_sender_dependent_authentication = yes

sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay

@fvigotti
fvigotti / docker.service
Created September 13, 2018 07:21
graceful docker/kubernetes shutdown sample
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=network.target docker.socket
Wants=docker.socket
[Service]
Type=notify
Environment=GOTRACEBACK=crash
@fvigotti
fvigotti / FluxDeadLockInvestigation.kt
Created July 2, 2019 07:31
investigating deadlock in kotlin
package net.FluxDeadLockInvestigation
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.reactor.asFlux
import org.junit.jupiter.api.Test
import reactor.core.scheduler.Schedulers
class FluxDeadLockInvestigation(){
@fvigotti
fvigotti / rofi_builder.md
Created March 26, 2021 15:44
rofi builder dockerized

hi to everyone, If you hade issues finding a compiled binary of rofi, and your package manager isn't updated.. you may need this useful

this create a temp docker container and build rofi, the built binary than is taken from the container and replaced in the host.. let me know if you have a better solution

docker run --rm -ti --name rofibuild ubuntu:20.04 bash 

apt update && apt upgrade &&  
apt install  -y rofi-dev qalc libtool  \
git \
pkg-config \
@fvigotti
fvigotti / purge_prom_pushgateway.sh
Created October 1, 2018 13:56
this is a sample script that clean old metrics from pushgateway, not very clean but working anyway, used as sample in a issue
trap 'echo "got sigterm" ; exit 0' SIGTERM
EXPIRATION_SECONDS=${EXPIRATION_SECONDS:-900}
PGW_URL=${PGW_URL:-http://pushgateway}
function convert_to_standardnotation(){
# convert number from scientific notation to standar d( ie '1.5383780136826127e+09' )
printf '%.0f' $1
}