To get the SHA256 hash of an existing public key, simply run
ssh-keygen -lvf path/to/key.pub
If you want the MD5 hash (or another supported format), run something like
ssh-keygen -lv -E MD5 -f path/to/key.pub
To get the SHA256 hash of an existing public key, simply run
ssh-keygen -lvf path/to/key.pub
If you want the MD5 hash (or another supported format), run something like
ssh-keygen -lv -E MD5 -f path/to/key.pub
You can quickly visualize your current git tree structure with
git log --graph --oneline --all
It's often useful to apply a command to each line of STDIN inside a pipeline.
This is easy to do in fish
:
ls | while read line; echo $line; end
# This is a short function demonstrating how to run a sequence of commands in parallel | |
# and wait for them to be completed before continuing | |
function test_sleep | |
set -l pid_list | |
for i in 1 4 2 5 3 | |
# execute the command and put it in the background | |
fish --command " | |
sleep $i | |
echo \"Finished command $i!\" | |
" & |
We can use httpie to make requests to the W3C validator.
For example, to test the file index.html
, run
https "https://validator.w3.org/nu/?out=gnu" @index.html "Content-Type: text/html; charset=utf-8" --print 'b'
and any errors or warnings will be printed to STDOUT.
You can also get the error format in JSON by using the out=json
syntax.
If you have a folder my/folder
, you can run
du -h my/folder | sort -h | tail -n 10
to get a list of the 10 largest subfolders.
Explanation:
du -h
: get the size of the elements in the folder in human-readable formatsort -h
: sort human-readable (requires an updated version of sort
)tail -n 10
: only take the last 10 elements