4 local -r word
=$
(fzf
< /usr
/share
/dict
/words
)
8 shell_activity_report
() {
13 ok = split(time, t, ":")
15 hour = t[1] + 0 # Coerce number from string
23 for (hour=0; hour<24; hour++) {
26 for (i=1; i<=((c * 100) / max); i++)
49 c = count[NR] = $1 + 0 # + 0 to coerce number from string
55 for (i = 1; i <= NR; i++) {
57 printf "%s %d ", cmd[i], c
58 scaled = (c * 100) / max
59 for (j = 1; j <= scaled; j++)
67 # Top Disk-Using directories
68 # TODO: Consider using numfmt instead of awk
77 sub("^" $1 "\t+", "", path)
78 gb = size / 1024 / 1024
79 printf("%f\t%s\n", gb, path)
84 # Top Disk-Using Files
86 find "$1" -type f
-printf '%s\t%p\0' \
87 |
sort -z -n -k 1 -r \
93 sub("^" $1 "\t+", "", path)
94 gb = size / 1024 / 1024 / 1024
95 printf("%f\t%s\n", gb, path)
99 # Most-recently modified file system objects
102 # - intentionally not quoting the parameters, so that some can be ignored
103 # if not passed, rather than be passed to find as an empty string;
104 # - %T+ is a GNU extension;
105 # - gawk is able to split records on \0, while awk cannot.
106 find $@
-printf '%T@ %T+ %p\0' \
107 |
tee >(gawk
-v RS
='\0' 'END { printf("[INFO] Total found: %d\n", NR); }') \
108 |
sort -z -k 1 -n -r \
109 |
head -n "$(stty size | awk 'NR == 1 {print $1 - 5}')" -z \
112 sub("^" $1 " +", "") # Remove epoch time
113 sub("+", " ") # Blank-out the default separator
114 sub("\\.[0-9]+", "") # Remove fractional seconds
128 pactl info |
awk '/^Default Sink:/ {print $3}'
132 curl
"https://xq-api.voidlinux.org/v1/query/x86_64?q=$1" | jq
'.data'
137 LESS_TERMCAP_md
=$
'\e[01;31m' \
138 LESS_TERMCAP_me
=$
'\e[0m' \
139 LESS_TERMCAP_se
=$
'\e[0m' \
140 LESS_TERMCAP_so
=$
'\e[01;44;33m' \
141 LESS_TERMCAP_ue
=$
'\e[0m' \
142 LESS_TERMCAP_us
=$
'\e[01;32m' \
147 cd "$(~/bin/experiment $@)" ||
exit 1
151 ledit
-l "$(stty size | awk '{print $2}')" ocaml $@
155 cat "$(find ~/Archives/Documents/HOWTOs -mindepth 1 -maxdepth 1 | sort | fzf)"
165 _yt_id
=$
(youtube-dl
--get-id "$_yt_uri")
166 _yt_title
=$
(youtube-dl
--get-title "$_yt_uri")
167 _yt_dir
="${DIR_YOUTUBE}/individual-videos/${_yt_title}--${_yt_id}"
170 cd "$_yt_dir" ||
exit 1
171 echo "$_yt_uri" > 'uri'
172 youtube-dl
-c --write-description --write-info-json "$_yt_uri"
176 curl
"https://api.github.com/$1/$2/repos?page=1&per_page=10000"
182 gh_dir
="${DIR_GITHUB}/${gh_user_name}"
184 cd "$gh_dir" ||
exit 1
185 gh_fetch_repos
"$gh_user_type" "$gh_user_name" \
186 | jq
--raw-output '.[] | select(.fork | not) | .git_url' \
192 gh_clone
'users' "$1"
200 gh_username
=$
(echo "$1" |
awk -F / '"$1 == "https" && $3 == github.com" {print $4}')
201 gh_dir
="${DIR_GITHUB}/${gh_username}"
203 cd "$gh_dir" ||
exit 1
207 work_log_template
() {
227 mkdir
-p "$DIR_WORK_LOG"
228 file_work_log_today
="${DIR_WORK_LOG}/$(date +%F).md"
229 if [ ! -f "$file_work_log_today" ]
231 work_log_template
> "$file_work_log_today"
233 vim
-c 'set spell' "$file_work_log_today"
238 mkdir
-p "$DIR_NOTES"
239 vim
-c 'set spell' "$DIR_NOTES/$(date +'%Y_%m_%d--%H_%M_%S%z')--$1.md"
243 curl
"http://wttr.in/$WEATHER_LOCATION"
247 bluetoothctl
-- paired-devices \
249 |
xargs bluetoothctl
-- info
253 bluetoothctl
-- devices \
255 |
xargs bluetoothctl
-- info
260 $@
2> >(tee "$stderr")
264 0) urgency
='normal';;
265 *) urgency
='critical'
267 notify-send
-u "$urgency" "Job done: $code" "$(cat $stderr)"
This page took 0.110318 seconds and 5 git commands to generate.