Asciinema - Uelekezo

Uelekezo

Jijuze Jiarifu

Breaking

Home Top Ad

_

Monday 9 May 2022

Asciinema

asciinema is a free and open source solution for recording terminal sessions and sharing them on the web.


In the guide, you’ll learn:

        1. How to install asciinema from source
        2. How to record a terminal session using asciinema
        3. How to play a asciinema recording
        4. How to convert asciinema recording to a gif
        5. How to install ascii2gif docker image.





Installing asciinema on Windows

On windows you'll have to install windows subystem then install a linux distro such as ubuntu then run then follow the asciinema recording below.



Recording and replaying a terminal session using asciinema


How to convert asciinema recording to gif

First you need to know how to install docker. Once docker is installed you'll need to install the ascii2gif docker image.

commands: docker pull asciinema/asciicast2gif


How to convert an asciinema recording to a gif image


ascii2gif.sh contents:
#!/bin/bash
docker run --rm -v $PWD:/data asciinema/asciicast2gif -s 4 -t monokai $1 $2.gif

#make the ascii2gif.sh executable

#end of script

bash -x ascii2gif.sh ascii_recording.json gif_out

Common Bugs Found During Conversion is the following.

When you come across a failed conversion try to increase the "-s" line within the script to a higher value for example from 2 to 5.

The error is most likely because all available RAM has been consumed. Therfore, try to increase the interval time to a higher value.






No comments:

Post a Comment