Utilities

Utilities: passwords, ids, time, encoding, quick checks.

File aliases/util.sh. Disable: export ALIASX_DISABLE="util"

Generate

NameRunsWhat it does
genpass [N]random password, N chars (default 20)
example
$ genpass 16
q7K#m2Rx_9vT!pLz
newuuidrandom UUID (lowercase)
example
$ newuuid
3f1c9b2e-7a4d-4e8f-9c21-5b6a7d8e9f01

Time

NameRunsWhat it does
epochcurrent Unix timestamp
example
$ epoch
1790932262
fromepoch TSUnix timestamp to UTC date
example
$ fromepoch 0
1970-01-01 00:00:00 UTC

Encode

NameRunsWhat it does
b64 [TEXT]base64 encode TEXT or stdin
example
$ b64 hello
aGVsbG8=
b64d [TEXT]base64 decode TEXT or stdin
example
$ b64d aGVsbG8=
hello
urlenc TEXTpercent-encode for URLs
example
$ urlenc 'a b&c'
a%20b%26c
urldec TEXTdecode percent-encoding
example
$ urldec a%20b%26c
a b&c

Quick checks

NameRunsWhat it does
httpcode URLHTTP status code only
example
$ httpcode https://example.com
200
digs NAMEDNS answer only
example
$ digs example.com
93.184.215.14
topcmds [N]your most used commands (default 15)
example
$ topcmds 3
  412 git
  210 docker
  155 cd
sysinfoOS, CPU, memory, disk, uptime in one screen
example
$ sysinfo
OS:     Linux 6.8.0 x86_64
Host:   web1
CPU:    AMD EPYC 7763 (4 cores)
Memory: 3.1Gi used / 7.7Gi
Disk /: 21G used / 79G (27%)
Uptime: up 12 days
pk NAMEkill processes by name after y/N
example
$ pk node
4123 node server.js
Kill these processes? [y/N] n
Cancelled.