2025年7月4日 星期五

Install nVidia Driver for Ubuntu 22.04 /安裝 nVidia 驅動程式 for Ubuntu 22.04

1.檢視顯卡資訊
     $ sudo lshw -numeric -C display

   輸出-------------------------------------
  description: VGA compatible controller
       product: GK208B [GeForce GT 710] [10DE:128B]
                           我的顯卡型號

  也可以使用 lspci | grep -i nvidia 查詢

--------------------------------------------

2.將 nvidia driver 及相關套件/軟件包
    $ sudo apt-get purge nvidia*

3.收金鑰
   $ sudo add-apt-repository ppa:graphics-drivers

4.更新本機套件庫列表
    $ sudo apt-get update

 5.更新已安裝套件
    $ sudo apt upgrade

6.  到  https://www.nvidia.com/zh-tw/drivers/ 確認顯卡對應的Driber 版號

7.列出可用的驅動程式
    $ ubuntu-drivers list 

8.安裝
    $ sudo apt install nvidia-driver-<版號>

9.重開



2016年12月8日 星期四

新增解析度

版本:Ubuntu 16.04

1.取得相關參數
$ cvt 1366 768
# 1368x768 59.88 Hz (CVT) hsync: 47.79 kHz; pclk: 85.25 MHz
Modeline "1368x768_60.00"   85.25  1368 1440 1576 1784  768 771 781 798 -hsync +vsync
$ xrandr
Screen 0: minimum 320 x 200, current 1368 x 768, maximum 16384 x 16384
HDMI-0 disconnected (normal left inverted right x axis y axis)
DVI-0 disconnected (normal left inverted right x axis y axis)
VGA-0 connected primary 1368x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x768      60.00 
   800x600       60.32    56.25 
   848x480       60.00 
   640x480       59.94 
   1920x1080     59.96 
   1440x900      59.89 
   1368x768      59.88*

2.設定
$ sudo xrandr --newmode "1368x768"   85.25  1368 1440 1576 1784  768 771 781 798 -hsync +vsync
$ sudo xrandr --addmode VGA-0 "1368x768"

2016年11月26日 星期六

放大滑鼠游標並變更游標主題

版本:Ubuntu 16.04
1.放大滑鼠游標
a.啟動 dconf 編輯器(或安裝 dconf Editor)

b.左側窗格
     org > gnome > desktop > interface
c.右側上方窗格尋找 [cursor-size] ,變更數值

  使用CLI
  dconf write /org/gnome/desktop/interface/cursor-size VALUE
  >
2.變更游標主題
a.啟動 Ubuntu Tweak
b.上方 > [調校]
c.[佈景主題] > [游標主題]
d.從下拉清單點選 游標主題
   

2014年10月26日 星期日

[mint]登入自動變更螢幕解析度

發行版:inux Mint 17 “Qiana” Cinnamon
目的:登入後變更螢幕解析度為 1440 x 900

1.取得設定的相關資訊 (新增 1440 x 900)

haruka ~ # cvt 1440 900
# 1440x900 59.89 Hz (CVT 1.30MA) hsync: 55.93 kHz; pclk: 106.50 MHz
Modeline "1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync

2.在該登入者家目錄建立登入自動變更螢幕解析度的 Script (檔名任取 => chrat )如下

#!/bin/bash
echo 'YourPassWord' | sudo -S su -
xrandr --newmode "1440x900"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync
xrandr --addmode VGA-0 "1440x900"
xrandr --output VGA-0 --mode "1440x900"

3.在  .profile 中執行該 Script

./ chrat

2014年10月19日 星期日

手動刪除 Gnome 3 的啟動圖示

1.在 CLI 移動工作目錄至家目錄中的 .config/gnome-panel/launchers/
2.刪除要移除的啟動圖示定義檔


2013年2月15日 星期五

[LDAP]安裝(Installation) 使用 YUM

1. 相關套件
 [root@server_Y ~]# yum list *openldap* | grep x86
