A collection of other bash and Linux commands ... or solutionsThere's obviously no point in detailing all of the Linux/Unix/Bash commands available. Here are a few commands or solutions, I wanted to remember.
Get motherboard or DIMM info:
dmidecode reads information from the DMI (desktop management interface) table which is closely related to the SMBIOS (system management BIOS). Need sudo to run:
dmidecode -t 4 # for CPU info
dmidecode -t 2 # for motherboard info
dmidecode -t memory # for all memory
dmidecode -t 17 # for sodimm information
dmidecode -t 16 # for motherboard info on memory
There's also lshw, but it wasn't installed on my system.
Related commands: lspci, lsusb, lscpu, lsscsi, lsblk
(Other ls* commands of interest: lsmem, lslocks, lsns, lsipc, lslogins)
Weather on the command line:
While loop failing:
I had a problem where I wanted to check ssh on a number of hosts. Simple - cat the file, pipe into while, use ssh with timeout to do the check like this:
cat host_list.txt | while read h; do timeout 3 ssh $h; done
It didn't work. It just hung on the ssh command until timeout cut the command. ssh seemed to be grabbing standard input (and maybe stdout) and interfering with the while loops input. Switching to a for loop helped with the input. Then ssh didn't seem to be the best choice nor did telnet 22. Netcat in a for loop worked best:
nc -v $host 22
Problem solved and the hosts with ssh running were found....