DEV Community

CircusBearOnATrike
CircusBearOnATrike

Posted on

Using Fortune For Studying

Example

I'm studying for Comptia Security+ (SY0-501) certification as part of a retooling that I'm doing. (Working fulltime while going back to school ain't no joke.) The retooling is taking the form of degree, ctf/proof of work, and certifications. To help squeeze in some additional efficiency I've set up my terminal to pop up a flashcard each login of terms to memorize. This is accomplished using fortune, lolcat, and cowsay in conjunction with a custom fortune file. For right now, I've just grabbed a dumb list of terms to memorize but as I build my study guides, I'll flesh this out.

https://github.com/Chad-Ballay/fortune_study_guide

Install Utilities

Install fortune, lolcat, and cowsay using Homebrew. Only fortune is needed but the asthetics of having Lolcat and Cowsay make it better.

$ brew install fortune
$ brew install lolcat
$ brew install cowsay

Get A Fortune File

You can get mine.
https://github.com/Chad-Ballay/fortune_study_guide/blob/master/study_guides/SY0_501.fortune

Or write your own.

http://bradthemad.org/tech/notes/fortune_makefile.php

Setup Your Fortune File

I install them locally to ~/.fortune since the intention is to have specific cert ones for focus. You could install this wherever you want, you just need to remember that for the .bash_profile step.

$ mkdir ~/.fortune
$ cp ./study_guides/SY0_501.fortune ~/.fortune/
$ strfile ~/.fortune/SY0_501.fortune

Test It

You should be able to get some random flashcard and ascii art when you run this.

$ fortune ~/.fortune/SY0_501.fortune | cowsay -f $(shuf -n 1 -e $(cowsay -l | tail -n +2)) | lolcat

Setup Profile

Now to modify your login to always have one.

$ cp ~/.bash_profile ~/.bash_profile.backup.$$
$ echo 'fortune ~/.fortune/SY0_501.fortune | cowsay -f $(shuf -n 1 -e $(cowsay -l | tail -n +2)) | lolcat' >> ~/.bash_profile

TODO

PR's are always welcome.

  • I need to review the data in my Fortune file since there are misspellings galore.
  • I need to expand it to include more concepts.
  • I need to create other Fortune files for GSEC, CySA, CCNA, etc...

Top comments (0)