openldap.x86_64                              2.4.23-26.el6_3.2            @sl-security
compat-openldap.x86_64              1:2.3.43-2.el6                  sl
openldap-clients.x86_64                2.4.23-26.el6_3.2            sl-security
openldap-devel.x86_64                  2.4.23-26.el6_3.2            sl-security
openldap-servers.x86_64                2.4.23-26.el6_3.2            sl-security
openldap-servers-sql.x86_64         2.4.23-26.el6_3.2            sl-security
 

[root@server_Y ~]# yum list *nss* | grep ldap | grep x86
nss-pam-ldapd.x86_64             0.7.5-14.el6_2.1       sl


[root@server_Y ~]# yum list mod_authz_ldap | grep x86
mod_authz_ldap.x86_64                       0.26-15.el6     

    在Red Hat官方部屬手冊『Red_Hat_Enterprise_Linux-6-Deployment_Guide-en-US』第16章中提到,建置opneldap server 需要安裝下列套件,

 a. openldap.x86_64   :   內含openldap Server端 與 client端 應用程式運作所需的必要函式庫,通常預設已安裝。

 b. openldap-servers.x86_64 :  內含openldap service 主程式與相關工具,slapd 這支 Daemon就包含在這個套件裡面。

c. openldap-clients.x86_64  :  內含在 CLI 下用來檢視及修改內容的命令。

d. openldap-servers-sql.x86_64 : 內含支援 SQL 的相關模組。

e. compat-openldap.x86_64 :  內含 openldap 相容函式庫。

另外,通常會加裝下列套件,
 
f. nss-pam-ldapd.x86_64  :  內含 nslcd 這支服務,用以管制可以從本地端向 ldap 提出詢問請求的user。

g. mod_authz_ldap.x86_64 : 內含 mod_authz_ldap 這支 LDAP for Apache HTTP server 認證模組。

2. 確認已安裝套件
[root@server_Y ~]# rpm -qa | grep openldap
openldap-2.4.23-26.el6_3.2.x86_64

3. 安裝所需套件
[root@server_Y ~]# yum -y install \
openldap-servers.x86_64  \
openldap-clients.x86_64 \
openldap-servers-sql.x86_64 \
compat-openldap.x86_64
 >>>>Back to Table of Contents

2013年1月14日 星期一

[LDAP]安裝(Installation)

1.Required Software
     Standard C compiler (required)
     Cyrus SASL 2.1.21+ (recommended)
     OpenSSL 0.9.7+ (recommended)
     Reentrant POSIX REGEX software (required)

     Oracle Berkeley DB 4.4 - 4.8 or 5.0 - 5.1     

2.Download

     OpenLDAP :
        Offical Site:http://www.openldap.org/
        Documentation Download Page:http://www.openldap.org/doc/
        Source Code Download Page:http://www.openldap.org/software/download/
$ wget ftp://ftp.dti.ad.jp/pub/net/OpenLDAP/openldap-release/openldap-2.4.33.tgz

    SSL/TLS:
        Offical Site:http://www.openssl.org/
        Documentation Download Page: http://www.openssl.org/docs/
        Source Code Download Page:ftp://ftp.openssl.org/source/
$ wget ftp://ftp.openssl.org/source/openssl-1.0.1c.tar.gz


    Berkeley DB:
        Offical Site:http://www.oracle.com/us/products/database/berkeley-db/overview/index.html
        Source Code Download Page:http://www.oracle.com/technetwork/products/berkeleydb/downloads/index.html?ssSourceSiteId=ocomen

      SASL:
          Source Code Download Page:http://ftp.andrew.cmu.edu/pub/cyrus-mail/  
          Direct Download Link :ftp://ftp.cyrusimap.org/cyrus-imapd/cyrus-imapd-2.4.16.tar.gz 
$ wget http://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.25.tar.gz

2.Insatll

    SSL/TLS:
$ tar zxvf openssl-1.0.1c.tar.gz
$ cd openssl-1.0.1c
$ ./config shared --openssldir=/usr/local
$ make
$ su -c "make install"
    Berkeley DB:
$ tar zxvf  db-5.0.32.tar.gz
$ cd db-5.0.32/build_unix/
$ ../dist/configure  --prefix=/usr/local
$ make
$ su -c "make install"

