Skip to content

Instantly share code, notes, and snippets.

Working hard

Francesco fvigotti

Working hard
Block or report user

Report or block fvigotti

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
fvigotti / FluxDeadLockInvestigation.kt
Created Jul 2, 2019
investigating deadlock in kotlin
View FluxDeadLockInvestigation.kt
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 / Postfix: sender-dependent SASL
Created Oct 26, 2018 — forked from zmwangx/Postfix: sender-dependent SASL
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)
View Postfix: sender-dependent SASL

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):

    # sender-dependent sasl authentication
    smtp_sender_dependent_authentication = yes
    sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
fvigotti /
Created Oct 1, 2018
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
function convert_to_standardnotation(){
# convert number from scientific notation to standar d( ie '1.5383780136826127e+09' )
printf '%.0f' $1
fvigotti / docker.service
Created Sep 13, 2018
graceful docker/kubernetes shutdown sample
View docker.service
Description=Docker Application Container Engine
Documentation= docker.socket
View print2mlines
while [ $i -lt 1000000000 ]
echo line $i
View allinone-hostnetwork-dp1.yaml
apiVersion: extensions/v1beta1
kind: Deployment
app: hostn-hndp
name: hostn-hndp
replicas: 1
View hostn-nodeport-dp.yaml
apiVersion: extensions/v1beta1
kind: Deployment
app: hostn-port
name: hostn-port
replicas: 1
fvigotti / fabric.plugin.zsh
Created Sep 13, 2016 — forked from AdrienLemaire/fabric.plugin.zsh
zsh-completion for Fabric in Oh-my-zsh
View fabric.plugin.zsh
#compdef fab
_targets() {
_describe -t commands "fabric targets" target_list
'status: Status messages, i.e. noting when Fabric is done running, if the user used a keyboard interrupt, or when servers are disconnected from. These messages are almost always relevant and rarely verbose.'
'aborts: Abort messages. Like status messages, these should really only be turned off when using Fabric as a library, and possibly not even then. Note that even if this output group is turned off, aborts will still occur – there just won’t be any output about why Fabric aborted!'
'warnings: Warning messages. These are often turned off when one expects a given operation to fail, such as when using grep to test existence of text in a file. If paired with setting env.warn_only to True, this can result in fully silent warnings when remote programs fail. As with aborts, this setting does not control actual warning behavior, only whether warning messages are printed or hidden.'
#!/usr/bin/env bash
for (( i=0;i<$ELEMENTS;i++)); do
echo '['$i']'${args[${i}]}'[/'$i']'
View error log
Jul 14 09:57:38 $NODE-HOSTNAME kubelet[1442]: I0714 09:57:38.454172 1442 operation_executor.go:720] MountVolume.SetUp succeeded for volume "" (spec.Name: "default-t
Jul 14 09:57:39 $NODE-HOSTNAME kernel: docker0: port 3(veth47cdf81) entered forwarding state
Jul 14 09:57:57 $NODE-HOSTNAME kubelet[1442]: I0714 09:57:57.879807 1442 kubelet.go:2541] SyncLoop (UPDATE, "api"): "jenkins-0_default(5cb3cdcb-49a9-11e6-8f75-fa163e7741de):DeletionTimestamp=2016-07-14T09
Jul 14 09:57:57 $NODE-HOSTNAME kubelet[1442]: I0714 09:57:57.881866 1442 docker_manager.go:1326] Killing container "fd46b633dea6087146f32bf6b4948d6cc1510ee254628e0568aa56bd0b68092f helper default/jenkins-
Jul 14 09:57:57 $NODE-HOSTNAME kubelet[1442]: I0714 09:57:57.987596 1442 kubelet.go:2544] SyncLoop (REMOVE, "api"): "jenkins-0_default(5cb3cdcb-49a9-11e6-8f75-fa163e7741de)"
Jul 14 09:57:57 $NODE-HOSTNAME kubelet[1442]: I0714 09:57:57.988276 1442 kubelet.go:2312] Killing unwanted pod "jenkins-0"
You can’t perform that action at this time.