Sometimes we just need to write ludicrous things inside of a box. In this case, we have


a double box! It’s a text box inside of a linux container (box) and done via a command line tool called boxes.

Wait, is that a triple container?

This dimension is far too much for me to comprehend right now.


What is this?

I really made a consolidated effort to start working on actually important things this morning, but it epically failed when I saw this inspiration post on linux toy boxes. And because I have extreme prowess in making things that are useful sarcasm, I present to you the sarcastic quote linux box generator! Everyone needs this guy in their life. And of course it’s in a container. Let’s take a look at what I’ll show you today.


Usage

If you just run the container without arguments, it will spit out it’s usage. This is what containers should do when you run them blindly, spit out their guts and tiny little container hearts for you to see.

Ask for Help

But you can also explicitly ask for help, because that’s how good software should work (not that this is good software, it’s probably a poser).


$ docker run vanessa/boxes --help

Usage:

         docker run <container> "Eat dog turds, you oompa loompa!"
         docker run -v $PWD:/data <container> /data/greeting.txt

         Commands:

                help: show help and exit
                list: list available templates
                all: run through ALL the templates (mrahaha)
                
         Options:

                --message:      Select one or more random messages
                --message-file: The file of messages to choose from
                --template:     choose the template that you want
                --no-color:     disable color output (you scrooge!)
                --sleep:        if you use all, the break between prints

         Examples:

             docker run <container> -t dog "I am a dog"
             docker run <container> -t santa greeting.txt
             docker run <container> all WHAT IS GOING ON
             docker run <container> Gogo gadget unibrow!
             docker run <container> Gogo gadget unibrow!
             docker run -v $PWD:/data <container> --message-file /data/insults.txt 


Random Quote

The easiest thing to do (and most fun!) is to run all templates with randomly selected messages. Here is how to do that:


$ docker run vanessa/boxes all --message

If you just want one message, then remove “all”


$ docker run vanessa/boxes --message

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
^ He who stands on toilet, is high on pot.  ^
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


List Templates

What templates can you select?


docker run -it vanessa/boxes list
...
tex-box
tex-cmt
tjc
twisted
underline
unicornsay
unicornthink
vim-cmt
whirly
xes

Oh my. You can use grep to search for a template


docker run vanessa/boxes list | grep cmt
ada-cmt
c-cmt
c-cmt2
c-cmt3
html-cmt
java-cmt
lisp-cmt
pound-cmt
tex-cmt
vim-cmt

Specify Template

Select a specific template!


$ docker run vanessa/boxes --template unicornsay "At least I don't have a unibrow."

   _____________________________________________________
  /                                                     \
  |          At least I don't have a unibrow.           |
  \_______________________________________________  __'\
                                                  |/   \\
                                                   \    \\  .
                                                        |\\/|
                                                        / " '\
                                                        . .   .
                                                       /    ) |
                                                      '  _.'  |
                                                      '-'/    \

Other Options

You can also control the sleep time between printing all templates (when all is used) with --sleep, disable color printing with --no-color, or use your own message file with --message-file (and make sure it’s in the present working directory, and you mount a volume from there to /data in the container!)


Build Away, Confucius

If you want to build the dude, you could do that. But I provide him for you on Docker Hub, so it’s probably not needed.

$ git clone https://www.github.com/vsoch/boxes
$ cd boxes
$ docker build -t vanessa/boxes .

So sure, it’s pretty simple. It doesn’t have the buzzwords “AI” or “big data” or “disruptive” but guess what dude, I had fun making it, and I hope you have fun using it. Please submit a pull request or open an issue on Github if there are any bugs! I literally scrapped this together just quickly this morning so, you know :)


Resources




Suggested Citation:
Sochat, Vanessa. "The Sarcastic, Colorful Quote Generator." @vsoch (blog), 02 Dec 2018, https://vsoch.github.io/2018/boxes/ (accessed 06 Oct 24).