Skip to content

Instantly share code, notes, and snippets.

View devndive's full-sized avatar
🎯
Focusing

Yann Duval devndive

🎯
Focusing
View GitHub Profile
@devndive
devndive / top-five-commands.sh
Created November 21, 2019 18:24
Show the top 5 used commands base on your history
#!/bin/bash
history \
| awk '{ CMD[$2]++; count++; }END { for(a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a; }' \
| grep -v "./" \
| column -c3 -s " " -t \
| sort -nr \
| nl \
| head -n5
@devndive
devndive / consumer.go
Created November 14, 2022 21:06
Very simple consumer and producer for messages in a amqp queue
package main
import (
"context"
"fmt"
"log"
"time"
"github.com/Azure/go-amqp"
)