Useful CLI scripts that I think are worth sharing.
Go to file
Greg Gauthier 10a026cb34 fix typo 2024-03-01 13:09:10 +00:00
.config/vale initial commit 2024-02-29 20:44:48 +00:00
scripts fix typo 2024-03-01 13:09:10 +00:00
.gitignore initial commit 2024-02-29 20:44:48 +00:00
README.md add readme for def 2024-03-01 11:52:47 +00:00
install.sh add an installer script 2024-02-29 22:12:15 +00:00

README.md

cli-scripts

Useful CLI scripts that I think are worth sharing.

NOTE: With all of these, you'll need to customize the environment for yourself. I have yet to make things like home directories and what-not generic variables

Prerequisites

The scripts in the scripts directory rely heavily the expectation that you already have a number of applications installed on your system. If you're on a Debian or Ubuntu-ish system, then installing them should be more or less as simple as an apt install {whatever}. For the rest of you, you'll have to make your own way. Sorry.

Here is the prerequisite list broken down by script:

apps

This is a little ncurses menu I built for myself. Dependencies will be determined by how you decide to customize the menu for yourself (i.e. what applications you want to put in the menu), but there is one common dependency.

  • dialog - I think this comes automatically with Debian/Ubuntu

birthdate

prints the initial installation date of your system

  • None

cecho

provides colorized echo messages

  • The bash version of printf for best results

checkit

performs a grammatical version of code linting, but on your text documents.

  • vale - https://vale.sh/
  • go - Their Dockerfile (for the docker implementation) calls for golang 1.21
  • .config/vale - included in this repo. Vale is a bit confusing to setup. So, I'm providing my vale config as a 'starter pack'. This just goes into your own ~/.config location.

def

get the definition for an English word, at the terminal

  • dictd - The dictionary daemon (its actually a little api service)
  • dict - The dictionary daemon client
  • dict-gcide - The "Collaborative International" dictionary. Basically, just the public domain 1913 Edition of Websters.
  • cecho - see above

dirsz

dumps a list of the directory sizes recursively from your CWD

  • None

fif

A "find-in-files" utility for the console.

  • fd-find - a better substitute for the standard 'find' command

forecast

Dumpe a three-day forecast to your console

  • curl, and a network connection (for access to wttr.in)

getvid

downloads a youtube video given the web url to the video (and specified resolution)

  • yt-dlp

ifcheck

shows the state of your ethernet/wifi interface

  • ip - I can't remember if this was something I had to install after the fact.

memo

  • None - However, you'll need to modify the script to specify your own editor, and you'll have to create a "memos" directory in your Documents folder.

netcheck

Tells you if the internet is accessible from your shell.

  • None

oggrec

Starts a recording from the console, using your default mic

  • alsa-utils - provides arecord which captures the raw audio input
  • vorbis-tools - provides oggenc which encodes it to ogg and stores it to the specified file

spchk

command line spell checker

  • aspell - available in Ubuntu repositories
  • aspell-en - there are dictionaries for a multitude of languages. I'm an english speaker.
  • cecho - see above. I like colored messages.

status

Combines the ifcheck, netcheck, wx, and a few other commands into a full screen status display

  • ifcheck - see above
  • netcheck - see above
  • cecho - see above
  • wx - seee below

tone

generates a sine wave of the specified frequency and duration as a wav file.

  • ffmpeg

tones

same as above, only does it in stereo

usedisk

generates a 1.44MB floppy disk image, and attempts to mount it on your system

  • None - however, you should be careful. This will consume loop devices, in order to mount the created disk

vmemo

records a short, low-resolution (small size) 15 second audio memo from your default mic

  • arecord
  • mp3 codecs

vplay

Launches VLC in ncurses mode, and automatically starts playing music from your ~/Music folder

  • vlc - video lan client

vradio

Same as above, but if you have m3u radio stations stored in your vlc config, it will pick a station at random.

  • vlc - video lan client

wx

displays the current weather conditions for your area. You'll need to customize the script.

  • ansiweather - available in Debian and Ubuntu repositories.

yootoob

A utility for searching and watching youtube videos without a browser

  • ytfzf (which I believe also has a dependency on yt-dlp)
  • mpv - although, you could substitute in mplayer or vlc or whatever you like