Archives pour la catégorie ‘Système’

Debian : fix crash Netbeans 8

# vim /etc/java-8-openjdk/accessibility.properties
#assistive_technologies=org.GNOME.Accessibility.AtkWrapper

Linux : afficher la consommation swap par processus

# for file in /proc/*/status ; do awk '/^(VmSwap|Pid|Name)/{printf $2 " " $3}END{ print ""}' $file; done | sort

Linux : tester les performances I/O

# hdparm -t -T /dev/sda
# dd bs=1M count=512 if=/dev/zero of=test conv=fdatasync
# bonnie++ -d /mnt -r 8000 -u toto

Debian : migrer son système sous systemd

# apt-get update
# apt-get install systemd systemd-sysv
# reboot
# ls -al /sbin/init 
lrwxrwxrwx 1 root root 20 Apr 23 01:46 /sbin/init -> /lib/systemd/systemd
# apt-get --purge remove sysvinit

Pour activer les logs persistants de journald :

# mkdir /var/log/journal
# chgrp systemd-journal /var/log/journal
# chmod g+rwx /var/log/journal

Fleet : déploiement d’un service global avec une template

# vim zabbix@.service
[Unit]
Description=zabbix %i
Requires=docker.service
After=docker.service

[Service]
ExecStartPre=-/usr/bin/docker kill zabbix%i
ExecStartPre=-/usr/bin/docker rm zabbix%i
ExecStartPre=/usr/bin/docker pull bhuisgen/docker-zabbix-coreos
ExecStart=/usr/bin/docker run --name zabbix%i -p 1050%i:10050 -v /var/run/docker.sock:/coreos/var/run/docker.sock -v /proc:/coreos/proc:ro -v /sys:/coreos/sys:ro -v /dev:/coreos/dev:ro -v /dev/log:/dev/log --restart=always bhuisgen/docker-zabbix-coreos zabbix%i.my.domain 80.81.82.83
ExecStop=/usr/bin/docker stop zabbix%i
TimeoutStartSec=900

[X-Fleet]
Global=true
# export FLEETCTL_TUNNEL="cluster.my.domain"
# fleetctl submit zabbix@.service
# fleetctl load zabbix@.service
# fleetctl start zabbix@{0..4}

Unbound : mise en place d’un fake DNS

La mise en place d’une cache DNS peut être nécessaire pour bypasser le résultat de requêtes DNS.

# apt-get install unbound
# vim /etc/resolv.conf
# cat /etc/unbound/unbound.conf
 
server:
    local-zone: "my.domain." static
    local-data: "fake.my.domain. IN A 10.20.2.22"
    local-data-ptr: "10.20.2.22 fake.my.domain"

X.org : configuration multi-écrans avec le driver nouveau

# lspci -nn|grep VGA
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation G86 [Quadro NVS 290] [10de:042f] (rev a1)
02:00.0 VGA compatible controller [0300]: NVIDIA Corporation G86 [Quadro NVS 290] [10de:042f] (rev a1)
# ls -l /sys/class/drm/
total 0
lrwxrwxrwx 1 root root    0 Mar 11 09:57 card0 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0
lrwxrwxrwx 1 root root    0 Mar 11 09:57 card0-DVI-I-1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0/card0-DVI-I-1
lrwxrwxrwx 1 root root    0 Mar 11 09:57 card0-DVI-I-2 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0/card0-DVI-I-2
lrwxrwxrwx 1 root root    0 Mar 11 09:57 card1 -> ../../devices/pci0000:00/0000:00:1c.0/0000:02:00.0/drm/card1
lrwxrwxrwx 1 root root    0 Mar 11 09:57 card1-DVI-I-3 -> ../../devices/pci0000:00/0000:00:1c.0/0000:02:00.0/drm/card1/card1-DVI-I-3
lrwxrwxrwx 1 root root    0 Mar 11 09:57 card1-DVI-I-4 -> ../../devices/pci0000:00/0000:00:1c.0/0000:02:00.0/drm/card1/card1-DVI-I-4
lrwxrwxrwx 1 root root    0 Mar 11 09:57 controlD64 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/controlD64
lrwxrwxrwx 1 root root    0 Mar 11 09:57 controlD65 -> ../../devices/pci0000:00/0000:00:1c.0/0000:02:00.0/drm/controlD65
lrwxrwxrwx 1 root root    0 Mar 11 09:57 ttm -> ../../devices/virtual/drm/ttm
-r--r--r-- 1 root root 4096 Mar 11 09:57 version
# vim /etc/X11/xorg.conf
Section "ServerLayout"
    Identifier  "Layout0"
    Option      "Xinerama" "on"
    Option      "Clone" "off"
    Screen   0  "Screen0"
    Screen   1  "Screen1" RightOf "Screen0"
    Screen   2  "Screen2" Below "Screen0"
    Screen   3  "Screen3" RightOf "Screen2"
EndSection

Section "Device"
    Identifier  "Device0"
    Driver      "nouveau"
    BusID       "PCI:1:0:0"
    Option      "ZaphodHeads" "DVI-I-1"
    Screen      0
EndSection

Section "Device"
    Identifier  "Device1"
    Driver      "nouveau"
    BusID       "PCI:1:0:0"
    Option      "ZaphodHeads" "DVI-I-2"
    Screen      1
EndSection

Section "Device"
    Identifier  "Device2"
    Driver      "nouveau"
    BusID       "PCI:2:0:0"
    Option      "ZaphodHeads" "DVI-I-3"
    Screen      0 
EndSection

Section "Device"
    Identifier  "Device3"
    Driver      "nouveau"
    BusID       "PCI:2:0:0"
    Option      "ZaphodHeads" "DVI-I-4"
    Screen      1
EndSection

Section "Screen"
    Identifier  "Screen0"
    Device      "Device0"
EndSection

Section "Screen"
    Identifier  "Screen1"
    Device      "Device1"
EndSection

Section "Screen"
    Identifier  "Screen2"
    Device      "Device2"
EndSection

Section "Screen"
    Identifier  "Screen3"
    Device      "Device3"
EndSection

Linux : détecter si un disque est SSD ou mécanique

Cas d’un SSD

# cat /sys/block/sda/queue/rotational
0

Cas d’un disque mécanique

# cat /sys/block/sdb/queue/rotational
1

CoreOS : fix crash du network stack sous Xen 4.2

Dec 16 11:30:08 ip-172-10-4-2.ap-southeast-1.compute.internal kernel: xen_netfront: xennet: skb rides the rocket: 19 slots, 65226 bytes
# ethtool -K eth0 sg off

Amazon EC2 : fix de configuration Xen avec instance HVM

# dmsg
[335773.344080] xen:balloon: Cannot add additional memory (-17)
[335805.413385] xen:balloon: Cannot add additional memory (-17)
[335837.536078] xen:balloon: Cannot add additional memory (-17)
 
# cat /sys/devices/system/xen_memory/xen_memory0/info/current_kb > /sys/devices/system/xen_memory/xen_memory0/target_kb
Haut de page