Архив рубрики: Linux

Создание RPM пакета для Fedora

Иногда встречаются полезные программы, доступные только в виде исходных кодов (и/или в виде установочных пакетов для других ОС), но есть необходимость их установки на несколько компьютеров. Чтобы не выполнять компиляцию на каждом компьютере отдельно, можно на одном подготовить установочный пакет и установить его штатными средствами на других компьютерах.
Ниже приведён пример создания RPM пакета для Fedora 21 (для других версий Fedora процедура не отличается) из исходных текстов очень приятной и полезной программы Boomaga версии 0.7.0.
Читать

Узнать внешний 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.

***
    
Отключение…

Ставим время в UTC

root@host:~# ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
root@host:~# echo UTC0 > /etc/localtime

Отключаем Tcp timestamps

root@host:~# echo “net.ipv4.tcp_timestamps = 0” > /etc/sysctl.d/tcp_timestamps.conf

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

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

conky / 2-ва монитора conkyRC

Изначально можно расположить виджет слева…

alignment top_left

И расположить его по вашему усмотрению.

***

Проще оставить…

alignment top_right

По умолчанию gap_x равен 20, от правого края экрана.
Использую два монитора, gap_x будет равен примерно 1400, отступ от правого края.

Переход на следующий монитор фиксирован.

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