Return to Level1Techs.com

Cheat

linux
guide
tutorial
#1

This isn't a proper tutorial, more of an intro to a lil program I recently discovered and wanted to share. It's a simple python script so it's not limited to linux. Mods feel free to move if there's a better place for this.

Keep forgetting those variables? No time to read man pages? If you're a noob like me you're gonna appreciate this nifty 'assistant'.
Noobs and overlord sysadmins, no more googling for answers - setup your personal cheat sheet to get those unfamiliar commands in an instant.

It's a simple tool that that shows what you've noted down in ~/.cheat/foo - when invoking
~]$ cheat foo


  • Install it, requires python3 & python-pip

    ~]$ sudo pip install cheat
  • Set an $EDITOR variable so you can edit cheatsheets on the fly, e.g. to use vim

    ~]$ export EDITOR="/usr/bin/vim"

Done.
It comes with some preconfigured defaults, to list all available sheets on your machine:

~]$ cheat -l

The default "configurations" are located in /usr/lib/python2.7/site-packages/cheat/cheatsheets/
You also have a .cheat/ directory in your home folder where all your edited files are located.


A short example:

~]$ cheat youtube-dl

Looks good, but I don't need that wiki link so that can go, and occasionally I want something as an mp3, so in case I forget the command the file can be simply edited with

~]$ cheat -e youtube-dl

The edited file is saved in the ~/.cheat/ directory.
New try, now howto mp3 is included:

Yay!
But what if I forget the program, i.e. in this case youtube-dl, and all I know is I want an mp3... I can search for keywords in all files by invoking * -s*

~]$ cheat -s mp3


Simple as pie yet very useful, this can be used for any kind of note-taking so basically only your imagination is the limit on what to show.

7 Likes

Baz's lair of randomness and pure sadness
#2

Thank you very much. Reading through the manpage just to find a single option is often a pain in the ass and very inconvenient. Very useful.

0 Likes

#3

booked-marked for later thanks

0 Likes