serverList='server1 server2'; sshLogin='bob'; for server in $serverList; do echo "$server"; ssh "$sshLogin@$server" 'echo -en "Physical CPU\t: "; grep physical\ id /proc/cpuinfo | sort -u | wc -l; echo -en "CPU Cores\t: "; grep -c ^processor /proc/cpuinfo; echo -en "CPU Model\t: "; grep model\ name /proc/cpuinfo | sort -u; echo -en "RAM\t\t: "; grep 'MemTotal:' /proc/meminfo'; echo; done
Notice the use of \
to grep expressions containing a space character. This is to avoid using quotes, which are numerous here, nested, and getting complex
print ~123;
'; echo
00:02.0 VGA compatible controller: Intel Corporation CometLake-U GT2 [UHD Graphics] (rev 02)
00:02.0 VGA compatible controller: Intel Corporation CometLake-U GT2 [UHD Graphics] (rev 02) (prog-if 00 [VGA controller])
DeviceName: Onboard - Video
Subsystem: Dell CometLake-U GT2 [UHD Graphics]
Flags: bus master, fast devsel, latency 0, IRQ 158
Memory at cb000000 (64-bit, non-prefetchable) [size=16M]
Memory at 80000000 (64-bit, prefetchable) [size=256M]
I/O ports at 3000 [size=64]
Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
Capabilities: <access denied> run command as root for full details
Kernel driver in use: i915
Kernel modules: i915
for letter in {a..z}; do device="/dev/sd$letter"; [ -b "$device" ] && hdparm -I "$device" | head -8; done
in sectors | in GiB (1 sector = 512 B) |
---|---|
|
Both methods give slightly different numbers. I guess this is because the df method sums formatted sizes whereas the /sys method gets device size.
for disk in $(find /dev -type b -name '*sd?' | sort); do echo $disk; hdparm -I "$disk" | grep -i speed; for i in {1..3}; do hdparm -tT "$disk"; done; done
Remarks :
... 00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Link Control 01:00.0 VGA compatible controller: ATI Technologies Inc Juniper [Radeon HD 5700 Series] 01:00.1 Audio device: ATI Technologies Inc Juniper HDMI Audio [Radeon HD 5700 Series] ...For more details on device (source) : lspci -v -s 01:00.0
01:00.0 VGA compatible controller: ATI Technologies Inc Juniper [Radeon HD 5700 Series] (prog-if 00 [VGA controller]) Subsystem: PC Partner Limited Device 1482 Flags: bus master, fast devsel, latency 0, IRQ 27 Memory at d0000000 (64-bit, prefetchable) [size=256M]
Monitor name
|EDID vendor
)' /var/log/Xorg.0.log | awk '{ $1=$2=$3=""; printf $0; print "" }' | uniqRADEON(0): Monitor name: PL1980 RADEON(0): EDID vendor "IVM", prod id 18500
Linux hostname 4.18.0-0.bpo.1-amd64 #1 SMP Debian 4.18.6-1~bpo9+1 (2018-09-13) x86_64 GNU/Linux
or : less /proc/version
Linux version 4.18.0-0.bpo.1-amd64 (debian-kernel@lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 SMP Debian 4.18.6-1~bpo9+1 (2018-09-13)
4.18.0-0.bpo.1-amd64
#1 SMP Debian 4.18.6-1~bpo9+1 (2018-09-13)
apt install linux-headers-$(uname -r)
7.8
Red Hat Enterprise Linux Server release 6.2 (Santiago)
Static hostname: myPC Icon name: computer-laptop Chassis: laptop Machine ID: 9a2d7d69f5e741219fab104d8935fc41 Boot ID: fd51500fbcef4dc1c431907d377ace13 Operating System: Debian GNU/Linux 9 (stretch) Kernel: Linux 4.9.0-4-amd64 Architecture: x86-64
PRETTY_NAME="Debian GNU/Linux 9 (stretch)" NAME="Debian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"
Distributor ID: Debian Description: Debian GNU/Linux 7.8 (wheezy) Release: 7.8 Codename: wheezy
Distributor ID: RedHatEnterpriseServer Description: Red Hat Enterprise Linux Server release 6.2 (Santiago) Release: 6.2 Codename: SantiagoConsider the command flags to get single field information, in either long (default) or short format.
Linux version 2.6.32-042stab108.8 (root@kbuild-rh6-x64.eng.sw.ru) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Wed Jul 22 17:23:23 MSK 2015
Debian GNU/Linux 7 \n \lThis can be customized and may not be up-to-date.
network={ ssid="mySsid" #psk="myUnencryptedPassphrase" psk=600792632e29fc6c69f04e82d1290a28bf1bffff58294ca6ddaf48062c36f311 }
# Static configuration auto wlan0 iface wlan0 inet static address 192.168.0.2 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.0.1 wpa-conf managed wpa-ap-scan 1 wpa-scan-ssid 1 wpa-ssid mySsid wpa-key-mgmt WPA-PSK wpa-psk 600792632e29fc6c69f04e82d1290a28bf1bffff58294ca6ddaf48062c36f311
# DHCP configuration auto wlan0 iface wlan0 inet dhcp wpa-conf managed wpa-ap-scan 1 wpa-scan-ssid 1 wpa-ssid mySsid wpa-key-mgmt WPA-PSK wpa-psk 600792632e29fc6c69f04e82d1290a28bf1bffff58294ca6ddaf48062c36f311
In some circumstances, it may be required to allow broadcasting the SSID so that the wireless host can discover it. Once the wireless host has been registered to the access point, SSID broadcasting can be turned off.
[109694.622325] firmware: requesting iwlwifi-3945-1.ucode [109694.631281] iwl3945: iwlwifi-3945-1.ucode firmware file req failed: Reason -2 [109694.631281] iwl3945: Could not read microcode: -2We need the firmware file iwlwifi-3945-1.ucode.
auto wlan0 iface wlan0 inet dhcp wireless-essid myEssid wireless-key myWepKey
purgethe swap is useless because everything which is stored there (and is washed up by the
cleaningcommands) will be put back there by the running processes requiring memory and the kernel doing its best to let everybody run as smooth as possible.
minimization of swap spaceis really just a concern about used disk space.
Linux is a demand-paged virtual memory system: all memory is broken up into pages—small equal-size chunks of a few kilobytes—and most of these chunks can be swapped (or paged) in or out of RAM as demand dictates (some pages are locked and can't be swapped). When a running process requires more RAM than is available, one or more pages of RAM that have not been used recently are swapped out to make RAM available. Similarly, if a running process requires access to RAM that previously has been swapped out, one or more pages of RAM are swapped out and the previously swapped-out RAM is swapped in. All of this happens behind the scenes without the programmer having to worry about it.
The filesystem cache, program code and shared libraries have a filesystem source, so the RAM associated with any of them can be reused for another purpose at any time. Should they be needed again, Linux can just read them back in from disk.
Program data and stack space are a different story. These are placed in anonymous pages, so named because they have no named filesystem source. Once modified, an anonymous page must remain in RAM for the duration of the program unless there is secondary storage to write it to. The secondary storage used for these modified anonymous pages is what we call swap space.
echo 10 > /proc/sys/vm/swappiness
This command will work fine (it will cause no error, no silenced warning will be generated) but it's mostly pointless unless PERFECTLY understanding how the swap works. Again, changing the swappiness value has NOTHING to do with any amount of used RAM after which swapping starts. Read links above.
vm.swappiness=10
Then reboot (or sysctl -p) to apply changes.
VmSwap
' $file && awk -v separator="$separator" '/Name
/ {printf $2""separator} /VmSwap
/ {print $2""separator""$3}' $file; done | sort -t "$separator" -k 2 -nr | head -20 | column -s "$separator" -tTARGET SOURCE FSTYPE OPTIONS
/tmp tmpfs tmpfs rw,nosuid,nodev,relatime,size=307200k
none /mount/point tmpfs defaults,size=512M 0 0To save a reboot and apply settings NOW! : mount -o remount /mount/point
Answers indicating to create a /etc/modprobe.d/blacklist.conf (or /etc/modprobe.d/blacklist) file containing blacklist pcspkr
have no effect : naming modules there does not affect autoloading of modules by the kernel.
|=================|======|======|======|======|===| | 446 | 16 | 16 | 16 | 16 | 2 | |=================|======|======|======|======|===|The first 446 bytes of MBR contain the code that locates the partition to boot from. The rest of booting process takes place from that partition. This partition contains a software program for booting the system called the bootloader.
To load everything that is needed, add this to /etc/modules: #----cut here---- # Chip drivers w83627hf #----cut here----
CPU family | kernel module |
---|---|
Pentium 4, Celeron D, Pentium D, Celeron M | p4_clockmod |
Pentium M, Core Duo, Core 2 Duo | speedstep_centrino |
AMD K6 | powernow_k6 |
AMD K7 (Athlon, Duron, Sempron 32) | powernow_k7 |
AMD K8 (Athlon 64, Turion 64, Sempron 64, Opteron 64) | powernow_k8 |
None of above | acpi_cpufreq (with NO warranty that it works, whatsoever!) |
governor | usage | module |
---|---|---|
performance | sets the frequency statically to the highest possible value within the configured MIN/MAX range | cpufreq_performance |
powersave | sets the frequency statically to the lowest possible value within the configured MIN/MAX range | cpufreq_powersave |
userspace | allows the users (or any application running as "root") to set the CPU frequency | |
ondemand | adjusts the CPU speed dynamically, depending on the usage | cpufreq_ondemand |
conservative | similar to ondemand, adjusts the frequency dynamically. It differs in behavior in that it gracefully increases and decreases the CPU speed rather than jumping to max speed upon CPU load. This is more suitable in a battery powered environment. | cpufreq_conservative |
3200000 2500000 2100000 800000
ENABLE="true" GOVERNOR="ondemand" MAX_SPEED="1000000" MIN_SPEED="800000"The CPU frequency can be chosen only from the values listed above. Using another value for MAX_SPEED will cause no error, but the CPU won't be able to go faster than the nearest smaller accepted value.