dev:tricks:linux
Differences
This shows you the differences between two versions of the page.
| dev:tricks:linux [2015/05/23 11:24] – [Automatically install dependencies with dpkg -i] hackerzhou | dev:tricks:linux [2020/06/06 23:32] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Linux Tricks ====== | ====== Linux Tricks ====== | ||
| ===== Linux Common ===== | ===== Linux Common ===== | ||
| + | ==== XML beautiful format command ==== | ||
| + | <code bash> | ||
| + | cat xxx.xml | xmllint --format - | ||
| + | </ | ||
| + | |||
| + | ==== Remount filesystem as read-write ==== | ||
| + | <code bash> | ||
| + | mount -o rw,remount / | ||
| + | </ | ||
| + | |||
| + | ==== Useful tools to monitor linux ==== | ||
| + | <code bash> | ||
| + | iostat | ||
| + | meminfo/ | ||
| + | mpstat | ||
| + | netstat | ||
| + | nmon | ||
| + | pmap | ||
| + | ps/pstree | ||
| + | sar | ||
| + | strace | ||
| + | tcpdump | ||
| + | top | ||
| + | uptime | ||
| + | vmstat | ||
| + | wireshark | ||
| + | </ | ||
| + | |||
| + | ==== Use ipref to test network ==== | ||
| + | <code bash> | ||
| + | #UDP mode | ||
| + | #Server side | ||
| + | iperf -u -s | ||
| + | #Client side | ||
| + | iperf -u -c 192.168.1.1 -b 100M -t 60 | ||
| + | #Using 30 threads with 5Mbps each | ||
| + | iperf -u -c 192.168.1.1 -b 5M -P 30 -t 60 | ||
| + | #Test both download and upload bandwidth | ||
| + | iperf -u -c 192.168.1.1 -b 100M -d -t 60 | ||
| + | |||
| + | #TCP mode | ||
| + | #Server side | ||
| + | iperf -s | ||
| + | #Client side | ||
| + | iperf -c 192.168.1.1 -t 60 | ||
| + | #Using 30 threads | ||
| + | iperf -c 192.168.1.1 -P 30 -t 60 | ||
| + | #Test both download and upload bandwidth | ||
| + | iperf -c 192.168.1.1 -d -t 60 | ||
| + | </ | ||
| + | |||
| ==== Add mount --bind info in /etc/fstab ==== | ==== Add mount --bind info in /etc/fstab ==== | ||
| <code bash> | <code bash> | ||
| Line 640: | Line 691: | ||
| <code bash> | <code bash> | ||
| kernelver=$(uname -r | sed -r ' | kernelver=$(uname -r | sed -r ' | ||
| - | ls / | + | dpkg -l linux-{image, |
| - | #dpkg -l linux-{image, | + | |
| </ | </ | ||
| ==== Install Lyx ==== | ==== Install Lyx ==== | ||
dev/tricks/linux.1432380264.txt.gz · Last modified: (external edit)
