Archive for the 'มุม Linux' Category

ssh or sftp without password

Friday, September 7th, 2018

ปกติการจะเข้าไปจัดการอะไรก็ตามใน shell unix ต้อง key user และ password แต่ในบางครั้ง ต้องมีการเขียน shell script เพื่อเอา file ไปวางใวบน server ถ้าจะต้องใส่ passsword คงไม่สะดวก มันมีวิธีทำให้ไม่ต้องใส่ password โดยการขอสิทธิ์บน server นั่นๆ โดยการเข้าเอา key ที่เรา gen key (public key private key pair) บนเครื่องเราก่อน แล้วเอาไปใส่ที่ server วิธีทำ 1. Gen key ที่เครื่องเราก่อน $ ssh-keygen -t rsa$ ssh-keygen -t rsa 2. ได้ key มาแล้ว จะอยู่ที่ user […]

sunos check 32-bit or 64-bit

Friday, March 24th, 2017

บ้างครั้งก็ลืม ไม่ได้ใช้นานๆ คำสั่งเช็คว่า sunos ที่เรากำลังจะใช้งานนี้เป็นแบบ 32-bit หรือ 64-bit ง่ายๆ เลย -bash-4.1$ isainfo options option   -v : Prints detailed information about the other options   -b : Prints the number of bits in the address space of the native instruction set.   -n : Prints the name of the native instruction set used by portable applications supported by the […]

du and sort(size folder and sort)

Thursday, October 15th, 2015

การดู size ของ folder มีขนาดเท่าไหร และเรียงตามขนาดของ size 1 2 3 4 5 6 7 du -sh * | sort -h du : -s : จะคำนวน folder ที่อยู่ ณ path ปัจจับัน -h : ให้แสดงผลเป็นตัวย่อตามขนาดเช่น KB,MB,GB   sort -h : เรียงตามขนาดจากน้อยไปหามากdu -sh * | sort -h du : -s : จะคำนวน folder ที่อยู่ ณ path ปัจจับัน -h […]