Shell Tools
About Daily Log
自从放弃Emacs之后,神器org-mode也就没有继续用了,在PC上的笔记就渐渐荒废了。这段时间在配置QEMU环境中意识到,在平时遇到的大量问题需要记录下来,因为会频繁出现。每天总结一下,也有助于自己思考和提高。开始用GitHub了,那就用markdown来写日志,同步到GitHub上,也一并发布到博客上。
Kernel Version
uname -r
RPM Uninstall
rpm -qa|grep -i <package name>
rpm -e <package name>
Disk Usage
df -h
Directory Size
du -sh ./*
Increase Space For IMG File
qemu-img resize centos6.img +20G
Then enter guest os
fdisk /dev/sda
Create new partition in fdisk
mkfs.ext4 /dev/sda3
vim /ect/fstab
Mount new partition in fstab and restart guest os
fstab
# <file system> <dir> <type> <options> <dump> <pass>
tmpfs /tmp tmpfs nodev,nosuid 0 0
/dev/sda1 / ext4 defaults,noatime 0 1
/dev/sda2 none swap defaults 0 0
/dev/sda3 /home ext4 defaults,noatime 0 2
options: defautls
dump: dump 工具通过它决定何时作备份. dump 会检查其内容,并用数字来决定是否对这个文件系统进行备份。 允许的数字是 0 和 1 。0 表示忽略, 1 则进行备份。大部分的用户是没有安装 dump 的 ,对他们而言 <dump>
应设为 0
pass fsck 读取 <pass>
的数值来决定需要检查的文件系统的检查顺序。允许的数字是0, 1, 和2。 根目录应当获得最高的优先权 1, 其它所有需要被检查的设备设置为 2. 0 表示设备不会被 fsck 所检查。
could not find module
kernel在“make install”时“ERROR: modinfo: could not find module power_meter”
screen
screen //create a new session
screen -S <session name>
screen -ls
screen -r <session id>
screen kill <session id>
C+a d Detach
xz file uncompress
tar xvpf test.tar.xz
GRUB2 default entry
- Edit
/etc/default/grub
and setgrub_default=saved
- Update
grub.cfg
withgrub2-mkconfig -o /boot/grub2/grub.cfg
- Use
grub2-editenv list
to get current default entry - Use
grep menuentry /boot/grub2/grub.cfg
to get all menuentry - Use
grub2-set-default <标题或名称>
to change saved entry
SPEC2006 setting
After run ./run mcf
, got error: ERROR: specperl: bad interpreter: No such file or directory
Use install.sh to set up env:./install.sh
Restore default run script:
mv ./run.backup ./run
NIC Advanced Setting
Enter NIC Advanced Setting by:
设备管理器->对应网卡->属性->高级
All settings following should be disabled.
Interrupt Moderation
To reduce the number of interrupts, many NICs use interrupt moderation. With interrupt moderation, the NIC hardware will not generate an interrupt immediately after it receives a packet. Instead, the hardware waits for more packets to arrive, or for a time-out to expire, before generating an interrupt. The hardware vendor specifies the maximum number of packets, time-out interval, or other interrupt moderation algorithm.
The measured round-trip time for a packet is one of the most commonly used techniques to determine the network bandwidth between two endpoints. However, when interrupt moderation is enabled, receiving a packet does not generate an immediate interrupt and therefore the perceived round-trip time for a particular packet becomes larger than the average time. To allow accurate measurement of round trip time for a packet, NDIS provides the ability to disable and enable interrupt moderation on demand.
IEEE 802.11d
IEEE 802.11d was developed out of necessity, as initially, IEEE 802.11 was limited to only a few geographical domains. IEEE 802.11d was approved to provide recommendations for wireless communications, whereby geographical information is added to transmitted frames. This specification was applied to the frame format of beacons, probes and probe requests.
IEEE 802.11d allows a device to self-configure and operate according to the regulations of its operating country and includes parameters like country name, channel quantity and maximum transmission level.
TCP/UDP Checksum Offload (IPv4)
The TCP/UDP Checksum Offload (IPv4) function enables the adapter port to compute the checksum of transmitting IPv4 packets and verify the checksum of receiving IPv4 packets, taking load off from the CPU.