Categories
System/Linux/Unix*

[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

Categories
System/Linux/Unix*

[memo] 常用 ubuntu 升級套件指令 / ubuntu upgrade commands

# 更新 apt update # 列出可 upgrade 的 package apt list –upgradable # 只 upgrade 這些 packages apt –only-upgrade install XXXXX

Categories
System/Linux/Unix*

[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=

Categories
System/Linux/Unix*

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 […]

Categories
System/Linux/Unix*

[note] Ubuntu 18.04 IP address setup , resolv

 

Categories
Network service System/Linux/Unix*

ssh backup command

tar zcvf – KeepTheseFiles | ssh user@desthost ‘cat > KeepTheseFiles.tgz’

Categories
hardware Iot Service System/Linux/Unix*

教學: 在 Ubuntu 使用 DS18B20 溫度感測器把溫度上傳到 ThingSpeak 附範例程式 / IoT 可參考

Office temperature

Categories
System/Linux/Unix*

[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 […]

Categories
System/Linux/Unix*

Protected: [note] Install php7 oci8 on Ubuntu steps

There is no excerpt because this is a protected post.

Categories
System/Linux/Unix*

ubuntu : add-apt-repository

sudo apt-get install software-properties-common