ISP`s IT Аутсорсинг
Быстрый переход: Главная блога Главная сайта Форум
Если Вы чего то недопоняли или не нашли - задайте
вопрос на нашем форуме и мы попробуем Вам помочь.
Subnets.ru Регистрация IP и Автономных систем mega-net.ru

Архив за Май 12th, 2011

Добро пожаловать в блог! Надеемся, что Вы еще вернетесь.

Xorg и два монитора
Две видеокарты, два монитора настройка xorg.conf

Многие из нас используют или хотят использовать для работы два монитора, ибо это удобно.

Решил выложить конфиги для иксов, т.к. хочу сохранить их для истории и с вами поделиться. Да и потом будет где подсмотреть, а не заново разбираться 🙂

А то недавно махнул видюху и снова столкнулся с проблемой как заставить работать два монитора в своих иксах, да так что бы они не были дубликатами друг друга, а каждый был сам по себе.

Итак OS FreeBSD 8.2-STABLE, оболочка enlightenment-0.16.999.52995 и конфигурации X11 (xorg.conf) для работы с двумя мониторами.

Конфигов будет 3, под три разные карты, все они реализуют работу двух мониторов и все они рабочие, т.к. взяты копипастом с рабочих машин:

1. ATI Radeon: Radeon X850XT (PCIE) — двухголовая видюха:

Ставим порт с драйверами:

Port:   xf86-video-radeonhd-1.3.0_4
Path:   /usr/ports/x11-drivers/xf86-video-radeonhd
Info:   X.Org ati RadeonHD display driver

Монитор «Benq» — основной
Монитор «Samsung» — стоит справа от основного и является отдельным рабочим столом

/etc/X11/xorg.conf:

Section "ServerLayout"
 Identifier "Layout0"
 Screen 0 "Screen0" 0 0
 Screen 1 "Screen1" LeftOf "Screen0"
 InputDevice "Keyboard0" "CoreKeyboard"
 "AllowEmptyInput" "off"
 InputDevice "Mouse0" "CorePointer"
 "AllowEmptyInput" "off"
 Option "Clone" "false"
 Option "Xinerama" "true"
EndSection

Section "ServerFlags"
  Option "AutoAddDevices" "False"
EndSection

Section "Files"
    #RgbPath         "/usr/local/share/X11/rgb"
    ModulePath      "/usr/local/lib/xorg/modules"
    FontPath        "/usr/local/lib/X11/fonts/cyrillic/"
    FontPath        "/usr/local/lib/X11/fonts/misc/"
    FontPath        "/usr/local/lib/X11/fonts/TTF/"
    FontPath        "/usr/local/lib/X11/fonts/OTF"
    FontPath        "/usr/local/lib/X11/fonts/Type1/"
    FontPath        "/usr/local/lib/X11/fonts/100dpi/"
    FontPath        "/usr/local/lib/X11/fonts/75dpi/"
    FontPath        "/usr/local/lib/X11/fonts/webfonts/"
EndSection

Section "Module"
    Load           "extmod"
    Load           "record"
    Load           "dbe"
    Load           "glx"
    Load           "xtrap"
    Load           "freetype"
    Load           "type1"
EndSection

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
    Option         "XkbModel" "pc101"
    Option         "XkbLayout" "us,ru"
    Option         "XkbVariant" ",winkeys"
    Option         "XKbOptions" "grp:ctrl_shift_toggle,grp_led:scroll_lock"
EndSection

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Benq"
        ModelName    "E2200HDA"
        HorizSync    30.0 - 83.0
        VertRefresh  50.0 - 76.0
        Option "PreferredMode" "1920x1080"
EndSection

Section "Monitor"
        Identifier   "Monitor1"
        VendorName   "Samsung"
        ModelName    "SyncMaster 710N"
        HorizSync    30.0 - 81.0
        VertRefresh  56.0 - 75.0
        Option "PreferredMode" "1280x1024"
EndSection

Section "Device"
    Identifier   "Card0"
    Driver      "radeon"
    VendorName  "ATI Technologies Inc"
    BoardName   "R480 [Radeon X850XT (PCIE)] (Primary)"
    BusID       "PCI:4:0:0"
    Screen      0
    Option      "DualHead" "true"
    Option      "monitor-VGA-0" "Monitor0"
    Option      "monitor-DVI-0" "Monitor1"
EndSection

Section "Device"
    Identifier   "Card1"
    Driver      "radeon"
    VendorName  "ATI Technologies Inc"
    BoardName   "R480 [Radeon X850XT (PCIE)] (Secondary)"
    BusID       "PCI:4:0:1"
    Screen      1
    Option      "DualHead" "true"
    Option      "RightOf" "VGA-0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Card0"
    Monitor        "Monitor0"
    SubSection     "Display"
        Viewport    0 0
        Depth       1
        Modes "1920x1080" "1280x1024" "800x600" "640x480"
        Virtual 3200 3200
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       4
        Modes "1920x1080" "1280x1024" "800x600" "640x480"
        Virtual 3200 3200
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       8
        Modes "1920x1080" "1280x1024" "800x600" "640x480"
        Virtual 3200 3200
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       15
        Modes "1920x1080" "1280x1024" "800x600" "640x480"
        Virtual 3200 3200
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       16
        Modes "1920x1080" "1280x1024" "800x600" "640x480"
        Virtual 3200 3200
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       24
        Modes "1920x1080" "1280x1024" "800x600" "640x480"
        Virtual 3200 3200
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       32
        Modes "1920x1080" "1280x1024" "800x600" "640x480"
        Virtual 3200 3200
    EndSubSection
EndSection

Section "Screen"
    Identifier "Screen1"
    Device     "Card1"
    Monitor    "Monitor1"
    SubSection     "Display"
        Viewport    0 0
        Depth       1
        Modes "1280x1024" "800x600" "640x480"
        Virtual 3200 3200
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       4
        Modes "1280x1024" "800x600" "640x480"
        Virtual 3200 3200
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       8
        Modes "1280x1024" "800x600" "640x480"
        Virtual 3200 3200
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       15
        Modes "1280x1024" "800x600" "640x480"
        Virtual 3200 3200
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       16
        Modes "1280x1024" "800x600" "640x480"
        Virtual 3200 3200
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       24
        Modes "1280x1024" "800x600" "640x480"
        Virtual 3200 3200
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       32
        Modes "1280x1024" "800x600" "640x480"
        Virtual 3200 3200
    EndSubSection
EndSection

2. Zotac GT220 ZONE на чипсете NVIDIA

Ставим порт с драйверами:

Port:   nvidia-driver-256.53_1
Path:   /usr/ports/x11/nvidia-driver
Info:   NVidia graphics card binary drivers for hardware OpenGL rendering

Подгружаем:
# kldload nvidia.ko

Делаем чтобы подгружалось само после бута, правим /boot/loader.conf и добавляем:

nvidia_load="YES"

Монитор «Benq» — основной
Монитор «Samsung» — стоит справа от основного и является отдельным рабочим столом

/etc/X11/xorg.conf:


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "AllowEmptyInput" "off"
    Option "Clone" "false"
    Option "Xinerama" "false"
EndSection

Section "ServerFlags"
  Option "AutoAddDevices" "False"
EndSection

Section "Files"
    ModulePath      "/usr/X11R6/lib/xorg/modules"
    FontPath        "/usr/local/lib/X11/fonts/misc/"
    FontPath        "/usr/local/lib/X11/fonts/Type1/"
    FontPath        "/usr/local/lib/X11/fonts/100dpi/"
    FontPath        "/usr/local/lib/X11/fonts/75dpi/"
    FontPath        "/usr/local/lib/X11/fonts/cyrillic/"
    FontPath        "/usr/local/lib/X11/fonts/TTF/"
    FontPath        "/usr/X11R6/lib/X11/fonts/misc/"
    FontPath        "/usr/X11R6/lib/X11/fonts/75dpi/"
    FontPath        "/usr/X11R6/lib/X11/fonts/100dpi/"
    FontPath        "/usr/X11R6/lib/X11/fonts/bitstream-vera/"
    FontPath        "/usr/local/lib/X11/fonts/OTF"
    FontPath        "/usr/local/lib/X11/fonts/webfonts/"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "glx"
    Load           "extmod"
    Load           "record"
    Load           "dbe"
    Load           "xtrap"
    Load           "freetype"
    Load           "type1"
EndSection

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "keyboard"
    Option         "XkbModel" "pc101"
    Option         "XkbLayout" "us,ru"
    Option         "XkbVariant" ",winkeys"
    Option         "XKbOptions" "grp:ctrl_shift_toggle,grp_led:scroll_lock"
EndSection

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
    Identifier   "Monitor0"
    VendorName   "Benq"
    ModelName    "E2200HDA"
    HorizSync    30.0 - 83.0
    VertRefresh  50.0 - 76.0
    Option "PreferredMode" "1920x1080"
EndSection

Section "Monitor"
    Identifier   "Monitor1"
    VendorName   "Samsung"
    ModelName    "SyncMaster 710N"
    HorizSync    30.0 - 81.0
    VertRefresh  56.0 - 75.0
    Option "PreferredMode" "1280x1024"
EndSection

Section "Device"
    Identifier  "Card0"
    Driver      "nvidia"
    VendorName  "NVIDIA Corporation"
    BusID       "PCI:1:0:0"
    Option      "TwinView" "true"
    Option      "TwinViewOrientation"      "RightOf"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Card0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "HWcursor"
    Option         "CursorShadow"
    Option         "UseEdidDpi" "FALSE"
    Option         "DPI" "96 x 96"
    SubSection     "Display"
        Viewport    0 0
        Depth       1
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       4
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       8
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       15
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       16
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       24
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       32
    EndSubSection
EndSection

3. G86 [GeForce 8400M GS] rev 161 на чипсете NVIDIA (ноутбук SONY VAIO модель PSG-6S6P)

Ставим порт с драйверами:

Port:   nvidia-driver-256.53_1
Path:   /usr/ports/x11/nvidia-driver
Info:   NVidia graphics card binary drivers for hardware OpenGL rendering

Подгружаем:
# kldload nvidia.ko

Делаем чтобы подгружалось само после бута, правим /boot/loader.conf и добавляем:

nvidia_load="YES"

Монитор «Samsung» — основной
Ноутбук — стоит слева от основного и является отдельным рабочим столом

/etc/X11/xorg.conf:

Section "ServerLayout"
        Identifier "Layout0"
        Screen 0 "Screen0" 0 0
        InputDevice "Keyboard0" "CoreKeyboard"
        "AllowEmptyInput" "off"
        InputDevice "Mouse0" "CorePointer"
        "AllowEmptyInput" "off"
        Option "Xinerama" "true"
EndSection

Section "ServerFlags"
        Option "AutoAddDevices" "False"
EndSection

Section "Files"
    ModulePath  "/usr/local/lib/xorg/modules"
    FontPath    "/usr/local/lib/X11/fonts/cyrillic/"
    FontPath    "/usr/local/lib/X11/fonts/TTF/"
    FontPath    "/usr/local/lib/X11/fonts/OTF"
    FontPath    "/usr/local/lib/X11/fonts/misc"
    FontPath    "/usr/local/lib/X11/fonts/webfonts/"
    FontPath    "/usr/local/lib/X11/fonts/avifonts/"
    FontPath    "/usr/local/lib/X11/fonts/bitstream-vera/"
EndSection

Section "Module"
    Load           "extmod"
    Load           "record"
    Load           "dbe"
    Load           "glx"
    Load           "freetype"
    Load           "type1"
EndSection

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
        # gtf 1680 1050 60
        Identifier   "CRT-0"
        VendorName   "Samsung"
        ModelName    "SyncMaster 2243nw"
        Gamma 0 0 0
        Modeline "1680x1050_60.00"  119.00  1680 1728 1760 1840  1050 1053 1059 1080 +hsync -vsync
EndSection

Section "Monitor"
        #gtf 1280 800 60
        Identifier   "DFP-0"
        VendorName   "Sony"
        Gamma 0 0 0
        Modeline "1280x800_60.00"  83.46  1280 1344 1480 1680  800 801 804 828  -HSync +Vsync
EndSection

Section "Device"
        Option          "HWcursor"      "true"
        Identifier      "Card0"
        Driver          "nvidia"
        BusID           "PCI:1:0:0"
        Option          "TwinView" "true"
        Option          "TwinViewOrientation"      "LeftOf"
        Option          "metamodes"     "DFP-0:1280x800_60.00+0+0,CRT-0:1680x1050_60.00+1280+0"
        Option          "ConnectedMonitor" "DFP-0,CRT-0"
        Screen  0
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Card0"
    Monitor        "DFP-0"
    SubSection     "Display"
        Viewport    0 0
        Depth       1
        Modes  "1280x800" "800x600" "640x480"
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       4
        Modes   "1280x800" "800x600" "640x480"
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       8
        Modes   "1280x800" "800x600" "640x480"
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       15
        Modes   "1280x800" "800x600" "640x480"
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       16
        Modes   "1280x800" "800x600" "640x480"
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       24
        Modes   "1280x800" "800x600" "640x480"
    EndSubSection
    SubSection     "Display"
        Viewport    0 0
        Depth       32
        Modes   "1280x800" "800x600" "640x480"
    EndSubSection
EndSection

Коментарии

а) Если у вас видюха на чипсете NVIDIA, то вы можете поставить порт:

Port:   nvidia-settings-270.18
Path:   /usr/ports/x11/nvidia-settings
Info:   Display Control Panel for X NVidia driver

запустив иксы, выполните в консоли:

# nvidia-settings

что запустит графическую оболочку для настройки видео карты, где можно включить и настроить работу второго монитора.

ВНИМАНИЕ, в этой утилите есть кнопка «Save to X Configuration File», но если вы ей воспользуетесь и укажете в кач-ве файла для сохранения текущий конфиг хорга, то тулза его ОБНУЛИТ и ничего так и не сохранит. У нас три компа и на всех трех компах так, будьте аккуратны и всегда бекапте xorg.conf перед какими либо действиями над ним.

б) Откуда взять BuSID, указанный в секции Device ?

Его можно узнать посмотрев вывод команды:

# pciconf -lv

…skiped…

vgapci0@pci0:1:0:0: class=0x030000 card=0x113219da chip=0x0a2010de rev=0xa2 hdr=0x00

    vendor     = 'NVIDIA Corporation'
    class      = display
    subclass   = VGA
...skiped...

Так же его можно наблюдать в Xorg.0.log:

(--) PCI:*(0:1:0:0) 10de:0a20:19da:1132 nVidia Corporation GT216 [GeForce GT 220] rev 162, Mem @ 0xf9000000/16777216, 0xd0000000/268435456, 0xee000000/33554432, I/O @ 0x0000bf00/128, BIOS @ 0x????????/65536

в) Имена мониторов, указанные в секции Device, можно увидеть в файле лога:
/var/log/Xorg.0.log

К нему следует обратиться если у вас что то не получается и иксы не стартуют, а вываливаются с сообщением:

fatal server error:
no screens found

Файл лога поможет вам идентифицировать проблему и даст дополнительную информацию о железе.

г) Если у вас совсем ничего не получается, то попробуйте воспользоваться портом nvidia-xconfig:

Port:   nvidia-xconfig-270.18
Path:   /usr/ports/x11/nvidia-xconfig
Info:   Tool to manipulate X configuration files for the NVidia driver

Установив и запустив:

# nvidia-xconfig

На выходе вы получите xorg.conf

д) ну и конечно более подробно о том что можно указать в xorg.conf вы можете узнать из мануала:

# man xorg.conf

З.Ы. При копировании статьи ссылка на источник ОБЯЗАТЕЛЬНА ! Пожалуйста, уважайте чужой труд.

Ничего не понялТак себе...Не плохоДовольно интересноОтлично ! То что нужно ! (голосов: 2, среднее: 5,00 из 5)
Загрузка...
Отправить на почту Отправить на почту

Не так давно поставили очень удобный gsm-voip шлюз на 2 sim и 2 fxo  addpac GS1002 для работы в связке с Asterisk.

До этого работал addpac AP1100F для оцифровки входящих аналоговых линий, они работают под одной OS, так что конфиг похожий на AP1100f:

GS1002# show running-config

# навесим IP на wan:
interface FastEthernet0/0
ip address 10.100.0.248 255.255.255.0
!
! VoIP configuration.
!
!
! Voice service voip configuration.
!
voice service voip
protocol sip
dtmf-relay out-of-band
fax protocol t38 redundancy 0
fax rate 9600
h323 call start fast
h323 call tunnel enable
no call-barring unconfigured-ip-address
no voip-inbound-call-barring enable
!
!
! Voice port configuration.

# тут вешаем на какой номер отправлять входящие звонки на астериск
! GSM
voice-port 0/0
connection plar 377737708
ring number 10
ring detect-timeout 100
ring detect-timer 900
no announcement
no caller-id enable
!
!
! GSM
voice-port 0/1
connection plar 377737709
ring number 10
ring detect-timeout 100
ring detect-timer 900
no announcement
no caller-id enable
!
# fxo порты не исользуем, если надо по образцу выше
! FXO
voice-port 0/2
no caller-id enable
!
!
! FXO
voice-port 0/3
no caller-id enable
!
 # заведем dial-peer destination-pattern по кол портов:
!
dial-peer voice 0 pots
destination-pattern T
port 0/0

!
dial-peer voice 1 pots
destination-pattern T
port 0/1
!
!

# заведем sip cервер с destination-pattern
! Voip peer configuration.
!
dial-peer voice 300 voip
destination-pattern T
# IP sip серевера, куда кидаем входящие звонки

session target ip 10.100.0.1 session protocol sip voice-class codec 1 no vad dtmf-relay info fax protocol t38 redundancy 0 fax rate 9600 ! ! ! ! ! # выставим 711alaw кодек приоритетным ! Codec classes configuration. ! voice class codec 1 codec preference 1 g711alaw ! ! ! ! SIP UA configuration. ! sip-ua user-register sip-server 10.100.0.1 register e164
На аддпаке всё, если есть нюансы можно смотреть дебаг:

GS1002# debug voip call

GS1002# terminal monitor

 

На Астериске:

В  дефаулт секции в  extensions.conf укажем default контекст:

[general]
context=INBOUND

в конексте INBOUND обработаем входящие вызовы с шлюза

[INBOUND]

exten => 377737708,1,Goto(INBOUND,3777377,1)
exten => 377737709,1,Goto(INBOUND,3777377,1)

Для исходящих вызовов в конексте исходящих звонков в  extensions.conf просто кидаем вызов на IP шлюза 10.100.0.248:

exten => _XXXXXXXXXX,1,Dial(SIP/${EXTEN}@10.100.0.248,90,r)

З.Ы. При копировании статьи ссылка на источник ОБЯЗАТЕЛЬНА ! Пожалуйста, уважайте чужой труд.

Автор: stalex

Ничего не понялТак себе...Не плохоДовольно интересноОтлично ! То что нужно ! (голосов: 5, среднее: 4,40 из 5)
Загрузка...
Отправить на почту Отправить на почту

Задача

Возникла необходимость записывать действия админов и саппортов на управляемом железе сети ( более 300 единиц железа).

Например доступ по телнету к свичам и их последущая настройка.

Решение

1. Переносим бинарник телнета куда нибудь подальше:

# mv /usr/bin/telnet /usr/bin/1telnet

2. Делаем свою «обертку» над телнетом с использованием script:
# cat /usr/bin/telnet

#!/bin/sh
(id;pwd;echo $HOME ) >  /var/tmp/1/`date +\%Y\%m\%d\%H\%M\%S`-$1
script -q -a /var/tmp/1/`date +\%Y\%m\%d\%H\%M\%S`-$1 /usr/bin/1telnet $1

 

и вуаля, в /var/tmp/1/ cкладируются действия над свичами со стороны операторов,

также имеем некоторого рода бакап конфигов, тк sh run обычно оператор делает, соответсвенно он тоже фиксируется

З.Ы. При копировании статьи ссылка на источник ОБЯЗАТЕЛЬНА ! Пожалуйста, уважайте чужой труд.

Автор: stalex

 

Ничего не понялТак себе...Не плохоДовольно интересноОтлично ! То что нужно ! (голосов: 2, среднее: 5,00 из 5)
Загрузка...
Отправить на почту Отправить на почту