Table des matières
0 billet(s) pour février 2026
/dev/one
Générer 11111111 soit 0xFF
tr '\000' '\377' < /dev/zero
dd if=<(tr '\000' '\377' < /dev/zero) count=1 bs=512 of=data_ones.bin
Désactiver le son au démarrage d un mac
Source : http://korben.info/comment-desactiver-le-son-au-demarrage-dun-mac.html
Ne semble pas marcher sous Yosemite. Il est aussi possible de couper le son avant d’éteindre l'ordinateur
sudo nvram SystemAudioVolume=%80
Pour réactiver
sudo nvram -d SystemAudioVolume
Désactiver le reboot via ctrl-alt-del - Disable reboot using ctrl-alt-del keys
Disable reboot using Ctrl-Alt-Del Keys in RHEL / CentOS
Source : https://www.linuxtechi.com/disable-reboot-using-ctrl-alt-del-keys/
In Linux , It’s a security concern for us to allow anyone to reboot the server using Ctrl-Alt-Del keys. It is always recommended in production boxes that one should disable reboot using Ctrl-Alt-Del keys.
In this article we will discuss how can we disable reboot via above keys in RHEL & CentOS
For RHEL 5.X & CentOS 5.X
To prevent the init process from handling Ctrl-Alt-Del, edit the file /etc/inittab :
/etc/inittab
# Trap CTRL-ALT-DELETE #ca::ctrlaltdel:/sbin/shutdown -t3 -r now
We can also modify the line to generate logs, if anybody try to reboot the server using the keys ,
/etc/inittab
# Trap CTRL-ALT-DELETE ca::ctrlaltdel:/bin/logger -p authpriv.warning -t init "Console-invoked Ctrl-Alt-Del was ignored"
For RHEL6.X & CentOS 6.X
In RHEL 6.X / CentOS 6.X , reboot using the keys are handled by the file /etc/init/control-alt-delete.conf.
Step:1 Before making the changes, first take the backup using below command
cp -p /etc/init/control-alt-delete.conf{,.orig}
Step:2 Edit the file, replacing the exec /sbin/shutdown line with the following, which will simply generate a log entry each time Ctrl-Alt-Del is pressed:
/etc/init/control-alt-delete.conf
exec /usr/bin/logger -p authpriv.notice -t init "Ctrl-Alt-Del was pressed and ignored"
For RHEL 7.x & CentOS 7.x
Run either of the beneath command from the console to disable reboot using ‘CTRL+ALT+DELETE’ keys in RHEL 7.x and CentOS 7.x
ln -sf /dev/null /etc/systemd/system/ctrl-alt-del.target
OR
systemctl mask ctrl-alt-del.target
reboot.target https://www.2daygeek.com/how-to-avoid-or-prevent-accidental-shutdown-or-reboot-on-linux/
# systemctl mask reboot.target Created symlink /etc/systemd/system/reboot.target → /dev/null. # systemctl mask poweroff.target Created symlink /etc/systemd/system/poweroff.target → /dev/null. # systemctl mask halt.target Created symlink /etc/systemd/system/halt.target → /dev/null.
Désactiver l'arret du système en appuyant sur le bouton marche/arrêt
disable shutdown by press the power button - Prevent PC from shutting down on Power button
SystemD
/etc/systemd/logind.conf
[Login] #HandlePowerKey=poweroff #HandlePowerKey=idle HandlePowerKey=lock #PowerKeyIgnoreInhibited=no PowerKeyIgnoreInhibited=yes #HandleLidSwitch=suspend HandleLidSwitch=ignore
systemctl restart systemd-logind.service systemctl show systemd-logind.service
ACPI
/etc/acpi/powerbtn-acpi-support.sh
Dépôt Debian APT repository
Voir :
Voir aussi :
- aptly
wget -c http://www.gostcrypt.org/download/1.0/linux/Gostcrypt_1.0.deb mv Gostcrypt_1.0.deb gostcrypt.deb wget -c http://ftp.fr.debian.org/debian/pool/main/w/wxwidgets2.8/libwxgtk2.8-dev_2.8.12.1-12_amd64.deb wget -c https://github.com/adobe/brackets/releases/download/release-1.5/Brackets.Release.1.5.64-bit.deb wget -c ftp://ftp.mondorescue.org/debian/8/mondo_3.2.1-1_amd64.deb wget -c http://ftp.fr.debian.org/debian/pool/non-free/a/afio/afio_2.5.1.20130626+gite266635-1_amd64.deb wget -c http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-linux-nonfree_0.44~bpo8+1_all.deb wget -c http://ftp.fr.debian.org/debian/pool/main/p/pdfedit/pdfedit_0.4.5-1_amd64.deb
Modification d'un paquet .deb
wget -c http://www.gostcrypt.org/download/1.0/linux/Gostcrypt_1.0.deb rm tmp* -rf mkdir tmp cd tmp/ ar x ../Gostcrypt_1.0.deb ls -l mkdir DEBIAN cd DEBIAN/ tar xzvf ../control.tar.gz ls rm ../control.tar.gz vim control cd .. ls cd .. mv Gostcrypt_1.0.deb .. dpkg-deb --build tmp/
Comment créer un dépôt de paquets
Réf :
apt-get install reprepro
mkdir apt cd apt mkdir conf mkdir incoming
conf/distributions
Origin: Acme
Label: Acme
Suite: stable
Codename: jessie
Version: 8.2
Architectures: amd64
Components: main
Description: Global Private Acme Repository
Placer les fichiers .deb dans le dossier incoming
reprepro -Vb . includedeb (distribution) incoming/(nom_du_paquet)
Exemple :
reprepro -Vb . includedeb jessie incoming/atop
/etc/nginx/sites-available/repo
server { listen 80 ; server_name apt.acme.fr ; root /var/www/apt ; autoindex on; charset utf-8; }
Faire un Dépôt partiel (partial Debian mirror) qui contiendra l'ensemble des paquets nécessaires
Add Packages in local Debian repository
Exemple
Pour que GPG ne nous demande pas mille fois la paraphrase
eval $(gpg-agent --daemon)
Et
apt-get install paquet cd /var/www/apt/incoming/ for paq in $(dpkg -l | grep ^ii | awk '{print $2}') ; do apt-get download $paq ; done cd .. for deb in incoming/*.deb ; do reprepro -Vb . includedeb jessie $deb ; done
add_packages.sh
#! /bin/bash set -o nounset WD=$(dirname $(realpath $0)) pushd . > /dev/null cd /var/www/apt/incoming/ for paq in $(cat $WD/packages_list.txt) $(dpkg -l | grep ^ii |awk '{print $2}'|egrep -v "$(cat $WD/packages_list_ignored.txt |tr "\n" "|" | sed -e 's/|$//')" ) do apt-get download $paq # > /dev/null done cd /var/www/apt/ for deb in incoming/*.deb do reprepro -Vb . includedeb jessie $deb # >/dev/null done popd > /dev/nul
Créer un paquet Debian
Signer les paquets
Sur le serveur repo
1) Générer une clef
Export de la clef publique
gpg --list-key gpg --export -a 0x3E4DC2000A8903CF > /var/www/apt/conf/0x3E4DC2000A8903CF.asc
conf/distributions
SignWith: 0x3E4DC2000A8903CF
reprepro --ask-passphrase export
Sur un client
wget http://repo.local/conf/0x3E4DC2000A8903CF.asc apt-key add 0x3E4DC2000A8903CF.asc #curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3E4DC2000A8903CF" | sudo apt-key add
