Monthly Archives: October 2005

如何用鼠标右按钮直接以 Root 身份开启文件?

gedit $HOME/.gnome2/nautilus-scripts/Open as root

# 在新增的文件内加入下面这几行

for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
    gnome-sudo "gnome-open $uri" &
done

# 保存编辑过的文件 (范例)
#

chmod +x $HOME/.gnome2/nautilus-scripts/Open as root

#

鼠标右按钮点击文件 -> Scripts -> Open as root

DNS服务的建立

首先安装BIND套件 

代码: 
sudo apt-get install bind 

这时在/etc/bind下会出现(这里跟其他的UNIX/LINUX不同,一般其他的UNIX/LINUX默认是把配置文件放 

在/etc/named下,数据文件放在/var/named或/var/bind下的,而UBUNTU都一起放在这个目录下了) 

db.0 db.255 db.root named.conf.local 
db.127 db.local named.conf named.conf.options 

其中named.conf为主配置文件,named.conf.local和named.conf.options这两个文件在其他的UNIX/LINUX 

系统里默认是没有的,UBUNTU的这种想法很不错,把各个部分都分开管理;其余的部分都是默认生成的几 

个数据文件。这里需要稍微讲一下区数据文件里的几个资源记录的含义: 

SOA记录:指示该区的权威 
NS记录:列出该区的一个名字服务器 
A记录:名字到地址的映射 (也就是正向解析) 
PTR记录:地址到名字的映射 (也就是反向解析) 
CNAME:规范名字 (别名记录) 

下面开始服务配置 
缓存域名服务器设置 (Cache-only server) 
缓存域名服务器顾名思义其自身是没有域名记录的,仅仅从别的DNS上获取记录并做高速缓存。 
安装好DNS服务后,不需要任何配置,只需要把服务起起来就是缓存域名服务器了。 

代码: 
sudo /etc/init.d/bind start 

主DNS配置 
安装好DNS后,配置named.conf.local,如下例: 
代码: 

zone "163.com" { 
        type master; 
        file "/etc/bind/db.163.com"; 
}; 

zone "sohu.com" { 
        type master; 
        file "/etc/bind/db.sohu.com"; 
}; 

zone "sina.com" { 
        type master; 
        file "/etc/bind/db.sina.com"; 
}; 

… 

 

保存配置,然后再创建相对应的数据文件,如上例163.com的数据文件如下: 
代码: 

//db.163.com的配置文件 
$TTL 86400 
@           IN  SOA     dns.163.com  root.dns.163.com. ( 
                                2005092001 ; serial 
                                28800 ; refresh 
                                7200 ; retry 
                                604800 ; expire 
                                86400 ; ttl 
                                ) 
@           IN  NS      dns.163.com 
@           IN  MX      10      mail.163.com. 

dns         IN  A       111.111.111.111 
www       IN   A   222.222.222.222 
xxx       IN   A   333.333.333.333 
mail       IN   CNAME   xxx 
… 

 

保存,重启BIND服务就OK了 

从DNS的配置 
从DNS的配置和主DNS配置很像,只不过不需要建立数据文件,只需要指定数据文件存放位置就可以了 
代码: 

zone "163.com" { 
        type slave; 
        file "/etc/bind/db.163.com"; 
   masters { 
       111.111.111.111; //主DNS的地址 
      }; 
}; 

zone "sohu.com" { 
        type slave; 
        file "/etc/bind/db.sohu.com"; 
   masters { 
       111.111.111.111; //主DNS的地址 
      }; 
}; 

zone "sina.com" { 
        type slave; 
        file "/etc/bind/db.sina.com"; 
   masters { 
       111.111.111.111; //主DNS的地址 
      }; 
}; 

… 

 

保存配置,重启服务。 
BIND9里的还有很多其它的功能选项,大家慢慢消化吧!

如何安装显卡的驱动程序 (NVIDIA)?

sudo apt-get install nvidia-glx
sudo apt-get install nvidia-settings
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup
sudo nvidia-glx-config enable
sudo gedit /usr/share/applications/NVIDIA-Settings.desktop

