Outils pour utilisateurs

Outils du site


blog

EFI Notes partitions EFI GPT vs MBR

EFI/GPT

Source : http://www.ibm.com/support/knowledgecenter/SS42VS_7.2.6/com.ibm.qradar.doc/t_offboard_iscsi_configure_volume.html

Optional: To create a partition, use the GNU parted command :

parted /dev/volume
mklabel gpt
Warning: The existing disk label on /dev/volume will be
destroyed and all data on this disk will be lost. Do you want to
continue?
mkpart primary 0% 100%
unit TB
print
print free
quit
partprobe /dev/volume

Ou addpart / delpart ?

cat /proc/partitions

To create an XFS file system, type the following command :

mkfs.xfs -f /dev/partition

For an ext4 files system, type the following command :

mkfs.ext4 /dev/partition
#parted /dev/sdb mklabel gpt mkpart P1 0% 100%
parted /dev/sdb mklabel gpt mkpart primary ext4 0% 100%
parted /dev/sdb unit s print > sdb-pt.parted
parted -ms /dev/sdb print > sdb-pt.parted2
sdb.parted2
BYT;
/dev/sdb:322GB:scsi:512:512:gpt:EQLOGIC 100E-00:;
1:1049kB:322GB:322GB:ext4:primaire:;
Exemple
parted /dev/sdb mklabel msdos mkpart p xfs 0% 100%
2025/03/24 15:06

Éditer un PDF grâce à LibreOffice Draw

Créer un fichier PDF hybride éditable

PDFimport

Manipuler des fichiers PDF avec Libre-office Draw

Sous Debian installez le paquet “libreoffice-pdfimport”

http://extensions.services.openoffice.org/project/pdfimport

Génération de PDF

libreoffice --headless --convert-to pdf --outdir plop.pdf plop.odt 2>&1
2025/03/24 15:06

E2guardian - dansguardian - Filtrer le web de site porno - Contrôle parentale

Voir :

Liste blanche

cat >> /etc/e2guardian/lists/exceptionsitelist <<EOF
e2guardian.org
www.e2guardian.org
EOF
 
systemctl restart e2guardian
2025/03/24 15:06

Dynamic hostname based on ip address - dhcp hook

- name: set dynamic hostname based on ip address - use dhcp hook
  copy: src=hostname dest=/etc/dhcp/dhclient-exit-hooks.d/hostname owner=root group=root
  when: ansible_os_family == 'Debian'

- name: set dynamic hostname based on ip address - use dhcp hook
  copy: src=hostname dest=/etc/dhcp/dhclient.d/hostname.sh owner=root group=root mode="0755"
  when: ansible_os_family == 'RedHat'
 
# Raspberry
#- name: set dynamic hostname based on ip address - use dhcp hook
#  copy: src=hostname dest=/lib/dhcpcd/dhcpcd-hooks/30-hostname owner=root group=root

hostname

#!/bin/bash
 
set_hostname() {
        local new_hostname
        local strip_simple_hostname=$(hostname -s |sed -e 's/-.*$//')
        new_hostname="$strip_simple_hostname-$(hostname -I |awk '{print $1}' |tr . -)"
        hostname "$new_hostname"
        sed -i -e "s/^127.0.1.1\\t.*/127.0.1.1\\t$new_hostname/" /etc/hosts
        # Delete duplicate lines
        perl -i -ne 'print unless $a{$_}++' /etc/hosts
}
 
if $if_up; then
        set_hostname
fi
2025/03/24 15:06

Notes Dynamic DNS DDNS avec DHCP

Hack DHCP ne veux pas faire du DDNS sous RedHat 8

/etc/dhcp/dhclient-exit-hooks.d/update-dns.sh

#! /bin/bash
 
NAME_FQDN="$(hostname -s).acme.local"
IP=$(hostname -I |tr " " "\n" |egrep "192\.168\.1\.")
#IP=$(ip a | grep wlan0 | grep "inet " | awk '{print $2}' | cut -d '/' -f 1)
 
if [ ! -z "$IP" ]
then
nsupdate -k /root/rndc.key <<EOF
update del ${NAME_FQDN} A
update add ${NAME_FQDN} 86400 A ${IP}
send
EOF
fi
chmod +x /etc/dhcp/dhclient-exit-hooks.d/update-dns.sh
Ce hack n'est pas nécessaire

Il faut avoir le paquet isc-dhcp-client d'installé avec la configuration :

/etc/dhcp/dhclient.conf

send host-name = gethostname();

Exemple nsupdate

nsupdate -k /etc/rndc.key <<EOF
update del plop.acme.local A
update add plop.acme.local 86400 A 192.168.1.4
show
send
EOF

Autres

Voir :

Vérif syntax

dhcpd -t -cf /etc/dhcp/dhcpd.conf

Rafraichir la conf

> /var/lib/dhcpd/dhcpd.leases
systemctl restart dhcpd
2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki