A CLI tool for repeating a string an excessive number of times.
Also check out
begone
, a fully automatic spamming tool for Facebook Messenger.
If you're on macOS, you can get dgen
on Homebrew:
brew install stevenxie/tap/dgen
Otherwise, check out the latest compiled release!
To install from source, make sure you have Go installed, and run:
## Clone the repository.
$ git clone git@github.com:stevenxie/dgen
$ cd dgen
## Install dependencies, and then install to $GOBIN.
$ make dl # (or go mod download)
$ make install # (or go install)
To repeat "test string" 50 times, simply perform the following command:
dgen "test string " 50
# Output: test string test string (...)
For more advanced usage options, view the help prompt with:
dgen --help
dgen
comes with several presets in order to make your life easier. Each preset
represents the character limit on the associated messaging service:
dgen "👀 " fb
# Output: 👀 👀 👀 👀 👀 👀 👀 👀 👀 (... x5000)
Name / ID | Value | Service |
---|---|---|
fb | 5000 | Facebook Messenger |
280 | ||
rpost | 40,000 | Reddit (post) |
rcomment | 10,000 | Reddit (comment) |
rmsg | 10,000 | Reddit (message) |
dgen
is one of the top-of-the-line string generators out there. dgen v1.0.1
sports the following benchmark:
- Input: "benchmark test text "
- Repetitions: 1,000,000
- Duration: 25.050 seconds
- Milliseconds / operation: 0.025039
- Bytes allocated / operation: 21
- Allocations / operation: 0
dgen
is a thin wrapper around an internal library, throughput
, which
contains the actual repeating and buffering logic. To create a program with
dgen
's string dumping capabilities, simply import throughput
:
package main
import (
"github.com/stevenxie/dgen/throughput"
"os"
)
func main() {
var (
repstr = "test string "
reps = 5000
bufsize = throughput.RecommendedBufSize
)
// Dump "test string " 5000 times into os.Stdout.
throughput.Dump(repstr, reps, bufsize, os.Stdout)
}
If you want to help develop dgen
, clone the repository and run make setup
to configure your development environment.