Currently browsing category

Linux

sed 前後加文字

sed -i -e ‘s/^/lfs_migrate -y /’ scratch.txt 在每一行前面加入 lfs_migrate -y sed -i -e ‘s/$/ \&/’ scratch.txt 在每一行後面加入 & 符號

iperf 測試速度

$ iperf -c 172.23.1.51 -t 60 -i 5 ———————————————————— Client connecting to 172.23.1.51, TCP port 5001 TCP window size: 49.5 KByte (default) …

OpenSSH Legacy Options

Unable to negotiate with legacyhost: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1 $ ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 username@xxx.xxx.xxx.xxx Unable to negotiate with …

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 …