Skip to content

Instantly share code, notes, and snippets.

View zored's full-sized avatar
🏠
Working from home

Robert Akhmerov zored

🏠
Working from home
View GitHub Profile
@zored
zored / script.sh
Created August 23, 2021 12:40
Safe bash
#!/usr/bin/env bash
set -ETexuo pipefail
shopt -s inherit_errexit
# -e - stop on error.
# -E - traps will work with -e.
# -x - debug output each command.
# -u - error on unexpected variables.
# -o pipefail - handle errors of '|'.
# -s inherit_errexit - fail in subshell failures.
@zored
zored / main.go
Created May 13, 2022 15:08
Kill frozen dlv --headless on macOS
package main
import (
"fmt"
"github.com/mitchellh/go-ps"
"os"
"os/signal"
"syscall"
"time"
)