This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cpu_threads.sh | |
( # linux | |
getconf _NPROCESSORS_ONLN || | |
# bsd | |
sysctl -n hw.ncpu | |
) 2>/dev/null || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# serial.sh | |
( # edgeos | |
show version | | |
grep "HW S/N:" || | |
# linux/bsd x86 | |
dmidecode --string system-serial-number || | |
# macos |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bash_version.sh | |
( bash --version | | |
grep --only-matching --max-count=1 "([0-9]*\.){2}[0-9]*" | | |
head -n 1 #`head --lines=` isn't portable, so `-n` is used | |
) 2>/dev/null || | |
exit 1 #failure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ssh_key_create.sh | |
# | |
# parameter: user@host | |
# example: [email protected] | |
( # try ed25519 | |
( ssh-keygen -t ed25519 -b 4096 -f "~/.ssh/$1" && | |
ssh-copy-id -i ~/.ssh/"$1" "$1" | |
) || |
NewerOlder