Add hardware section

get CPU, memory, hard disk, NIC, temperature information
This commit is contained in:
onceupon 2018-02-12 14:53:34 +08:00 committed by GitHub
parent 6e6d0b9f66
commit b1a605f135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ http://onceupon.github.io/Bash-Oneliner/
- [Random](#random) - [Random](#random)
- [Xwindow](#xwindow) - [Xwindow](#xwindow)
- [System](#system) - [System](#system)
- [Hardware](#hardware)
- [Others](#others) - [Others](#others)
@ -1525,21 +1526,11 @@ then press Alt-F2 and type in pulseaudio
##### When sound not working ##### When sound not working
```bash ```bash
killall pulseaudio killall pulseaudio
```
##### Finding Out Hardware Details Without Opening The Computer Case (e.g. memory device detail)
```bash
sudo dmidecode -t memory
``` ```
##### List information about SCSI devices ##### List information about SCSI devices
```bash ```bash
lsscsi lsscsi
``` ```
##### List information about NIC
```bash
lsscsi|grep -i 'ethernet'
```
##### Tutorial for setting up your own DNS server ##### Tutorial for setting up your own DNS server
http://onceuponmine.blogspot.tw/2017/08/set-up-your-own-dns-server.html http://onceuponmine.blogspot.tw/2017/08/set-up-your-own-dns-server.html
@ -1611,11 +1602,30 @@ ssh -f -L 9000:targetservername:8088 root@192.168.14.72 -N
#the 9000 of your computer is now connected to the 8088 port of the targetservername through 192.168.14.72 #the 9000 of your computer is now connected to the 8088 port of the targetservername through 192.168.14.72
#so that you can see the content of targetservername:8088 by entering localhost:9000 from your browser. #so that you can see the content of targetservername:8088 by entering localhost:9000 from your browser.
``` ```
##### Count the number of Segate hard disks ##### Log out your account after a certain period of time (e.g 10 seconds)
```bash ```bash
lsscsi|grep SEAGATE|wc -l TMOUT=10
or #once you set this variable, logout timer start running!
sg_map -i -x|grep SEAGATE|wc -l ```
##### Get process ID of a process (e.g. sublime_text)
```bash
#pidof
pidof sublime_text
#pgrep, you dont have to type the whole program name
pgrep sublim
#top, takes longer time
top|grep sublime_text
```
## Hardware
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
##### Finding Out memory device detail
```bash
sudo dmidecode -t memory
``` ```
##### Print detail of CPU hardware ##### Print detail of CPU hardware
@ -1659,25 +1669,29 @@ dmidecode -t 4
# 38 IPMI Device # 38 IPMI Device
# 39 Power Supply # 39 Power Supply
``` ```
##### Log out your account after a certain period of time (e.g 10 seconds) ##### Count the number of Segate hard disks
```bash ```bash
TMOUT=10 lsscsi|grep SEAGATE|wc -l
#once you set this variable, logout timer start running! or
sg_map -i -x|grep SEAGATE|wc -l
``` ```
##### Print detail of all hard disks
##### Get process ID of a process (e.g. sublime_text)
```bash ```bash
#pidof lsblk -io KNAME,TYPE,MODEL,VENDOR,SIZE,ROTA
pidof sublime_text #where ROTA means rotational device / spinning hard disks (1 if true, 0 if false)
```
#pgrep, you dont have to type the whole program name ##### List information about NIC
pgrep sublim ```bash
lsscsi|grep -i 'ethernet'
#top, takes longer time ```
top|grep sublime_text ##### Found out power status of the server
```bash
ipmitool -U your_bmc_username -P your_bmc_userpassword -I lanplus -H your_bmc_ip_address power status
```
##### Found out server sensor temperature
```bash
ipmitool sensors |grep -i Temp
``` ```
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
## Others ## Others
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)] [[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]