use sshfs to mount remote filesystem , command sample

安裝 command : apt-get install sshfs sshfs [user@]host:[remote_directory] mountpoint [options] sshfs -p 2200 rimmon@dev.monster.tw:/home/rimmon DEV fusermount -u DEV sshfs -p 2200 -o reconnect webuser@172.25.1.228:/mnt/tslog_bak ~/TSLOG_BAK fusermount -u ~/TSLOG_BAK 速度測試 sshfs -p 2200 -o reconnect xxx@ts228.monster.tw:/mnt/tslog_bak ~/TSLOG_BAK 1.1G 費時 19秒 , 約 55MB/s

[memo] 用 shell awk 加總 column

ls -l `find /mnt/tslog/archive/ -name “*20190[1..6]*” -type f` | awk ‘{sum += $5} END {print sum}’ 160038650315 ls -l `find /mnt/tslog_bak -name “*20190[1..6]*” -type f` | awk ‘{sum += $5} END {print sum}’ 160038650315 ls -l `find /mnt/tslog_backup2 -name “*20190[1..6]*” -type f` | awk ‘{sum += $5} END {print sum}’ 160038650315

[memo] Ubuntu : ctrl-L not work , 按 ctrl-L 不會清除螢幕 , TERM , .bashrc .profile 問題 , Ubuntu 8.04.4 LTS

這個版本的 .bashrc 不 work , 要用 .profile lsb_release  -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 8.04.4 LTS Release: 8.04 Codename: hardy —- $ cat .profile export EDITOR=vi export PATH=/sbin:$PATH export LANG= export TERM=xterm export http_proxy= export https_proxy=

Use dd command to backup whole disk to image file , acer desktop , win7 , pv(pipe viewer example)

Acer ASPIRE M1930 partition layout Same PC but install windows7   — OK! 在 virtualbox 測試 dd if=/dev/sda | pv | ssh -p 2200 rimmon@london.monster.tw ‘cat > winxp2.dd.img’ ssh -p 2200 rimmon@london.monster.tw ‘cat winxp2.dd.img’ | pv | dd of=/dev/sda — OK! 把 Acer PC 整個硬碟備份到遠端 server 的 image file dd if=/dev/sda | pv | ssh […]

[memo] ssh tunnels

ssh -D 12345 -o TCPKeepAlive=yes -o ServerAliveInterval=10 -p 2200 rimmon@safe.monster.tw ssh -D 12345 -o TCPKeepAlive=yes -o ServerAliveInterval=10 rimmon@safe.monster.tw ssh -L 33389:192.168.100.2:3389 -o TCPKeepAlive=yes -o ServerAliveInterval=10 -p 2200 rimmon@safe.monster.tw   # —– ssh -L 8000:192.168.1.1:80 -o TCPKeepAlive=yes -o ServerAliveInterval=10 -p 2200 rimmon@desktop.monster.tw 說明: 在本機端(port 8000) 建立一個與 desktop.monster.tw 的 ssh (port 2200) 通道, 由 desktop.monster.tw 連向 192.168.1.1 […]