4 local -r word
=$
(fzf
< /usr
/share
/dict
/words
)
8 shell_activity_report
() {
9 # TODO: optional concrete number output
10 # TODO: manual weekday calc (since forking date is so expensive)
11 # TODO: optional combinations of granularities: hour, weekday, month, year
15 # NOTE: $2 & $3 are specific to oh-my-zsh history output
18 d_fields = split(date, d, "-")
19 t_fields = split(time, t, ":")
20 if (t_fields && d_fields) {
21 # +0 to coerce number from string
24 c = count[month, hour]++
43 for (month = 1; month <= 12; month++) {
44 printf "%s\n", m[month];
45 for (hour=0; hour<24; hour++) {
46 c = count[month, hour]
48 for (i = 1; i <= (c * 100) / max; i++)
72 c = count[NR] = $1 + 0 # + 0 to coerce number from string
78 for (i = 1; i <= NR; i++) {
80 printf "%s %d ", cmd[i], c
81 scaled = (c * 100) / max
82 for (j = 1; j <= scaled; j++)
90 # Top Disk-Using directories
91 # TODO: Consider using numfmt instead of awk
100 sub("^" $1 "\t+", "", path)
101 gb = size / 1024 / 1024
102 printf("%f\t%s\n", gb, path)
107 # Top Disk-Using Files
109 find "$1" -type f
-printf '%s\t%p\0' \
110 |
sort -z -n -k 1 -r \
116 sub("^" $1 "\t+", "", path)
117 gb = size / 1024 / 1024 / 1024
118 printf("%f\t%s\n", gb, path)
122 # Most-recently modified file system objects
125 # - intentionally not quoting the parameters, so that some can be ignored
126 # if not passed, rather than be passed to find as an empty string;
127 # - %T+ is a GNU extension;
128 # - gawk is able to split records on \0, while awk cannot.
129 find $@
-printf '%T@ %T+ %p\0' \
130 |
tee >(gawk
-v RS
='\0' 'END { printf("[INFO] Total found: %d\n", NR); }') \
131 |
sort -z -k 1 -n -r \
132 |
head -n "$(stty size | awk 'NR == 1 {print $1 - 5}')" -z \
135 sub("^" $1 " +", "") # Remove epoch time
136 sub("+", " ") # Blank-out the default separator
137 sub("\\.[0-9]+", "") # Remove fractional seconds
151 pactl info |
awk '/^Default Sink:/ {print $3}'
155 curl
"https://xq-api.voidlinux.org/v1/query/x86_64?q=$1" | jq
'.data'
160 LESS_TERMCAP_md
=$
'\e[01;31m' \
161 LESS_TERMCAP_me
=$
'\e[0m' \
162 LESS_TERMCAP_se
=$
'\e[0m' \
163 LESS_TERMCAP_so
=$
'\e[01;44;33m' \
164 LESS_TERMCAP_ue
=$
'\e[0m' \
165 LESS_TERMCAP_us
=$
'\e[01;32m' \
170 cd "$(~/bin/experiment $@)" ||
exit 1
174 ledit
-l "$(stty size | awk '{print $2}')" ocaml $@
178 cat "$(find ~/Archives/Documents/HOWTOs -mindepth 1 -maxdepth 1 | sort | fzf)"
188 _yt_id
=$
(youtube-dl
--get-id "$_yt_uri")
189 _yt_title
=$
(youtube-dl
--get-title "$_yt_uri")
190 _yt_dir
="${DIR_YOUTUBE}/individual-videos/${_yt_title}--${_yt_id}"
193 cd "$_yt_dir" ||
exit 1
194 echo "$_yt_uri" > 'uri'
195 youtube-dl
-c --write-description --write-info-json "$_yt_uri"
199 curl
"https://api.github.com/$1/$2/repos?page=1&per_page=10000"
205 gh_dir
="${DIR_GITHUB}/${gh_user_name}"
207 cd "$gh_dir" ||
exit 1
208 gh_fetch_repos
"$gh_user_type" "$gh_user_name" \
209 | jq
--raw-output '.[] | select(.fork | not) | .git_url' \
215 gh_clone
'users' "$1"
223 gh_username
=$
(echo "$1" |
awk -F / '"$1 == "https" && $3 == github.com" {print $4}')
224 gh_dir
="${DIR_GITHUB}/${gh_username}"
226 cd "$gh_dir" ||
exit 1
230 work_log_template
() {
250 mkdir
-p "$DIR_WORK_LOG"
251 file_work_log_today
="${DIR_WORK_LOG}/$(date +%F).md"
252 if [ ! -f "$file_work_log_today" ]
254 work_log_template
> "$file_work_log_today"
256 vim
-c 'set spell' "$file_work_log_today"
261 mkdir
-p "$DIR_NOTES"
262 vim
-c 'set spell' "$DIR_NOTES/$(date +'%Y_%m_%d--%H_%M_%S%z')--$1.md"
266 curl
"http://wttr.in/$WEATHER_LOCATION"
270 bluetoothctl
-- paired-devices \
272 |
xargs bluetoothctl
-- info
276 bluetoothctl
-- devices \
278 |
xargs bluetoothctl
-- info
283 $@
2> >(tee "$stderr")
287 0) urgency
='normal';;
288 *) urgency
='critical'
290 notify-send
-u "$urgency" "Job done: $code" "$(cat $stderr)"
This page took 0.119337 seconds and 5 git commands to generate.