$  \ls -l /usr/local/lib/libdb-*
-rw-r--r--. 1 max  max  2653808 Jan 15 11:57 /usr/local/lib/libdb-5.0.a
-rw-rw-r--. 1 max  max      933 Jan 15 11:56 /usr/local/lib/libdb-5.0.la
-rwxrwxr-x. 1 max  max  1704381 Jan 15 11:56 /usr/local/lib/libdb-5.0.so
lrwxrwxrwx. 1 root root      12 Jan 15 11:57 /usr/local/lib/libdb-5.so -> libdb-5.0.so
                  ※Confirm /usr/local/lib/libdb-5.0.so exist


    SASL:
 $ tar zxvf cyrus-sasl-2.1.25.tar.gz
$ cd cyrus-sasl-2.1.25/

$ ./configure
$ make
$ su -c "make install"su -c "ln -s /usr/local/lib/sasl2/ /usr/lib/sasl2"
              ※cyrus-sasl-2.1.26 can't compile

 
    OpenLDAP :
 $ tar zxvf openldap-2.4.33.tgz
$ cd openldap-2.4.33.tgz

$./configure --enable-wrappers
$ make
$ su -c "make install"su -c "ln -s /usr/local/lib/sasl2/ /usr/lib/sasl2"
             
   

[LDAP]LAB 環境

使用 YUM 安裝 LAB_A
HOST1:
Hostname:server_Y.mpsstudio.org
OS:Scientific Linux 6.3
RAM:1G  /  Storage:1G
IP:10.50.100.1  / 10.150.100.1


HOST2:
Hostname:server_slave_Y.mpsstudio.org
OS:Scientific Linux 6.3
RAM:1G  /  Storage:1G
IP:10.50.100.10  / 10.150.100.10

HOST3:
Hostname:client.mpsstudio.org
OS:Scientific Linux 6.3
RAM:1G  /  Storage:1G
IP:10.50.100.100  / 10.150.100.100

>>>>Back to Table of Contents

2013年1月13日 星期日

[LDAP]LDAP System Administration - Table of Contents

 Table of Contents
  • 基礎概念
  • LAB 環境
  • 安裝 
  • 設定
  • 操作
  • 資料庫管理
  • 安全性
    • Access Control
    • SASL
    • TLS
  • 整合應用
    • NIS
    • E-MAIL
    • Samba
    • FTP
    • HTTP
  • NET::LDAP
  • PERL
  • 維護(Maintenance)
  • 監控(Monitoring)
  • 效能調整(Performance Tunining)
  • 除錯(Troubleshooting)

2012年10月13日 星期六

[Learning Linux]Learning Linux - Expertise

系統管理(System Administration)

 

服務管理(Service Management)


專門技術(Expertise) 


   安全(Security)


   效能調教(Performance Tuning)


Reference 
About Linux Certification

[Learning Linux]Learning Linux - System Administrator

系統管理(System Administration)

  在CLI(Command Line Interface)環境下管理系統

    提示字串(Prompt String)
      PS1 (Prompt String 1)
      PS2 (Prompt String 2)
    變更loging shell

帳號管理

   /etc/passwd

服務管理(Service Management)



專門技術(Expertise)


Reference 
About Linux Certification

[Linux]About Linux Certification

    目前在台灣能見度較高的Linux 認證有 LPIC(Linux Professional Institute Certification) 及 Red Hat 兩大系統。

    LPIC 號稱為一中立的認證機構,其認證內容主要是在檢測考生對於Linux共通知識了解的程度,考試的方式是筆試。

    LPIC的認證到目前為止(2012.10.13)共分為 LPIC-1、LPIC-2、LPIC-3 三種等級,在LPIC的官方網站有詳細的說明,http://www.lpi.org/linux-certifications/programs

    Red Hat 的認證主要是針對Red Hat 所推出的產品,考試的方式是採實機測試。

    目前 Red Hat 推出的認證與Linux 系統管理相關的共有RHCSA(Red Hat Certified System Administrator)、RHCE(Red Hat Certified Engineer)、RHCA(Red Hat Certified Architect)、
RHCVA(Red Hat Certified Virtualization Administrator)、RHCSS(Red Hat Certified Security Specialist)等,詳細的資訊可從官方網站取得,https://access.redhat.com/knowledge/articles/133273

