Skip to content

Instantly share code, notes, and snippets.

View jingkang99's full-sized avatar

Jing Kang jingkang99

  • securez.one
  • San Jose, CA
View GitHub Profile
@jingkang99
jingkang99 / Analyze Go Project Github modules
Last active July 13, 2022 05:58
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
@jingkang99
jingkang99 / Common Used Modules
Last active July 13, 2022 06:02
modules used in rport trasa velocidex
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