Архив метки: заметки

Подключение к сессии FreeBSD через watch

Иногда соединение с сервером может внезапно разоваться, а у нас выполнялась какая-то опреация… тогда на помощь придет watch!

Чтобы просмотреть активные сессии введем:

# w7:54AM up 4:43, 2 users, load averages: 0.07, 0.22, 0.21USER TTY FROM LOGIN@ IDLE WHATuser1 pts/0 192.168.1.3 7:54AM — wuser2 pts/2 192.168.1.6 7:45AM 5 /usr/local/bin/dialog4ports

И теперь пишем

# watch -W pts/2

И мы видим нашу отвалившуюся сессию. Параметр W дает право записи в сессию. Для выхода из watch нажать Ctrl+G.

conky => 1.10 / Синтаксис конфигурационного файла

Новый синтаксис конфигурационного файла, пример…

$ nano .conkyrc

***

 conky.config = {
    own_window = true,
    own_window_transparent = true,
    own_window_type =  'desktop',
    background = true,
    use_xft = true,
    xftalpha = 0.5,
    update_interval = 1.0,
    total_run_times = 0,
    double_buffer = true,
    draw_shades = true,
    draw_outline = true,
    draw_borders = false,
    draw_graph_borders = true,
    minimum_size  = 200,
    minimum_height = 690,
    maximum_width = 300,
    border_width = 0,
    default_color = 'white',
    default_shade_color = 'black',
    default_outline_color ='black',
    font = 'DejaVu Sans Mono_size=9',
    alignment =  'top_right',
    gap_x = 10,
    gap_y = 85,
    no_buffers = true,
    cpu_avg_samples = 2,
    override_utf8_locale = true,
    use_spacer =  'right'
}

