From db9d4053856db6b9a19fa7b70fd71be448aa14a3 Mon Sep 17 00:00:00 2001 From: terminalforlife Date: Thu, 24 Jun 2021 09:17:39 +0100 Subject: [PATCH 1/4] Add super-awesome AWK example --- sheets/awk | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/sheets/awk b/sheets/awk index de61394..b873a65 100644 --- a/sheets/awk +++ b/sheets/awk @@ -48,7 +48,7 @@ awk '{NR != 1 && A[$1]=$2} END {print(A["Mem:"])}' <(free -h) # the same, and in other cases, the above is definitely preferable. awk '/^Mem:/ {print($2)}' <(free -h) -# Output list of unique uppercase-only, sigil-omitted variables used in [FILE]. +# Output list of unique uppercase-only, sigil-omitted variables used in FILE. awk ' { for(F=0; F Date: Wed, 30 Jun 2021 08:47:46 +0100 Subject: [PATCH 2/4] Add pactl sheet --- sheets/pactl | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sheets/pactl diff --git a/sheets/pactl b/sheets/pactl new file mode 100644 index 0000000..dd30709 --- /dev/null +++ b/sheets/pactl @@ -0,0 +1,5 @@ +# pactl +# Control a running PulseAudio sound server + +# Display a sorted and uniq-ified list of PulseAudio modules, using AWK. +pactl list modules short | awk '{!Lines[$2]++} END {asorti(Lines, Sorted); for (Line in Sorted) print(Sorted[Line])}' From 6f006e0af2f5c055ef1b32212f66f50b807ed63f Mon Sep 17 00:00:00 2001 From: terminalforlife Date: Wed, 30 Jun 2021 08:50:20 +0100 Subject: [PATCH 3/4] Add a couple more pactl examples --- sheets/pactl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sheets/pactl b/sheets/pactl index dd30709..c78a862 100644 --- a/sheets/pactl +++ b/sheets/pactl @@ -3,3 +3,8 @@ # Display a sorted and uniq-ified list of PulseAudio modules, using AWK. pactl list modules short | awk '{!Lines[$2]++} END {asorti(Lines, Sorted); for (Line in Sorted) print(Sorted[Line])}' + +# Load a module. +pactl load-module MODULE +# Unload a module. +pactl unload-module MODULE From 79afcd8cfd244fe72b359aba8b6cbfac85a12e00 Mon Sep 17 00:00:00 2001 From: terminalforlife Date: Thu, 1 Jul 2021 11:04:42 +0100 Subject: [PATCH 4/4] Add apt-config sheet & a couple of examples --- sheets/apt-config | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 sheets/apt-config diff --git a/sheets/apt-config b/sheets/apt-config new file mode 100644 index 0000000..d67a004 --- /dev/null +++ b/sheets/apt-config @@ -0,0 +1,10 @@ +# apt-config +# APT Configuration Query program + +# List all APT (and related) configuration options and their values. +apt-config dump + +# List regular expressions used to match packages to be ignored by apt-get(8)'s +# `autoremove` functionality. Assumes `;` or some other undesired character +# will be at the end of the string. +apt-config dump | awk '/^APT::NeverAutoRemove::/ {print(substr($2, 0, length($2) - 1))}'