how to mount hdfs

Posted: 31st July 2010 by admin in Linux How to
ant compile-c++-libhdfs -Dislibhdfs=1
mkdir build/libhdfs
cp -r build/c++/Linux-amd64-64/lib/* build/libhdfs/
ant compile-contrib -Dislibhdfs=1 -Dfusedfs=1 -Dlibhdfs-fuse=1
ln -s /usr/local/hadoop/build/contrib/fuse-dfs/fuse_dfs* /bin/
ln -s /usr/local/hadoop/build/libhdfs/* /lib/
mkdir /mnt/hdfs

test mount

fuse_dfs_wrapper.sh dfs://hdmaster01:59995 /mnt/hdfs -d &
ls /mnt/hdfs

mount iso on solaris

Posted: 30th July 2010 by admin in Linux How to

two command

lofiadm -a /root/my.iso
mount -F hsfs -o ro /dev/lofi/1 /mnt/cdrom

one command

mount -F hsfs -o ro `lofiadm -a /root/my.iso` /mnt/cdrom

zfs basic command

Posted: 30th July 2010 by admin in Linux How to
zpool create mypool /dev/dsk/c0t0d0
zfs list
zfs mount mypool
zfs unmount mypool
zfs create mypool/test
zfs destroy mypool/test
zfs rename mypool/test mypool/test2
zfs set canmount=off mypool
zfs set mountpoint=/home mypool
zfs set compression=on mypool
zfs set atime=off mypool
zfs set quota=1G mypool/test

bash: rsync: command not found

Posted: 29th July 2010 by admin in Linux How to

bash: rsync: command not found

fix by add –rsync-path=PATH

Edit ld.config on solaris 10

Posted: 28th July 2010 by admin in system

Edit Default Library Path on solaris 10
type “crle” for list Default Library Path

crle

Configuration file [version 4]: /var/ld/ld.config
Default Library Path (ELF): /usr/local/lib:/lib:/usr/lib
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)

Command line:
crle -c /var/ld/ld.config -l /usr/local/lib:/lib:/usr/lib

type “crle -c /var/ld/ld.config -l /usr/local/lib:/lib:/usr/lib” to change Default Library Path

crle -c /var/ld/ld.config -l /usr/local/lib:/lib:/usr/lib

enable php curl proxy

Posted: 2nd January 2010 by admin in php

curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY,”$host:$port”);

snmptranslate

Posted: 26th June 2009 by admin in linux security, network
snmptranslate -IR  tcpPassiveOpens.0

TCP-MIB::tcpPassiveOpens.0

snmptranslate -On TCP-MIB::tcpPassiveOpens.0

.1.3.6.1.2.1.6.6.0

snmptranslate .1.3.6.1.2.1.6.6.0

TCP-MIB::tcpPassiveOpens.0

การเปิด timestamp จะทำให้ต้องเพิ่ม ‏ 12bytes ไว้ที่ TCP header ครับ

Linux

เปิด :

echo 1 >/proc/sys/net/ipv4/tcp_timestamps

ปิด :

echo 0 >/proc/sys/net/ipv4/tcp_timestamps

*BSD

เปิด :

sysctl -w TCPCTL_DO_RFC1323=true

ปิด :

sysctl -w TCPCTL_DO_RFC1323=false

หรือ

เปิด :

sysctl -w net.inet.tcp.rfc1323=true

ปิด :

sysctl -w net.inet.tcp.rfc1323=false

command count tcp state

Posted: 8th June 2009 by admin in network, system
Tags:
netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c

การทำ null route บน linux

Posted: 31st May 2009 by admin in network
Tags:

คำสั่งดรอปการโจมตีจาก ip ด้วยคำสั่ง route  บน linux

route add xxx.xxx.xxx.xxx reject

คำสั่งตรวจสอบว่าทำการปิดกันเรียบร้อยหรือยังถ้าแสดงข้อความแบบด้านล่างแสดงว่าได้ปิดกั้น ip นั้นเรียบร้อยแล้ว

ip route get  xxx.xxx.xxx.xxx

RTNETLINK answers: Network is unreachable
ใช้คำสั่งด้านล่างเพื่อดู ตารางการ route

[root@demo01 ~]#route -n

ใช้คำสั่งด้านล่างเพื่อยกเลิกการปิดกัน ip ดังกล่าว

[root@demo01 ~]#route del -host xxx.xxx.xxx.xxx reject

 หมายเหตุ xxx.xxx.xxx.xxx คือ ip ที่ต้องการปิดกั้น