顯示具有 系統設定 標籤的文章。 顯示所有文章
顯示具有 系統設定 標籤的文章。 顯示所有文章

2015年6月23日 星期二

【備忘】用 iconv 來轉換文字編碼

在 Linux 下閱讀簡體字的文件時,可以先透過 iconv 來轉換文字編碼,避免用文字編輯器打開檔案時呈現亂碼

iconv 的說明:
NAME
       iconv - Convert encoding of given files from one encoding to another

SYNOPSIS
       iconv -f encoding [-t encoding] [inputfile]...

DESCRIPTION
       The iconv program converts the encoding of characters in inputfile, or from the standard input if no filename is specified, from one coded character set to another. The result is
       written to standard output unless otherwise specified by the --output option.

       --from-code, -f encoding
              Convert characters from encoding.

       --to-code, -t encoding
              Convert characters to encoding. If not specified the encoding corresponding to the current locale is used.

       --list, -l
              List known coded character sets.

       -c     Omit invalid characters from output.

       --output, -o file
              Specify output file (instead of stdout).

       --silent, -s
              Suppress warnings, but not errors.

       --verbose
              Print progress information.

       --help, -?
              Give help list.

       --usage
              Give a short usage message.

       --version, -V
              Print program version.
假設來源檔案為 source.txt,轉換成 utf-8 後的檔名叫 target.txt,那麼就在命令列輸入下列內容:
iconv -f gb2312 -t utf-8 source.txt --output target.txt
搞定收工!

2015年2月27日 星期五

Lubuntu 14.04 下 設定 Lenovo W510 亮度控制

首先編輯 xorg.conf(必須有 su 權限):

sudo vi /etc/X11/xorg.conf

然後找到 "Device" 區段,將

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"


改成

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "Quadro FX 880M"
Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection


之後重開機即可。