在新增的文件内加入下面这几行

[Desktop Entry]
Name=NVIDIA Settings
Comment=NVIDIA Settings
Exec=nvidia-settings
Icon=
Terminal=false
Type=Application
Categories=Application;System;

默认conf

# /etc/X11/xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
# (Type "man /etc/X11/xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following commands:
#
#   cp /etc/X11/xorg.conf /etc/X11/xorg.conf.custom
#   sudo sh -c ‘md5sum /etc/X11/xorg.conf >/var/lib/xfree86/xorg.conf.md5sum’
#   sudo dpkg-reconfigure xserver-xorg

Section "Files"
    FontPath    "unix/:7100"            # local font server
    # if the local font server has problems, we can fall back on these
    FontPath    "/usr/lib/X11/fonts/misc"
    FontPath    "/usr/lib/X11/fonts/cyrillic"
    FontPath    "/usr/lib/X11/fonts/100dpi/:unscaled"
    FontPath    "/usr/lib/X11/fonts/75dpi/:unscaled"
    FontPath    "/usr/lib/X11/fonts/Type1"
    FontPath    "/usr/lib/X11/fonts/CID"
    FontPath    "/usr/lib/X11/fonts/100dpi"
    FontPath    "/usr/lib/X11/fonts/75dpi"
        # paths to defoma fonts
    FontPath    "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
    FontPath    "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"
EndSection

Section "Module"
    Load    "bitmap"
    Load    "dbe"
    Load    "ddc"
    Load    "dri"
    Load    "extmod"
    Load    "freetype"
    Load    "glx"
    Load    "int10"
    Load    "record"
    Load    "type1"
    Load    "vbe"
EndSection

Section "InputDevice"
    Identifier    "Generic Keyboard"
    Driver        "keyboard"
    Option        "CoreKeyboard"
    Option        "XkbRules"    "xorg"
    Option        "XkbModel"    "pc104"
    Option        "XkbLayout"    "us"
EndSection

Section "InputDevice"
    Identifier    "Configured Mouse"
    Driver        "mouse"
    Option        "CorePointer"
    Option        "Device"        "/dev/input/mice"
    Option        "Protocol"        "ImPS/2"
    Option        "Emulate3Buttons"    "true"
    Option        "ZAxisMapping"        "4 5"
EndSection

Section "Device"
    Identifier    "NVIDIA Corporation NV11 [GeForce2 MX/MX 400]"
    Driver        "nv"
    BusID        "PCI:1:0:0"
EndSection

Section "Monitor"
    Identifier    "LXB-L15"
    Option        "DPMS"
    HorizSync    30-61
    VertRefresh    55-75
EndSection

Section "Screen"
    Identifier    "Default Screen"
    Device        "NVIDIA Corporation NV11 [GeForce2 MX/MX 400]"
    Monitor        "LXB-L15"
    DefaultDepth    24
    SubSection "Display"
        Depth        1
        Modes        "1024×768" "832×624" "800×600" "720×400" "640×480"
    EndSubSection
    SubSection "Display"
        Depth        4
        Modes        "1024×768" "832×624" "800×600" "720×400" "640×480"
    EndSubSection
    SubSection "Display"
        Depth        8
        Modes        "1024×768" "832×624" "800×600" "720×400" "640×480"
    EndSubSection
    SubSection "Display"
        Depth        15
        Modes        "1024×768" "832×624" "800×600" "720×400" "640×480"
    EndSubSection
    SubSection "Display"
        Depth        16
        Modes        "1024×768" "832×624" "800×600" "720×400" "640×480"
    EndSubSection
    SubSection "Display"
        Depth        24
        Modes        "1024×768" "832×624" "800×600" "720×400" "640×480"
    EndSubSection
EndSection

Section "ServerLayout"
    Identifier    "Default Layout"
    Screen        "Default Screen"
    InputDevice    "Generic Keyboard"
    InputDevice    "Configured Mouse"
EndSection

Section "DRI"
    Mode    0666
EndSection