utils

package
v0.0.0-...-3f80445 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToGigabytes

func BytesToGigabytes(bytes uint64) float64

BytesToGigabytes - an internal utility function to convert bytes to gigabytes; used to clarify the output of PrintMemory()

func CheckErr

func CheckErr(err error)

CheckErr prints any non-nil errors followed by exiting the application

func CheckSudo

func CheckSudo()

CheckSudo throws an error if the current user is not sudo/root

func CheckTarget

func CheckTarget(target string)

CheckTarget throws an error if the target is empty

func CollyAddress

func CollyAddress(target string, savePage bool, ip bool)

CollyAddress - scrapes a website link

func DownloadFile

func DownloadFile(filepath string, url string) error

DownloadFile downloads a file from a url

func GetPassword

func GetPassword() string

GetPassword - securely gets password from a user

func PrintBanner

func PrintBanner()

PrintBanner - displays the banner text

func PrintCPU

func PrintCPU()

PrintCPU - prints CPU info TODO: add more info

func PrintHost

func PrintHost()

PrintHost - prints info about system host

func PrintMemory

func PrintMemory()

PrintMemory - prints info about system memory TODO: get physical memory instead of swap TODO: convert values to gigabytes

func RandomColor

func RandomColor() ct.Color

func RandomString

func RandomString(length int) string

RandomString - returns a random string TODO: rewrite in my own code TODO: add more comments Util function - returns a random string

Original: https://stackoverflow.com/questions/22892120

/how-to-generate-a-random-string-of-a-fixed-length-in-go#31832326

func ReadFileIntoByte

func ReadFileIntoByte(filename string) []byte

ReadFileIntoByte - is used for getting []byte of file

func RunCmd

func RunCmd(command string, arg ...string) string

RunCmd - runs a command on the system and prints the result TODO: document

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL