Currently browsing category

Linux, Page 13

perl – 列出 CPU 資訊

忘記當時寫這個要做什麼 XD #! /usr/bin/perl open(INFO,”top -b -n 1|”); open(CPUCORES, “cat /proc/cpuinfo | grep processor | tail -n 1 | awk ‘{print $3 …

lustre – 設定 stripe

取得 lustre stripe 狀態 # lfs getstripe /home/xxxx 設定每 4MB 為1個 stripe 最多只用 1 個 stripe 然後每個檔案只分配到一個 OST # lfs setstripe -S 4M -i …

lustre – 顯示 drive 掛載資訊

# for d in {c..g} ; do echo “/dev/sd`echo $d`1” ; tunefs.lustre –writeconf –dryrun /dev/sd`echo $d`1 |grep “lustre=”;done /dev/sdc1 Target: lustre=OST0002 /dev/sdd1 …

CentOS7 NAT server

# echo “net.ipv4.ip_forward = 1” >> /etc/sysctl.d/ip_forward.conf # sysctl -w net.ipv4.ip_forward=1 #### em1 is internal. em2 is public. # firewall-cmd –permanent –add-rule …

Using expect script to power on IBM blades

#!/usr/bin/expect -f spawn ssh root@bcmm.liho.tw expect “password:” send “PASSWORD\r” expect “system>” send “power -on -T system:blade\[1\]\r” expect “system>” send “power -on -T …