2017年8月17日 星期四

Windows10 & 2016 WOL

關於Windows10之後Wake on lan失效問題,請到下面連結下載
Win10 Auto Installation Program的realtek driver,安裝之後問題解決,也不用像其他資料寫得要改green ethernet或者Windows10的fast boot。


Win10 Auto Installation Program (SharedID:
1152921504607292454SId:1152921504626816921)
10.0192017/7/2710404kGlobal

2017年8月8日 星期二

bash script sample

Bash Script 檔案及目錄是否存在



檢查檔案是否存在

2017年8月3日 星期四

dpkg-reconfigure dash

dpkg-reconfigure dash

Ubuntu / Debian 發行版本預設都使用 dash 作為 shell,但若使用 bash 習慣的人必定要執行此指令,choice No 將預設 shell 改為 bash! 

dpkg-reconfigure locales

本土化語言設定。

dpkg-reconfigure tzdata

時區設定。

dpkg-reconfigure exim4-config

設定 Mail Transfer Agent(MTA)。

dpkg-reconfigure console-setup

設定 console 的字型、編碼等

dpkg-reconfigure gdm/lightdm

設定 display manager。目前 Ubuntu 預設為 lightdm,舊版為 gdm(gnome display manager。

dpkg-reconfigure openssh-server

重新產生 SSH server RSA 與 DSA key。

dpkg-reconfigure wireshark

安裝 wireshark 完成後,必須要使用 root 才可以順利擷取到網路介面封包,透過此命令可以設定一般使用者也可以正常操作

2017年8月1日 星期二

bash script sample

1.create a select menu in a shell script?

#!/bin/bash

PS3='Please enter your choice: '
options=("Option 1" "Option 2" "Option 3" "Quit")
select opt in "${options[@]}"
do
    case $opt in
        "Option 1")
            echo "you chose choice 1"
            ;;
        "Option 2")
            echo "you chose choice 2"
            ;;
        "Option 3")
            echo "you chose choice 3"
            ;;
        "Quit")
            break
            ;;
        *) echo invalid option;;
    esac
done

2.create a Function in a shell script?

#!/bin/bash
           function quit {
               exit
           }
           function hello {
               echo Hello!
           }
           hello
           quit
           echo foo