Skip to content

Instantly share code, notes, and snippets.

View andboson's full-sized avatar
🌴

Andrii Bosonchenko andboson

🌴
  • Cherkasy, UKR \ Alicante, SP
View GitHub Profile
@andboson
andboson / assign_error.go
Created January 23, 2021 14:55
assign error by reflection
package main
import (
"errors"
"fmt"
"reflect"
)
type TestStruct struct {
E error
@andboson
andboson / docker_stats_graphite.sh
Last active September 10, 2022 14:01
Monitor memory of docker container usage in Graphite
# run graphite
docker run \
--name graphite \
--restart=always \
-p 81:80 \
-p 2003-2004:2003-2004 \
-p 2023-2024:2023-2024 \
-p 8125:8125/udp \
-p 8126:8126 \
graphiteapp/graphite-statsd
@andboson
andboson / check_line_infiles.sh
Created January 17, 2023 10:43
Search strings in files in dir
#/bin/sh
# read check.txt with strings to find in files in directory 'data'
while read -r line; do
if grep -q -wi "$line" data/* ; then ; else echo "$line - no"; fi;
done <"check.txt"