Linux Overview/Development

Development

  • direnv - manage environment variables per-project
  • fish/xiki - alternative shells
  • tmux - remote window management - cheatsheat
  • spacer - put spaces between command output

Packaging

If you ever want to package something for Linux, Repology covers where.

Web Tools

Shell

  • Consider an alias like alias q="ls | grep --color -i".
  • The history command (history search).
  • Process management: & fg bg jobs kill disown nohup (CTRL+C/Z).
  • kill -SIGSTOP and kill -SIGCONT for pause/resume.
  • pgrep to search for PID by name.
  • script to record shell session in file (and cat or less -R to view).
  • From less to edit, press v.
  • Use type -a not which as the latter is problematic

Alternative Tools

  • ncdu (du -smh, df -l)
  • nnn - Terminal File Browser

Makefiles

I advise avoiding makefiles to run scripts.

Template:

MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules

##     help:   This.
.PHONY: help
.DEFAULT: help
help: Makefile
#       Find all double comments and treat them as docstrings
        @echo "make <command>"
        @sed -n 's/^##//p' $<

##     watch:  Hot-reload web-app server.
.PHONY: watch
watch:
#       Build files in case they changed while we were not watching
        $(MAKE) build
        watchman-make -p '*.py' 'Makefile' 'Dockerfile.web' '.dockerignore' -t build


##
##Run make with VERBOSE=1 for additional output.
$(VERBOSE).SILENT:
# Delete targets on failure
.DELETE_ON_ERROR: