awk 특수문자 쉽게 처리 하기

 

awk 사용시 .. 특수문자 인식시키려면.. ㄸㅏ음표와의 전쟁임..

아래 코드로 하면 간단하게 처리 가능.

\x21 \x22 \x23 \x24 \x25
! # $ %
\x26 \x27 \x28 \x29 \x2a
& ( ) *
\x2b \x2c \x2d \x2e \x2f
+ , . /
\x30 \x31 \x32 \x33 \x34
1 2 3 4
\x35 \x36 \x37 \x38 \x39
5 6 7 8 9
\x3a \x3b \x3c \x3d \x3e
: ; < = >
\x3f \x40 \x41 \x42 \x43
? @ A B C
\x44 \x45 \x46 \x47 \x48
D E F G H
\x49 \x4a \x4b \x4c \x4d
I J K L M
\x4e \x4f \x50 \x51 \x52
N O P Q R
\x53 \x54 \x55 \x56 \x057
S T U V W
\x58 \x59 \x5a \x5b \x5c
X Y Z [ \
\x5d \x5e \x5f \x60 \x61
] ^ _ ` a
\x62 \x63 \x64 \x65 \x66
b c d e f
\x67 \x68 \x69 \x6a \x6b
g h i j k
\x6c \x6d \x6e \x6f \x70
l m n o p
\x71 \x72 \x73 \x74 \x75
q r s t u
\x76 \x77 \x78 \x79 \x7a
v w x y z
\x7b \x7c \x7d \x7e  
{ | } ~  

 

 

 

Share "awk 특수문자 쉽게 처리 하기"

Share on: FacebookTwitter

10Mb/s tun/tap .. 100/1000Mb/speed로 변경하는 패치

tun/tap는 10Mb/s 이다.. 다 이유가 있어서.. 10Mb/s로 고정 해났겠지.. ? 뭐 암튼.. https://patchwork.ozlabs.org/patch/439367/ 여기에 패치가 있다고 해서 들러봤다. 어.. ethool로 다이나믹하게 10/100/1000 조절이 되는 패치가 정말 있다. 내 환경은 대부분  centos이기 때문에 내 환경에 맞게 패키징을 해보았다. 이렇게 모듈만 가져다가 설치하게 만들어놓으면  yum등으로 업데이트 될 경우 커널을  다시 컴파일해서 다시 바꾸고 하는 등등.. 쌩고생을 안해도 됨 따라서 yum등으로 커널 업데잍 되는경우 patch.sh를 한번 실행해주면 끝남. 혹시 모르니 /lib/modules/`uname -r`/kernel/drivers/net/tun.ko 파일은 백업해두고 진행. 아래 링크 받아다가 앞축풀어서 ./patch.sh실행만하면 모듈이 설치가 된다. (커널 kernel-headers , kernel-devel은 기본적으로 설치 되어 있어야함.)

ㅌㅔ스트환경은 centos6  이다. 다른 버전은 안되겠지? 따로 패키징하는게 맞을듯. ( 32bit/64bit 테스트완료됨)

ㄷㅏ운로드 –> tun_patch.tar.gz  

사실 openvpn tun/tap가 10Mb/s이기에.. 속도 안습 땀시 접근했던건데.. 이거 바꿧다고 속도가 막? 올라가고 그러진 않았음(내심 기대했는데 ㅎ).. 역시 pc퍼포먼스ㄴㅏ 네트워크에 따라.. 속도가 결정되는게 맞는듯..

패치전 10Mb/s
sh-4.1# ethtool tun0
Settings for tun0:
Supported ports: [ ]
Supported link modes:   Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Advertised link modes:  Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Speed: 10Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
MDI-X: Unknown
Current message level: 0xffffffa1 (-95)
drv ifup tx_err tx_queued intr tx_done rx_status pktdata hw wol 0xffff8000
Link detected: yes

speed 변경 불가능

sh-4.1# ethtool -s  tun0 speed 10
Cannot set new settings: Operation not supported
not setting speed
sh-4.1#
sh-4.1# ethtool -s tun0 speed 100
Cannot set new settings: Operation not supported
not setting speed
sh-4.1#
sh-4.1# ethtool -s tun0 speed 1000
Cannot set new settings: Operation not supported
not setting speed
sh-4.1#
패치후 speed 

sh-4.1# ethtool tun0
Settings for tun0:
Supported ports: [ ]
Supported link modes:   Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Advertised link modes:  Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
MDI-X: Unknown
Current message level: 0xffffffa1 (-95)
drv ifup tx_err tx_queued intr tx_done rx_status pktdata hw wol 0xffff8000
Link detected: yes

패치후 10/100/100으로 speed  변경 가능
sh-4.1# ethtool -s  tun0 speed 100
Settings for tun0:
Supported ports: [ ]
Supported link modes:   Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Advertised link modes:  Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
MDI-X: Unknown
Current message level: 0xffffffa1 (-95)
drv ifup tx_err tx_queued intr tx_done rx_status pktdata hw wol 0xffff8000
Link detected: yes

Share "10Mb/s tun/tap .. 100/1000Mb/speed로 변경하는 패치"

Share on: FacebookTwitter

CIDR Block

CIDR Block          Network             Broadcast           Subnet Mask         No. IP’s
10.20.0.0/32        10.20.0.0        –  10.20.0.0           255.255.255.255     1
10.20.0.0/31        10.20.0.0        –  10.20.0.1           255.255.255.254     2
10.20.0.0/30        10.20.0.0        –  10.20.0.3           255.255.255.252     4
10.20.0.0/29        10.20.0.0        –  10.20.0.7           255.255.255.248     8
10.20.0.0/28        10.20.0.0        –  10.20.0.15          255.255.255.240     16
10.20.0.0/27        10.20.0.0        –  10.20.0.31          255.255.255.224     32
10.20.0.0/26        10.20.0.0        –  10.20.0.63          255.255.255.192     64
10.20.0.0/25        10.20.0.0        –  10.20.0.127         255.255.255.128     128
10.20.0.0/24        10.20.0.0        –  10.20.0.255         255.255.255.0       256
10.20.0.0/23        10.20.0.0        –  10.20.1.255         255.255.254.0       512
10.20.0.0/22        10.20.0.0        –  10.20.3.255         255.255.252.0       1024
10.20.0.0/21        10.20.0.0        –  10.20.7.255         255.255.248.0       2048
10.20.0.0/20        10.20.0.0        –  10.20.15.255        255.255.240.0       4096
10.20.0.0/19        10.20.0.0        –  10.20.31.255        255.255.224.0       8192
10.20.0.0/18        10.20.0.0        –  10.20.63.255        255.255.192.0       16384
10.20.0.0/17        10.20.0.0        –  10.20.127.255       255.255.128.0       32768
10.20.0.0/16        10.20.0.0        –  10.20.255.255       255.255.0.0         65536
10.20.0.0/15        10.20.0.0        –  10.21.255.255       255.254.0.0         131072
10.20.0.0/14        10.20.0.0        –  10.23.255.255       255.252.0.0         262144
10.16.0.0/13        10.16.0.0        –  10.23.255.255       255.248.0.0         524288
10.16.0.0/12        10.16.0.0        –  10.31.255.255       255.240.0.0         1048576
10.0.0.0/11         10.0.0.0         –  10.31.255.255       255.224.0.0         2097152
10.0.0.0/10         10.0.0.0         –  10.63.255.255       255.192.0.0         4194304
10.0.0.0/9          10.0.0.0         –  10.127.255.255      255.128.0.0         8388608
10.0.0.0/8          10.0.0.0         –  10.255.255.255      255.0.0.0           16777216
10.0.0.0/7          10.0.0.0         –  11.255.255.255      254.0.0.0           33554432
8.0.0.0/6           8.0.0.0          –  11.255.255.255      252.0.0.0           67108864
8.0.0.0/5           8.0.0.0          –  15.255.255.255      248.0.0.0           134217728
0.0.0.0/4           0.0.0.0          –  15.255.255.255      240.0.0.0           268435456
0.0.0.0/3           0.0.0.0          –  31.255.255.255      224.0.0.0           536870912
0.0.0.0/2           0.0.0.0          –  63.255.255.255      192.0.0.0           1073741824
0.0.0.0/1           0.0.0.0          –  127.255.255.255     128.0.0.0           2147483648
0.0.0.0/0           0.0.0.0          –  255.255.255.255     0.0.0.0             4294967296

Share "CIDR Block"

Share on: FacebookTwitter

XenServer 게스트OS 패닉발생시 /etc/grub.conf 설정 바꿔서 부팅 하기.

커널업데이트 등으로.. 부팅 불가일 경우 boot화면에 커널을 바꿔서 부팅하면 되겠으나. Xenserver의 게스트 OS는 선택이 불가함..
(되든가 ㅎ 기억이.. ㅋㅋ 암튼..)
이런경우 버추얼호스트의 UUID를 확인해서 xen서버에서 다이렉트로 grub.conf 수정이 가능함

Xenserver 콘솔 진입 -> xe-edit-bootloader -u 문제의 게스트OS UUID -p 1
위 방법으로 /etc/grub.conf를 수정 할수 있음 (콘솔은 pool에 묶어있는 xenserver 어느곳이라도 상관 없음)
게스트 OS부팅해보면.. 선택한 커널로 부팅가능~

Share "XenServer 게스트OS 패닉발생시 /etc/grub.conf 설정 바꿔서 부팅 하기."

Share on: FacebookTwitter

blog built using the cayman-theme by Jason Long. LICENSE