conky.text = [[
${font Sans_size=9:weight=bold}${color #296dac}Информация о системе ${hr 2}
${color #4ea5cd}Хост:$color ${alignr}$nodename
${color #4ea5cd}Ядро:$color ${alignr}$kernel ($machine)
${color #4ea5cd}Работает:$color ${alignr}$uptime
${font Sans_size=9:weight=bold}${color #D2F6FF}»Crimea-Karro» conkyRC v3.1.4 ${hr 2}

]] 

***

Полный вариант конфигурационного файла .conkyrc, плюс старый вариант конфигурационного файла .conkyrc:

http://crimea-karro.ru/download/conkyrc.tar.bz2

Автор: AugustuS Karro
Дата публикации: 2015-09-25T15:08:00.000+07:00

Узнать внешний IP,HOST адрес из консоли / ip.crimea-karro.ru

Создан технический поддомен, цель, проверка IP адреса и имени хоста из консоли.

***

Вариант — 1: curl ip.crimea-karro.ru
Вариант — 2: curl -4 ip.crimea-karro.ru
Вариант — 3: wget -O — -q ip.crimea-karro.ru

Дополнительно, вывод функции dns_get_record.

Автор: AugustuS Karro
Дата публикации: 2015-06-28T03:44:00.000+07:00

openSUSE 13.2 / Два монитора / NVIDIA

Основная задача сделать второй монитор с независимым Рабочим Столом.
***

Тестовая машина…

— Intel® Core™ i5 3.00 — 2320 x4
— Overclock CPU to 3.6 ghz
— DDR3 (1600) — 16GB (Dual).
— openSUSE 13.2 x-86_64.
— Kernel 3.16
— Nvidia GTX-650 ddr5 1024 mb / 128 bit.
— Drivers 352.21
— Display resolution 1360×768 (VGA).
— Display resolution 1920×1080 (HDMI).
***
Анализ мониторов…
$ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected primary 1920×1080+0+0 (normal left inverted right x axis y axis) 160mm x 90mm
   1920×1080     60.00*+  59.94    50.00    29.97    25.00    23.97    60.05    60.00    50.04
   1360×768      60.02
   1280×1024     60.02
   1280×720      60.00    59.94    50.00
   1152×864      60.00
   1024×768      60.00
   800×600       60.32
   720×576       50.00    50.08
   720×480       59.94
   640×480       59.95    59.94    59.93
***
Для единого Рабочего Стола, можем выполнить например…
$ xrandr —auto —output HDMI-0 —mode 1920×1080 —right-of DVI-D-0
Или…
В nvidia-settings указать все мониторы как Screen0, тогда TwinView получит единый рабочий стол.
***
Рабочий X configuration file:
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 352.21  (buildmeister@swio-display-x64-rhel04-13)  Tue Jun  9 22:42:41 PDT 2015
Section «ServerLayout»
# Removed Option «Xinerama» «0»
# Removed Option «Xinerama» «1»
    Identifier     «Layout0»
    Screen      0  «Screen0» 0 0
    Screen      1  «Screen1» 1920 0
    InputDevice    «Keyboard0» «CoreKeyboard»
    InputDevice    «Mouse0» «CorePointer»
    Option         «Xinerama» «0»
EndSection
Section «Files»
EndSection
Section «InputDevice»
    # generated from data in «/etc/sysconfig/mouse»
    Identifier     «Mouse0»
    Driver         «mouse»
    Option         «CorePointer»
    Option         «Protocol» «ExplorerPS/2»
    Option         «Device» «/dev/input/mice»
    Option         «Buttons» «7»
    Option         «ZAxisMapping» «4 5»
    Option         «Resolution» «3200»
EndSection
Section «InputDevice»
    # generated from default
    Identifier     «Keyboard0»
    Driver         «kbd»
EndSection
Section «Monitor»
    Identifier     «Monitor0»
    VendorName     «Unknown»
    ModelName      «LG Electronics LG TV»
    HorizSync       30.0 — 83.0
    VertRefresh     58.0 — 62.0
    Option         «DPMS»
    Option         «DPI» «96 x 96»
EndSection
Section «Monitor»
    Identifier     «Monitor1»
    VendorName     «Unknown»
    ModelName      «Samsung SyncMaster»
    HorizSync       30.0 — 61.0
    VertRefresh     56.0 — 75.0
EndSection
Section «Device»
    Identifier     «Device0»
    Driver         «nvidia»
    VendorName     «NVIDIA Corporation»
    BoardName      «GeForce GTX 650»
    Option         «NoLogo» «true»
    Option         «TwinView» «True»
    Option         «TwinViewOrientation» «TV Clone DFP-1»
#Option         «ConnectedMonitor» «DFP-1, TV»
    Option         «UseDisplayDevice» «DFP-1, TV»
    BusID          «PCI:1:0:0»
    Screen          0
EndSection
Section «Device»
    Identifier     «Device1»
    Driver         «nvidia»
    VendorName     «NVIDIA Corporation»
    BoardName      «GeForce GTX 650»
    BusID          «PCI:1:0:0»
    Screen          1
EndSection
Section «Screen»
# Removed Option «metamodes» «nvidia-auto-select +0+0»
# Removed Option «metamodes» «VGA-0: nvidia-auto-select +1920+0, HDMI-0: nvidia-auto-select +0+0»
    Identifier     «Screen0»
    Device         «Device0»
    Monitor        «Monitor0»
    DefaultDepth    24
    Option         «Stereo» «0»
    Option         «nvidiaXineramaInfoOrder» «DFP-1»
    Option         «metamodes» «HDMI-0: nvidia-auto-select +0+0»
    Option         «SLI» «Off»
    Option         «MultiGPU» «Off»
    Option         «BaseMosaic» «off»
    SubSection     «Display»
        Depth       24
    EndSubSection
EndSection
Section «Screen»
    Identifier     «Screen1»
    Device         «Device1»
    Monitor        «Monitor1»
    DefaultDepth    24
    Option         «Stereo» «0»
    Option         «nvidiaXineramaInfoOrder» «CRT-0»
    Option         «metamodes» «VGA-0: nvidia-auto-select +0+0»
    Option         «SLI» «Off»
    Option         «MultiGPU» «Off»
    Option         «BaseMosaic» «off»
    SubSection     «Display»
        Depth       24
    EndSubSection
EndSection
Section «Extensions»
    Option         «Composite» «Disable»
    #Option         «RENDER» «Enable»
EndSection
***
Как видим Samsung SyncMaster, имеет отдельную конфигурацию как Screen1, с личным рабочим столом.

Автор: AugustuS Karro
Дата публикации: 2015-06-26T18:00:00.000+07:00

TCP timestamp response off / GNU-Linux

The remote host responded with a TCP timestamp. The TCP timestamp response can be used to approximate the remote host’s uptime, potentially aiding in further attacks. Additionally, some operating systems can be fingerprinted based on the behavior of their TCP timestamps.

***

Отключение… Читать

Tor-browser от пользователя root / GNU-Linux

Tor-browser

Устанавливаем Tor — browser с сайта torproject.org

Чтобы Tor запускался от пользователя root находим секцию в файле start-tor-browser и закомментируем ее:

root@host:~/Desktop# nano ./tor-browser_en-US/Browser/start-tor-browser

#if [ "`id -u`" -eq 0 ]; then
#       complain "The Tor Browser Bundle should not be run as root.  Exiting."
#       exit 1
#fi

Автор: AugustuS Karro
Дата публикации: 2015-06-26T17:37:00.000+07:00