Skip to content

Instantly share code, notes, and snippets.

Avatar

Jerry Kang jingkang99

  • securez.one
  • San Jose, CA
View GitHub Profile
@jingkang99
jingkang99 / Common Used Modules
Last active Jul 13, 2022
modules used in rport trasa velocidex
View Common Used Modules
github.com/BurntSushi/toml
github.com/Depado/bfchroma
github.com/Masterminds/sprig
github.com/Showmax/go-fqdn
github.com/ZachtimusPrime/Go-Splunk-HTTP
github.com/alecthomas/assert
github.com/alecthomas/chroma
github.com/alecthomas/participle
github.com/alexmullins/zip
github.com/andelf/go-curl
@jingkang99
jingkang99 / Analyze Go Project Github modules
Last active Jul 13, 2022
Analyze Go Project Github modules
View Analyze Go Project Github modules
export EXCLUDEPKG="cloudradar-monitoring|seknox"
# save github package list to a file - gitpkg.txt
grep -r --include=\*.go '"github.com' | grep -Ewv ${EXCLUDEPKG} | awk -F '"' '{print $2}' | sort | uniq -c | awk '{print $2}' > gitpkg.txt
# query star count for each package
for gh in $( awk -F '/' '{print $2"/"$3}' gitpkg.txt | uniq ) ; do star=`curl -s "https://api.github.com/repos/${gh}" | grep stargazers_count | cut -d : -f 2 | tr -d " " | tr -d "," `; printf "github.com/%-35s %s\n" ${gh} ${star} ; done
# grep built-in system modules
grep -r --include=\*.go -A 12 'import (' | grep -P '\s+"(\w|/)+"$' | grep -Ewv "github.com|=" | awk -F '"' '{print $2}' | sort | uniq