├── go.mod ├── ressources ├── Demo-txt.png ├── Demo-bin-2.png ├── Demo-custom.png └── Demo-rainbow.png ├── makefile ├── include ├── colors.go └── conf.go ├── LICENSE ├── stuntman.go ├── README.md └── effects └── effects.go /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/Solirs/stuntman 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /ressources/Demo-txt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Solirs/stuntman/HEAD/ressources/Demo-txt.png -------------------------------------------------------------------------------- /ressources/Demo-bin-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Solirs/stuntman/HEAD/ressources/Demo-bin-2.png -------------------------------------------------------------------------------- /ressources/Demo-custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Solirs/stuntman/HEAD/ressources/Demo-custom.png -------------------------------------------------------------------------------- /ressources/Demo-rainbow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Solirs/stuntman/HEAD/ressources/Demo-rainbow.png -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | build: 2 | @echo "Building stuntman..." 3 | go build stuntman.go 4 | 5 | 6 | install: 7 | @echo "Installing stuntman..." 8 | @echo "Compiling..." 9 | go build stuntman.go 10 | @echo "Copying to /usr/local/bin..." 11 | cp stuntman /usr/local/bin 12 | uninstall: 13 | @echo "Uninstaling stuntman..." 14 | rm /usr/local/bin/stuntman 15 | @echo "stuntman sucessfully removed from /usr/local/bin and uninstalled..." -------------------------------------------------------------------------------- /include/colors.go: -------------------------------------------------------------------------------- 1 | package inc 2 | 3 | //Red color 4 | var Red = "\033[31m" 5 | 6 | //Green color 7 | var Green = "\033[32m" 8 | 9 | //Yellow color 10 | var Yellow = "\033[33m" 11 | 12 | //Blue color 13 | var Blue = "\033[34m" 14 | 15 | //Purple color 16 | var Purple = "\033[35m" 17 | 18 | //Cyan color 19 | var Cyan = "\033[36m" 20 | 21 | //White color 22 | var White = "\033[37m" 23 | 24 | //Reset terminal color 25 | var Reset = "\033[0m" 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /stuntman.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | eff "github.com/Solirs/stuntman/effects" 7 | inc "github.com/Solirs/stuntman/include" 8 | "os" 9 | ) 10 | 11 | func initflags() { 12 | flag.IntVar(&inc.Cnt, "width", 50, "The width of the cascade in rows") 13 | flag.IntVar(&inc.Vgap, "linegap", 0, "Gap between lines") 14 | flag.IntVar(&inc.Spaces, "spaces", 0, "An index to determine how many spaces will be generated when using the -text mode, the higher it is, the more spaces.") 15 | flag.IntVar(&inc.Speed, "speed", 0, "Time between lines in milliseconds") 16 | flag.StringVar(&inc.Clr, "color", "nil", "The color of the cascade") 17 | flag.StringVar(&inc.Custom_string, "custom", "nil", "Use a custom set of characters") 18 | flag.BoolVar(&inc.Binar, "binar", false, "Display random Binary code") 19 | flag.BoolVar(&inc.Text, "text", false, "Display random text characters") 20 | flag.BoolVar(&inc.V, "version", false, "Display version and additional info") 21 | flag.BoolVar(&inc.Loweronly, "loweronly", false, "Only use lowercase text in -text mode.") 22 | flag.BoolVar(&inc.Upperonly, "upperonly", false, "Only use uppercase text in -text mode.") 23 | 24 | } 25 | 26 | //Version : Displays version of stuntman 27 | func Version() { 28 | fmt.Print(` 29 | 30 | 31 | stuntman 32 | -Version : 1.0.0 33 | -Author : Solirs 34 | -Repo : https://github.com/Solirs/stuntman 35 | 36 | 37 | 38 | `, "\n") 39 | os.Exit(0) 40 | } 41 | 42 | func main() { 43 | 44 | initflags() 45 | flag.Parse() 46 | 47 | if inc.V { 48 | Version() 49 | 50 | } 51 | 52 | switch inc.Clr { 53 | 54 | case "red": 55 | inc.Colr = inc.Red 56 | 57 | case "green": 58 | inc.Colr = inc.Green 59 | 60 | case "blue": 61 | inc.Colr = inc.Blue 62 | 63 | case "purple": 64 | inc.Colr = inc.Purple 65 | 66 | case "yellow": 67 | inc.Colr = inc.Yellow 68 | 69 | case "cyan": 70 | inc.Colr = inc.Cyan 71 | 72 | case "white": 73 | inc.Colr = inc.White 74 | 75 | case "rainbow": 76 | inc.Rainbow = true 77 | 78 | default: 79 | inc.Colr = inc.Reset 80 | } 81 | 82 | inc.Arrl = make([]int, inc.Cnt) //Make array of non constant length 83 | 84 | fmt.Println(inc.Colr) 85 | 86 | if inc.Binar { 87 | eff.Binary() 88 | } else if inc.Text { 89 | eff.Text() 90 | } else if inc.Custom_string != "nil" { 91 | eff.Custom() 92 | 93 | } else { 94 | fmt.Println("No mode selected, QUITTING!!") 95 | os.Exit(1) 96 | 97 | } 98 | 99 | //This is only done once so spamming if else statements is fine i guess 100 | 101 | } 102 | -------------------------------------------------------------------------------- /include/conf.go: -------------------------------------------------------------------------------- 1 | package inc 2 | 3 | //Cnt : the width of the displayed effects 4 | var Cnt int 5 | 6 | //Vgap : The gap between lines 7 | var Vgap int 8 | 9 | //Speed : the delay between lines in milliseconds 10 | var Speed int 11 | 12 | //Binar : display binary effect 13 | var Binar bool 14 | 15 | //Spaces : An index to determine how many spaces will be generated when using the -text mode, the higher it is, the more spaces. 16 | var Spaces int 17 | 18 | //Rainbow_index : An integer representing the current index of the rainbow list to keep track of it 19 | var Rainbow_index int = 0 20 | 21 | //Arrl : temporary array used for effects 22 | var Arrl []int 23 | 24 | //Text : Displays text effct 25 | var Text bool 26 | 27 | //Rainbow : Enable rainbow effect 28 | var Rainbow bool 29 | 30 | //Loweronly : Only use lowercase text in -text mode. 31 | var Loweronly bool 32 | 33 | //Upperonly : Only use uppercase text in -text mode 34 | var Upperonly bool 35 | 36 | //Custom_set : A custom set of characters to be used 37 | var Custom_set = []string{} 38 | 39 | //Charlist : The buffer slice that will be used to generate each line, it's purpose is to be overwritten by the slices below 40 | var Charlist = []string{} 41 | 42 | //ASCII : List of characters to use when for -text. 43 | var ASCII = []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "{", "}", "[", "]", ";", "§"} 44 | 45 | //ASCIILower : ASCII but lowercase only 46 | var ASCIILower = []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "}", "[", "]", ";", "§"} 47 | 48 | //ASCIIUpper : ASCII but uppercase only 49 | var ASCIIUpper = []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "{", "}", "[", "]", ";", "§"} 50 | 51 | //Binary_list an array of strings only containing 1 and 0 that can be modified according to other flags (i.e add spaces according to -spaces flag) 52 | var Binary_list = []string{"1", "0"} 53 | 54 | //Rainbow_list : List of all the colors for the rainbow effect 55 | var Rainbow_list = []string{Red, Yellow, Green, Blue, Cyan, Purple} 56 | 57 | //Colr : Unix color code of the chosen color 58 | var Colr string 59 | 60 | //Clr : the color name specified in the -color flag 61 | var Clr string 62 | 63 | //Custom_string : the custom character set before its split 64 | var Custom_string string 65 | 66 | //V : Option to display version 67 | var V bool 68 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Go Report Card](https://goreportcard.com/badge/github.com/Solirs/stuntman)](https://goreportcard.com/report/github.com/Solirs/stuntman) 2 | # stuntman v1.0.0 3 | a simple program written in go to make you look like a hackerman with cool terminal effects 4 | 5 | 6 | 7 | ## Demo 8 | 9 | ##### Obviously speed isn't visible because those are images and not videos 10 | 11 | `stuntman -text -spaces 100 -loweronly -width 90 -speed 35 -color green` 12 | 13 | ![alt text](https://github.com/Solirs/stuntman/blob/main/ressources/Demo-txt.png?raw=true) 14 | 15 | 16 | `stuntman -binar -color red -spaces 10 -speed 20 -width 90` 17 | 18 | ![alt text](https://github.com/Solirs/stuntman/blob/main/ressources/Demo-bin-2.png?raw=true) 19 | 20 | `stuntman -custom 0,1,2,3,4,5,6,7,8,9 -color green -speed 55 -spaces 1 -width 100` 21 | 22 | ![alt text](https://github.com/Solirs/stuntman/blob/main/ressources/Demo-custom.png?raw=true) 23 | 24 | `stuntman -text -color rainbow -speed 40 -loweronly -spaces 70 -width 100` 25 | 26 | ![alt text](https://github.com/Solirs/stuntman/blob/main/ressources/Demo-rainbow.png?raw=true) 27 | 28 | 29 | ## Installation 30 | 31 | ### Build from source 32 | 33 | `git clone https://github.com/Solirs/stuntman` 34 | 35 | `cd stuntman` 36 | 37 | `sudo make install` 38 | 39 | ### Precompiled binary 40 | 41 | Download the release tarball in the releases. 42 | 43 | `tar -xvf stuntman_release_*.*.*.tar.gz` 44 | 45 | `cd stuntman_release_*.*.*` 46 | 47 | `sudo make install` 48 | 49 | ### Compatibility 50 | 51 | Should work on any Unix-like operating system, especially if you build from source. 52 | 53 | I personally tested stuntman on the following: 54 | 55 | - FreeBSD 13.0-Release (Working) 56 | - Arch Linux (Working) 57 | - Fedora 35 (Working) 58 | 59 | 60 | ### Uninstall 61 | 62 | `cd STUNTMAN_DIRECTORY` 63 | 64 | `sudo make uninstall` 65 | 66 | ## Use guide 67 | 68 | #### -h 69 | 70 | ##### Displays the help menu 71 | 72 | #### -color 73 | 74 | ##### The color of the text, can be cyan, blue, red, green, purple, or white. 75 | 76 | #### -speed 77 | 78 | ##### The delay between every new lines in milliseconds 79 | 80 | #### -linegap 81 | 82 | ##### Gap between every new line 83 | 84 | #### -text 85 | 86 | ##### Generate ascii text 87 | 88 | ##### -loweronly 89 | 90 | ###### Only generate lowercase characters and special symbols 91 | 92 | ##### -upperonly 93 | 94 | ###### Same as loweronly but for upper 95 | 96 | #### -binar 97 | 98 | ##### Generate ones and zeroe's 99 | 100 | #### -custom foo,bar,eggs 101 | 102 | ##### Generate lines from a custom set of given strings separed by ",". 103 | 104 | #### -width 105 | 106 | ##### The width of the effect in rows 107 | -------------------------------------------------------------------------------- /effects/effects.go: -------------------------------------------------------------------------------- 1 | package effects 2 | 3 | import ( 4 | "fmt" 5 | "math/rand" 6 | "strings" 7 | "time" 8 | 9 | inc "github.com/Solirs/stuntman/include" 10 | ) 11 | 12 | //Randbin: DEPRECATED 13 | /*func Randbin() { 14 | 15 | rand.Seed(time.Now().UnixNano()) 16 | 17 | j := inc.Cnt 18 | 19 | var Strdrop = make([]string, j) 20 | 21 | for i := range Strdrop { 22 | 23 | Strdrop[i] = inc.Binary_list[rand.Intn(len(inc.Binary_list))] 24 | 25 | } 26 | fmt.Println(strings.Trim(fmt.Sprint(Strdrop), "[]")) 27 | time.Sleep(time.Duration(inc.Speed) * time.Millisecond) //Sleep the amount of time specified in the speed flag 28 | for i := 0; i < inc.Vgap; i++ { 29 | 30 | fmt.Println() //Print an empty line the amount of times specified in the vgap flag 31 | 32 | } 33 | }*/ 34 | 35 | //InitSpaces : Appends the number of spaces specified in the -spaces flag to the Charlist 36 | func InitSpaces() { 37 | 38 | for m := 0; m < inc.Spaces; m++ { 39 | 40 | inc.Charlist = append(inc.Charlist, " ") 41 | 42 | } 43 | 44 | } 45 | 46 | //Binary : sets Charlist to inc.Binary_list and loops GenLine 47 | func Binary() { 48 | 49 | inc.Charlist = inc.Binary_list 50 | 51 | InitSpaces() 52 | 53 | for { 54 | GenLine() 55 | 56 | } 57 | 58 | } 59 | 60 | //Text : sets Charlist to one of the ASCII slices and loops GenLine 61 | func Text() { 62 | 63 | if inc.Loweronly { 64 | inc.Charlist = inc.ASCIILower 65 | } else if inc.Upperonly { 66 | inc.Charlist = inc.ASCIIUpper 67 | } else { 68 | inc.Charlist = inc.ASCII 69 | } 70 | 71 | InitSpaces() 72 | 73 | for { 74 | GenLine() 75 | } 76 | 77 | } 78 | 79 | //GenLine generates a line according to inc.Charlist and displays it, its sort of the engine of stuntman 80 | func GenLine() { 81 | 82 | rand.Seed(time.Now().UnixNano()) 83 | 84 | j := inc.Cnt 85 | 86 | var Strdrop = make([]string, j) 87 | 88 | for i := range Strdrop { 89 | 90 | Strdrop[i] = inc.Charlist[rand.Intn(len(inc.Charlist))] 91 | 92 | } 93 | if inc.Rainbow { 94 | 95 | fmt.Print(inc.Rainbow_list[inc.Rainbow_index]) 96 | if inc.Rainbow_index > len(inc.Rainbow_list)-2 { 97 | inc.Rainbow_index = 0 98 | } else { 99 | inc.Rainbow_index++ 100 | } 101 | } 102 | fmt.Println(strings.Trim(fmt.Sprint(Strdrop), "[]")) 103 | time.Sleep(time.Duration(inc.Speed) * time.Millisecond) //Sleep the amount of time specified in the speed flag 104 | for i := 0; i < inc.Vgap; i++ { 105 | 106 | fmt.Println() //Print an empty line the amount of times specified in the vgap flag 107 | 108 | } 109 | 110 | } 111 | 112 | //Custom : Sets Charlist to your custom string specified in the -custom flag and loops GenLine 113 | func Custom() { 114 | 115 | inc.Charlist = strings.Split(inc.Custom_string, ",") 116 | 117 | InitSpaces() 118 | 119 | for { 120 | GenLine() 121 | } 122 | 123 | } 124 | --------------------------------------------------------------------------------