[Linux]Reference

  • Linux System Administration Recipes:A Problem-Solution Approach
    (writer:Juliet Kemp)
  • Expert Shell Scripting   (writer:Ron Peters)
  • Linux Shell 程式設計實務  (writer:臥龍小三)
  • Linux Shell Scripting Cookbookl  (wruter:Sarath Lakshman)
  •  

2012年10月4日 星期四

[Learning Python]不同型態的引號

建立字串時,可以使用『'(單引號)』、『"(雙引號)』、『'''(三個單引號)』或『"""(三個雙引號)』將字串的頭尾兩端括起來。

=>
    Var = 'This is a String'
    Var = "This is a String"
    Var = '''This is a String'''
    Var = """This is a String"""

與 Bash shell 不同,這四種型態的引號對Python來講在功能上是一樣的,Python提供四種型態的引號主要是要讓使用者在建立字串時可以有更多的彈性。

例如當使用單引號括住字串,而字串中又出現縮寫,Python會認為引號不成對,因此就會發生語法錯誤。

=>
Var =  'This isn't a string'

>>> Var =  'This isn't a string'                                              
  File "<stdin>", line 1
    Var =  'This isn't a string'
                     ^
SyntaxError: invalid syntax                







這時就可以改用雙引號或三引號括住字串來解決這個問題。

=>
Var = "This isn't a string"

Var =  '''This isn't a string'''

[Learning Python]建立字串

建立字串有兩種常見的方式可以選擇,

A.指定一個字串給變數 

語法:
    Var = 'String'
    Var = "String"
    Var = '''String'''
    Var = """String"""

    字串要用引號括起來,只要兩端用的引號是一致的即可。

 B.使用 str()函數建立

語法:
    Var = str(String)

    str() 函數也可以用來將其他型別的物件轉換成 str 型別

2012年9月22日 星期六

[Performance Tuning]Monitoring and Analyzing Linux System Performance

1.How to Monitor and Analyz Linux System Performance
2.CPU
3.Memory
4.IO
5.Storage
6.Networking

2012年8月21日 星期二

[Drupal]WYSIWYG Editor Module

1.安裝:http://drupal.org/project/Wysiwyg

2.設定:Modules -> USER INTERFACE -> Wysiwyg ->Configure

  • INPUT FORMAT : 設定在不同輸入模式的介面中可使用的編輯功能
  • INSTALLATION INSTRUCTIONS : 選擇要安裝的 Editor

2012年6月11日 星期一

[KVM]How to convert .vhd image file to the qcow2 image type

如果要將 .vhd 或其他 kvm-img 可辨識的映像檔格式轉換乘 raw 或其他其他 kvm-img 可辨識的映像檔格式,可以使用 kvm-img 命令進行轉換。

使用 kvm-img 轉換映像檔格式的語法如下,

kvm-img  convert -O <Output Format>   <FileName>  <Output FileName>

以下以轉換 .vhd 格式檔案為 .qcow2 格式檔案為例,
 
max@satomi:~$ kvm-img convert -O qcow2 FileName.vhd OutputFileName.qcow2       




所需的轉換時間視主機效能及轉換檔案的大小而定。


2012年6月9日 星期六

[Ubuntu]在Ubuntu 12.04 Desktop 加裝LXDE 與 Gnome 3 Classic 桌面環境(Desktop environment)

將舊筆電 (Fujitsu s6510)升級為 Ubuntu 12.04 Desktop 後發現內建的桌面環境還是沒有 LXDE 與 Gnome , 所以還是要自己動手裝。

加裝 LXDE 比較簡單只需要......
 
$ sudo apt-get update                    
$ sudo apt-get install lxde




就可以了。

如果只需要 LXDE 可以直接裝 lubuntu 12.04 (http://lubuntu.net/)。

加裝 Gnome 就比較麻煩,我是依據 
http://ubuntuguide.net/install-tweak-classic-gnome-desktop-in-ubuntu-12-04-precise/
的方法裝的,不過之後再查,似乎還有其他的安裝程序比較簡便,至於這些不同的程序有何差異......,比起Server 的管理,在 Desktop 的使用上我是採實用主義 , 所以並沒有花時間深入研究的打算 , 總之 , 在使用這個方法加裝 Gnome 前建議先找其他方法試試.....

以下是我加裝Gnome 的紀錄,

1.先加裝『gnome-session-fallback』這個套件 , 再增加『jconti/gnome3』的 repository 加到套件資料庫伺服器清單中



max@tomomi:~$sudo apt-get install gnome-session-fallback               
max@tomomi:~$sudo add-apt-repository ppa:jconti/gnome3





2.接著修改『/etc/apt/sources.list.d/jconti-gnome3-precise.list』的內容

max@tomomi:~$sudo vim /etc/apt/sources.list.d/jconti-gnome3-precise.list         


 


deb http://ppa.launchpad.net/jconti/gnome3/ubuntu precise main
deb-src http://ppa.launchpad.net/jconti/gnome3/ubuntu precise main   



 
 兩行中的『precise』改成『oneiric』....

# deb http://ppa.launchpad.net/jconti/gnome3/ubuntu precise main
deb http://ppa.launchpad.net/jconti/gnome3/ubuntu oneiric main
# deb-src http://ppa.launchpad.net/jconti/gnome3/ubuntu precise main
deb-src http://ppa.launchpad.net/jconti/gnome3/ubuntu oneiric main     






 3.更新套件庫清單後再安裝一大票東西.....

max@tomomi:~$sudo apt-get update     
max@tomomi:~$sudo apt-get install indicator-applet indicaator-applet-complete indicator-applet-session   





不過,目前的 Gnome3 似乎還有不少問題,裝完之後還需要手動調整一些東西,不然並不如Gnome2好用....=_= ~ 有點麻煩....

我調整了.....

1.ALT-TAB 失效。
2.將程式加到快速啟動列之後就無法刪掉。
3.功能表列的字體顏色是深灰色,跟底色幾乎一樣。

等問題 .....囧~~

如果不是 LXDE 沒有延伸桌面可用,以我的需求,其實用 LXDE 就夠了說....囧

2012年5月30日 星期三

[Ubuntu]How to configure network in bridge mode on Ubuntu 10.04 / 12.04

這個程序在 Ubuntu 10.04 及 12.04 都可以用



1.安裝橋接工具套件『bridge-utils』及『 uml-utilities』
 
$ sudo apt-get install bridge-utils uml-utilities



2.新增橋接器『br0』

    橋接器的名稱並沒有特別的規定,比較常看到的是『br0』或『bri0』。

   新增橋接器的語法如下,

        brctl  sddbr   <橋接器名稱>

$ sudo brctl addbr br0


 
3.將eth0接到橋接器『br0』

    概念上就跟使用實體橋接器是一樣的,這個動作可以當成是拿一條網路線連接主機的網路卡與橋接器。

    橋接網路卡的語法如下,

        brctl  sddif    <橋接器名稱>  <實體網卡名稱>

$ sudo brctl addif br0 eth0



4.檢視橋接器

    設定完畢看一下設定結果。

     檢視的語法如下,

        brctl  show

$ sudo brctl show

bridge name          bridge id           STP enabled         interfaces   
br0               8000.c89cdc26033b no                    eth0     
virbr0 8000.000000000000 yes







 5.修改『 /etc/network/interfaces』設定檔

    設定完橋接器之後接著還要修改網路介面設定檔,修改內容如下,

#將eth0的網路組態設定註解掉
# The primary network interface
#auto eth0
#iface eth0 inet dhcp


#新增橋接器網路組態設定
auto br0
iface br0 inet static
#將eth0接到橋接器 br0                                                          
bridge_ports eth0
address X.X.X.X #這是橋接器的IP
netmask A.B.C.D
gateway Y.Y.Y.Y 
















6.啟動 IP Forwarding

    找到『/etc/sysctl.conf』設定檔中的『#net.ipv4.ip_forward=1』 這一行,將前面的註解符號拿掉。

# Uncomment the next line to enable packet forwarding for IPv4 
#net.ipv4.ip_forward=1 
net.ipv4.ip_forward=1  #<--將這一行的註解拿掉,啟動IP Forwarding 』 





7.重開機    

$ sudo reboot                                          



8.收工



Powered By Blogger