JEFFREY

feiworks.com

大文件去重5种方法

v1

cat * | sort | uniq > out.txt

v2

cat * | awk '{ if (!seen[$0]++) { print $0; } }' > out.txt


linux远程图形界面转发本地

安装xmanager

yum install Xvfb
yum install xorg-x11-xauth
vi /etc/ssh/sshd_config
X11Forwarding yes
iptables -A INPUT -P udp --dport 177 -j ACCEPT

设置连接属性,在 SSH --> tunneling 选项下勾选 Forward X11 connections to: Xmanager


JTAG header pinout

Pinouts

  • ARM-20 (used with almost all ARM-based microcontrollers)

  • ARM-14 (used as a lower pin-count version of ARM-20)

  • MIPS EJTAG used with all MIPS microcontrollers (mostly embedded devices, can be found on many WiFi devices)

  • Toshiba MIPS

  • Philips MIPS

  • AVR JTAG Compatible with AVR, Altera JTAG, ... (widely used)

  • Altera ByteBlaster Compatible with AVR, Altera JTAG, ... (widely used)

  • Maxim MAXQ JTAG Partially compatible with AVR JTAG

  • Actel FlashPro3 JTAG

  • PLD-JTAG

  • Cypress Ultra-isr

  • Lattice JTAG ispDOWNLOAD 2x5pin

  • Lattice JTAG ispDOWNLOAD 9pin

  • TI MSP430

  • Xilinx JTAG

  • Xilinx JTAG 9pin

Non-standard manufacturer-specific pinouts

  • Linksys WRT54G(S) - used as EJTAG

  • Bosch EDC16/MED9 car ECU

  • Motorola PowerPC BDM port

USB HID usage table

This usage table lets usbhidctl decode the HID data correctly for the APC RS/XS1000's.

This work was obtained from riccardo@torrini.org.

Note that the default /usr/share/misc/usb_hid_usages already contains entries for these a Power Device (132 or 0x84) and a Battery System (133 or 0x85).  It is interesting that usbhidctl shows the APC as using 0xff84 and 0xff84 for their values.  The HID Power Devices specification indicates 0x84 and 0x85.  There is at least one macro in /usr/include/dev/usb/usbhid.h which removes the high order bits.  Perhaps we need to do that when using the values.  Perhaps this macro:

#define HID_USAGE2(p,u) (((p) << 16) | u)

Linux/i386 system calls

List of Linux/i386 system calls

Copyright (C) 1999-2000 by Konstantin Boldyshev

This list is NOT READY and is under heavy construction, a lot of entries are missing, and some may be incorrect. This is more a template than a real document. Meanwhile, I suggest you to examinethis listby H-Peter Recktenwald.


Linux screen

new session: screen -S 
restore session: screen -r 
list session: screen -ls 

In session:
detach session: Ctrl+a,d
create window: Ctrl+a,c
next/prev window: Ctrl+a,n/p
lock/unlock: Ctrl+a,s/q
show status in title: Ctrl+a,w
split window: Ctrl+a,S
change window: Ctrl+a,Tab
kill window: Ctrl+a,K
start/stop log: Ctrl+a,H

linux/android禁用ipv6

 echo 1 > /proc/sys/net/ipv6/conf/eth0/disable_ipv6

直接生效,需要每次生效的话,编辑/etc/sysctl.conf

net.ipv6.conf.eth0.disable_ipv6 = 1

然后sysctl -p命令生效。

Linux读写速度测试

服务器装好系统之后,想要知道硬盘的读写是否能满足服务的需要,如果不满足硬盘的IO就是服务的一个瓶颈。所以我们需要测试硬盘的读写速度,测试的方法很多,下面是使用linux 自带的dd命令测试硬盘的读写速度。

time有计时作用,dd用于复制,从if读出,写到of。if=/dev/zero不产生IO,因此可以用来测试纯写速度。同理of=/dev/null不产生IO,可以用来测试纯读速度。bs是每次读或写的大小,即一个块的大小,count是读写块的数量。


测/data目录所在磁盘的纯写速度:

[root@nagios ~]# time dd if=/dev/zero of=/var/test bs=8k count=1000000
1000000+0 records in
1000000+0 records out
8192000000 bytes (8.2 GB) copied, 52.5749 seconds, 156 MB/s
real    0m55.841s
user    0m0.507s
sys     0m15.706s

time命令计算复制的时间。


测/data目录所在磁盘的纯读速度:

[root@nagios ~]# time dd if=/var/test of=/dev/null bs=8k
1000000+0 records in
1000000+0 records out
8192000000 bytes (8.2 GB) copied, 49.0088 seconds, 167 MB/s
real    0m49.025s
user    0m0.559s
sys     0m6.383s


测读写速度:

[root@nagios ~]# time dd if=/var/test of=/tmp/test bs=64k
125000+0 records in
125000+0 records out
8192000000 bytes (8.2 GB) copied, 129.239 seconds, 63.4 MB/s
real    2m9.251s
user    0m0.114s
sys     0m21.494s

Powered By Z-BlogPHP 1.5 Zero

Copyright @ 2014-2019 All Rights Reserved.
feiworks.com