2018年12月6日 星期四

How to open a .txt file and display it in a text box using VB.Net

Imports System.IO

Public Class MyForm

    ' ... Whatever code you have for your form

    Public Sub OpenFile()

        Dim oReader As StreamReader

        OpenFileDialog1.CheckFileExists = True
        OpenFileDialog1.CheckPathExists = True
        OpenFileDialog1.DefaultExt = "txt"
        OpenFileDialog1.FileName = ""
        OpenFileDialog1.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
        OpenFileDialog1.Multiselect = False

        If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
            oReader = New StreamReader(OpenFileDialog1.FileName, True)
            RichTextBox1.Text = oReader.ReadToEnd
        End If

    End Sub

End Class

2018年12月4日 星期二

BIOS中Power/APM Configuration

在電源管理(Power Management)功能選單中,選項『Restore on AC Power Loss』決定當電源不足或損壞時系統的處置方式,這個選項有「Power  On」、「Power  Off」、「Last State」三種選擇種,做為電源中斷或不小心意外而關機的應變方式。

「Power  Off」:系統持續在關機的狀態。
「Power  On」:系統會自動重新啟動。
「Last   State」:設定為斷電前的狀態。(我建議)

2018年12月3日 星期一

ubuntu change color of top menu bar in Unity and top menu bar in any window

How to install Ubuntu Tweak?
  • Hit Alt+Ctrl+T to open terminal and run following commands:
    1. For Ubuntu 14.04 onwards, it's available in softxare sources, just type:
      sudo apt-get install unity-tweak-tool
      
    2. For older Ubntu releases:
      sudo add-apt-repository ppa:tualatrix/ppa
      sudo apt-get update
      sudo apt-get install ubuntu-tweak

2018年11月28日 星期三

kernel line上的“rhgb”是什麼?

source:https://www.redhat.com/archives/rhl-list/2004-May/msg07775.html

rhgb = redhat graphical boot - This is a GUI mode booting screen with most of the information hidden while the user sees a rotating activity icon spining and brief information as to what the computer is doing.

quiet = hides the majority of boot messages before rhgb starts. These are supposed to make the common user more comfortable. They get alarmed about seeing the kernel and initializing messages, so they hide them for their comfort.

2018年11月18日 星期日

Ubuntu套件伺服器

sudo apt-get update 台灣區的伺服器連不上,切換到了其他套件伺服器,然後就可以更新

Step1.
按右上角的齒輪>選「系統設定值…」>按「軟體和更新」>按「下載自:」旁的 按鈕/選單>選擇「其他」










接著按下「選最佳的伺服器(S)」(其實你可以在旁邊的欄位隨便挑一個)













接著它會去尋找最適合你的伺服器








當完成後,按下「選擇伺服器(S)」並且輸入密碼











如果出現下圖,按下「重新載入(R)」即可


然後你就成功的切換套件伺服器了…

2018年11月4日 星期日

Linux7(CentOS,RHEL,OEL)和Oracle RAC環境系列-10-ABRT-系統啟動

Linux7會自動檢查和報告錯誤:

Last login: Sat Jan 16 23:09:25 2016 from 192.168.56.1
ABRT has detected 5 problem(s). For more info run: abrt-cli list --since 1452956965
[root@lunar1 ~]# 
Abrt從Linux 6中引入的一個自動缺陷報告工具。 
我們知道,Linux6中開始對新硬件熱插拔特性的支持進一步增強(估計也是移動互聯網和新硬件層出不窮催生的需求)。 
比如,Linux6包括高級數據完整性特性(DIF/DIX),可以通過AER的PCIe設備的增強錯誤檢查,因此就引入了ABRT(自動缺陷報告工具)。 
ABRT全程是Automatic Bug Reporting Tool,它提供了確定和報告系統異常情況,包括內核故障和用戶空間應用崩潰等。 
. 
abrt-cli就是這個工具的命令行接口,也可以使用圖形界面的ABRT工具例如:gnome-abrt &。 
詳細信息,請參見Redhat的官方手冊:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-abrt-handling-problems.html
. 
abrt-cli命令的help內容:

[root@lunar1 ~]# abrt-cli command --help 
用法:abrt-cli [--authenticate] [--version] COMMAND [DIR]...

    list, ls      列出 [in DIRs] 的問题
    remove, rm    删除問题目錄 DIR
    report, e     分析並報告 DIR 中的問题數據
    info, i       輸出有關DIR的信息
    status, st    顯示最近的崩潰計數
    process, p    處理多個問題

详情请查看 'abrt-cli COMMAND --help'
[root@lunar1 ~]# 
現在,我們根據提示查看一下錯誤列表:

[root@lunar1 ~]# abrt-cli list --since 1452956965
id bcb60782560b94bcb05b57145242778992fcacd0
reason:         ibus-daemon killed by SIGABRT
time:           2016年01月17日 星期日 00时39分44秒
cmdline:        /usr/bin/ibus-daemon -r --xim
package:        ibus-1.5.3-13.el7
uid:            54322 (grid)
count:          1
Directory:      /var/spool/abrt/ccpp-2016-01-17-00:39:44-30522

