Skip to content

luketurner/mkjunk

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

mkjunk

Python script for generating a specific-length string of junk data. Useful for testing API length limits.

This is extremely simplistic, but unlike other "dummy text" CLI snippets, mkjunk:

  • Does not read random characters -- output is constrained to the "seed string". Contrast with /dev/urandom, which can contain whitespace characters, which is sometimes annoying
  • Understands human-readable lengths (e.g. mkjunk 1mb)
  • Outputs to STDOUT instead of creating a file.
  • Is probably extremely inefficient

Informational messages are written to STDERR.

Depends on Python 3.

Installation

# Install with Python 3
pip install git+https://github.com/luketurner/mkjunk.git

# Ready to go!
mkjunk --help

Examples

# Write "hihi" to a file
mkjunk -s hi 4 > junk.txt

# Add 1kb of junk to a file
mkjunk 1000 >> junk.txt

# Put 1mb of junk in your clipboard (on OSX)
mkjunk 1mb | pbcopy

Usage

Usage: mkjunk [OPTIONS] NUM_BYTES

  Accepts a NUM_BYTES (which can be human-readable, e.g. "1mb") and writes
  that many bytes of junk characters to STDOUT. The junk is just a single
  "seed string" repeated.

Options:
  -s, --seed TEXT  alternate seed text for generation
  --help           Show this message and exit.

Released under MIT License.

About

CLI script for generating arbitrary amounts of junk data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages