Skip to content

Asciinemas

Terminal recordings to show basic but useful uses of something that is worth sharing ends up on this page.

git

  • git grep is very useful for finding a keyword in a codebase. Occasionally someone will tell you to “grep it”. This is how. The -i is to search case insensitive.

image

  • interactive git rebase is a nice way to cleanup and structure your commits. The demonstration shows removing one of the commits, next squashing all other commits into one. Ideal if you’re experimenting a bit, got it right in the end and don’t want to bother the reviewers with your in-between trial-and-error.

image

Find out what recent changes caused potential problems using git blame to relate recent changes to commits. Next you could find to what branch/MR that commit came from and find out more about the context of the changes, leading you to an idea for fixes.

image

bash

  • Go to previous folder, ctrl-R to search through commands you executed earlier and tab to atocomplete folder names.

image

vim

  • Basic commands to use the vim editor. Toggling between normal mode and insertion mode. Executing commands in normal mode like write to file, quit and quit with saving.

image

python debugging

  • Use pdb to drop into the python debugger at any point. Once in the debugger, print a variable, execute the next command, continue running the application as usual and quit the debugger.

image

Creating your own recordings

Install asciinema and asciinema-agg to compile the recording to a gif.

Terminal window
sudo apt-get install asciinema
snap install asciinema-agg

Start recording:

Terminal window
asciinema rec tutorial_xyz.cast
# Now type what you want to show.
# When done, type ctrl-d.
# Now convert the cast textfile to an animated gif:
asciinema-agg tutorial_xyz.cast tutorial_xyz.gif