Showing posts with label Unix. Show all posts
Showing posts with label Unix. Show all posts

Wednesday, November 09, 2016

File system random write test

wtest()
{
    val=$(( ($RANDOM % 10000 ) + 1 ))
    name=$val
    echo $name
    while [ $val != 0 ]
    do
        echo $val >> $name
        val=$(( $val - 1 ))
    done
    rm $name
}

md5sum files in directories and check

job()
{
    while true
    do
        find bin/ etc/ lib/ sbin/ selinux/ system/ usr/ -type f -exec md5sum \{\} \; > $name
        cal=`md5sum $name | awk -e "{print \\$1}"`
        if [ $cal != 207c55670e306a3a06ea87456e0859da ]
        then
            echo Mismatch
            break
        fi
        sleep $(( ($RANDOM % 20 )  + 1 ))
    done
}

Flush cache

nocache()
{
    while true
    do
        sync
        echo 3 > /proc/sys/vm/drop_caches
        sleep $(( ($RANDOM % 20 )  + 1 ))
    done
}

Monday, April 14, 2014

20140414 Rime Chinese Input Method

This one is very handy and most important of all, it is an open source software.
http://code.google.com/p/rimeime/

Some customization tips:

* Change the number of phrases/characters to be selected per page:

Add the following to C:\Users\xxxxx\AppData\Roaming\Rime\default.custom.yaml
    patch
        "menu/page_size": 9

then 開始功能表 | 小狼毫輸入法 | 【小狼毫】重新部署

* Change the layout of this input method:

Add the following to C:\Users\xxxxx\AppData\Roaming\Rime\weasel.custom.yaml

    patch
        style/horizontal: true          # 候選橫排
        style/inline_preedit: true      # 內嵌編碼(僅支持 TSF)
        style/display_tray_icon: true   # 顯示托盤圖示


then 開始功能表 | 小狼毫輸入法 | 【小狼毫】重新部署

* Delete user-defined phrase

When input, select the to-be-deleted user-defined phrase and [Ctrl-Delete] to delete.

System provided phrases cannot be deleted.