id dc1e51ec4c3bae28ac787be1e32dcfc2ee627af7
reason:         gnome-shell killed by SIGTRAP
time:           2016年01月17日 星期日 00时39分44秒
cmdline:        /usr/bin/gnome-shell
package:        gnome-shell-3.14.4-37.el7
uid:            54322 (grid)
count:          1
Directory:      /var/spool/abrt/ccpp-2016-01-17-00:39:44-4330

id 8002c377b00f1031a59d4eeaa9491a48dcc9f95a
reason:         gnome-shell killed by SIGTRAP
time:           2016年01月17日 星期日 00时23分48秒
cmdline:        /usr/bin/gnome-shell
package:        gnome-shell-3.14.4-37.el7
uid:            54321 (oracle)
count:          2
Directory:      /var/spool/abrt/ccpp-2016-01-17-00:23:48-28148

id 4fd232514a4753e38c05ce5ca1d0ada8b4ef8ba0
reason:         gnome-shell killed by SIGTRAP
time:           2016年01月17日 星期日 00时38分55秒
cmdline:        /usr/bin/gnome-shell
package:        gnome-shell-3.14.4-37.el7
uid:            0 (root)
count:          1
Directory:      /var/spool/abrt/ccpp-2016-01-17-00:38:55-3844

id c7100bb912a43bebe3bdfa13859d473416faba59
reason:         ibus-daemon killed by SIGABRT
time:           2016年01月17日 星期日 00时38分51秒
cmdline:        /usr/bin/ibus-daemon -r --xim
package:        ibus-1.5.3-13.el7
uid:            0 (root)
count:          1
Directory:      /var/spool/abrt/ccpp-2016-01-17-00:38:51-26249
已禁用自動報告功能。請考慮啟用該功能,方法是 
作為有root特權的用戶使用命令'abrt-auto-reporting enabled' 
[root@lunar1 ~]# 

2018年10月28日 星期日

Ubuntu 快捷鍵

1、超級鍵(Win鍵) – 打開dash。

2、長按超級鍵 – 啟動Launcher。

3、按住超級鍵,再按1,2,3等數字鍵 – 從Launcher打開一個應用程序,當你按住超級鍵時,每個應用程序圖標上都會顯示一個數字,按下對應的數字就會打開蓋應用程序。

4、Alt+F1 – 將鍵槃焦點移到Launcher上,使用箭頭鍵進行移動,按回車即可啟動一個應用程序,按下右箭頭鍵顯示Quicklist。

5、Alt+F2 – 以特殊模式打開dash,以便運行任何命令。

6、超級鍵+A – 從Launcher打開應用程序窗口。

7、超級鍵+F – 從Launcher打開文件和文件夾窗口。

8、超級鍵+W – 伸展模式,縮小所有工作空間中的窗口。

9、超級鍵+D – 最小化所有窗口(即顯示桌面),再按一次恢復所有窗口。

10、超級鍵+T – 打開回收站。

11、超級鍵+S – Expo模式,縮小所有工作空間,允許你管理窗口。

12、Ctrl+Alt+T – 啟動Terminal。

13、Ctrl+Alt+L – 鎖住屏幕。

14、Ctrl+Alt+上/下/左/右鍵 – 移動到新的工作空間。

15、Ctrl+Alt+Shift+上/下/左/右鍵 – 將窗口放入新的工作空間。

16、F10 – 打開頂部面板的第一個菜單,使用箭頭鍵瀏覽菜單項。

下面是Ubuntu Unity支持的一些鼠標快捷鍵:

1、在Launcher中,可以拖動圖標對應用程序重新排序。

2、可以直接從Launcher將圖標拖動到回收站,將應用程序從Launcher中移除。

3、光標移到屏幕左側,停止不動几秒,將會啟動Unity Dock。

4、將光標移到左上角(接近Ubuntu圖標),也會啟動Unity Dock。

5、如果Launcher中的應用程序太多,可以滾動鼠標滾輪快速移動。

6、當光標在頂部面板的“聲音”圖標上時,可以通過鼠標滾輪來調整系統音量(放大或降低)。

7、在一個應用程序的Launcher圖標上點擊鼠標中鍵(按一下滾輪),將在一個新的窗口中打開應用程序,有時這個功能非常有用,在筆記本上,衕時按下左/右方向鍵也會達到衕樣的效果。

8、最大化 – 拖動窗口靠近頂部面板會自動最大化。

9、恢復窗口大小 – 向下拖動窗口或雙擊窗口。

10、平鋪 – 將窗口拖向左/右側。

下面是一個有用的窗口管理快捷鍵:

1、Alt+F10 – 在最大化/非最大化之間切換當前窗口。

2、Alt+F9 – 最小化當前窗口。

3、Alt+Tab – 在當前打開的窗口之間切換。

4、Alt+F4 – 關閉當前窗口。

5、Alt+F7 – 移動當前窗口(可以使用鍵槃或鼠標移動)。

ubuntu 11.04自動隱藏右邊啟動欄,安裝:sudo apt-get install compizconfig-settings-manager。然后在里面的桌面中的Ubuntu Unity Plugin中設置。


Jump directly to a specific panel by passing its name to gnome-control-center:
gnome-control-center display
Ubuntu 14.04 or later:

unity-control-center display