Skip to content

Instantly share code, notes, and snippets.

View arvchristos's full-sized avatar

Christos Arvanitis arvchristos

View GitHub Profile
@arvchristos
arvchristos / get_installed_for.sh
Last active August 6, 2019 22:10
Bash script to print duration of current linux installation
#!/bin/bash
# Function to check if leap year exists in order to print exact year number
function is_leap {
if !(($1 % 4)) && ( (($1 % 100)) || !(($1 % 400)) ); then
echo 1
else
echo 0
fi
}
@cksachdev
cksachdev / tree structure in markdown.md
Last active July 19, 2018 17:06
Generate a tree structure from the Terminal to use in Markdown document
tree --dirsfirst --noreport -I README.md |
sed '1s/^/```'"$(printf '\n')"'/;$s/$/'"$(printf '\n')"'```/' > README.md

If tree is not available, install it via

brew install tree