Outils pour utilisateurs

Outils du site


blog

Notes parallel multithread multicore process shell

Commande xargs

Autres

$ ps -p 5369 -L -o pid,tid,psr,pcpu
  PID   TID PSR %CPU
 5369  5369   0  0.1
 5369  5371   1  0.0
 5369  5372   2  0.0
 5369  5373   3  0.0
 5369  5374   4  0.0
 5369  5375   5  0.0
 5369  5376   6  0.0
 5369  5377   7  0.0
taskset 0xffff R --slave -f parglm.R
taskset 0xffff R
2025/03/24 15:06

Notes paquets makeself

/home/siber/goodsync/packages/generic-sfx/megastep-makeself-be1c982/makeself.sh \
    "--nomd5" \
    "--nocrc" \
    "/home/siber/goodsync/packages/generic-sfx/package-files" \
    "goodsync-linux-x86_64-release.run" \
    "GoodServer for Unix/Linux version 10.5.9.9" \
    "./install-script.sh"

Script run after extraction:

   ./install-script.sh
2025/03/24 15:06

Notes paquets Debian deb

Paquets

Voir :

apt-get install debconf-utils
#debconf-get-selections
debconf-get-selections  |grep -B1 '^postfix'
#debconf-get-selections | ssh nouvelhôte debconf-set-selections

EXEMPLES

# Forcer la priorité de debconf à critique (« critical »).
debconf debconf/priority select critical

# Remplacer l'interface par défaut par readline, 
# mais autoriser l'utilisateur à choisir.
debconf debconf/frontend select readline
debconf debconf/frontend seen false

Notes fstab

/etc/fstab
/var/tmp /tmp    none bind 0 0

Déploiement

Fichier de réponse paquet Debian

sudo debconf-get-selections
 
export DEBIAN_FRONTEND="noninteractive"
 
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password rootpw"
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password rootpw"
 
sudo apt-get install -y mysql-server-5.6

Paquets obsolètes Après un dist-upgrade certains paquets ne sont plus maintenu

Pour les lister

aptitude search '~o'

Pour les supprimer

aptitude purge '~o'
2025/03/24 15:06

Boot systemd boot non-graphique

Source : Non-graphical boot with systemd

Voir aussi https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-Managing_Services_with_systemd-Targets.html

Testé sur Debian 8 Jessie

Open a terminal and (as root) run:

systemctl set-default multi-user.target

ou avec --force

systemctl set-default -f multi-user.target

Retour arrière - réactivation mode graphique

systemctl set-default graphical.target

Vérif

systemctl get-default

Boot paramètre noyaux Linux

parameter to your kernel boot line

systemd.unit=multi-user.target
Ajout nouvelle entrée au grub sous Debian

Sous Debian

vimdiff /boot/grub/grub.cfg /boot/grub/custom.cfg
/boot/grub/custom.cfg
menuentry 'Debian GNU/Linux nographic' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-816ff92d-1a71-4f82-b009-a5ef6f469a25' {
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  82c94e9f-f7c8-40dc-9e94-9d0afcac7fe6
        else
          search --no-floppy --fs-uuid --set=root 82c94e9f-f7c8-40dc-9e94-9d0afcac7fe6
        fi
        echo    'Loading Linux 3.16.0-4-amd64 ...'
        linux   /vmlinuz-3.16.0-4-amd64 root=/dev/mapper/vgos-root ro systemd.unit=multi-user.target
        echo    'Loading initial ramdisk ...'
        initrd  /initrd.img-3.16.0-4-amd64
}
cat /boot/grub/grub.cfg |sed -ne '/^menuentry/,/}/p' |sed -e 's/\(linux.*\) quiet/\1 systemd.unit=multi-user.target/' |sed -e 's%Debian GNU/Linux%Debian GNU/Linux NonGraphique%' > /boot/grub/custom.cfg

Changer le runlevel / target maintenant

# runlevel
systemctl list-units --type target
# telinit 3
# init 3
systemctl isolate multi-user.target
 
# init 5
systemctl isolate graphical.target

Autres

#unlink /etc/systemd/system/default.target
#ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
systemctl set-default multi-user.target  
2025/03/24 15:06

Notes paquet RPM Redhat CentOS

Voir aussi yum createrepo

Création et modification

Voir :

yum install rpmdevtools
 
mkdir -p rpmbuild/{BUILDROOT,SPECS}
 
cd rpmbuild/SPECS/
rpmdev-newspec plop

Récupérer les fichiers

rpm2cpio ../plop-1.8.8-2.noarch.rpm | cpio -idmv
For Reference: the cpio arguments are :
-i = extract
-d = make directories
-m = preserve modification time
-v = verbose

Récup script post-install

rpm -qp --scripts plop-1.8.8-2.noarch.rpm

Éditer un paquet RPM en modifiant le SPEC

sudo yum install rpmrebuild
rpmrebuild -e -p plop-1.8.8-2.noarch.rpm

Générer un SPEC d'un RPM existant

rpmrebuild -s plop.spec  -p ../plop-1.8.8-2.noarch.rpm

Créer un RPM

cd ~/rpmbuild
rpmbuild --target=noarch -bb --sign SPECS/plop.spec
cd RPMS/noarch

Exemple de fichier .spec avec PHP (pas de compilation)

plop.spec
%define name superrpm
%define version 1.5.6
%define release 2

Summary: Application super RPM
Name: %{name}
Version: %{version}
Release: %{release}
Vendor: Acme
URL: http://www.acme.fr/
License: GPL3
Group: Web application
Prefix: %{_prefix}
Requires: php >= 5.2.4, mysql-server, php-pdo, httpd, php-soap, php-mbstring, php-mysql, php-xml, dmraid >= 1.0.0.rc13-53,php-gd
BuildArch: noarch

%description
Super paquet RPM

%post
chmod -R 777 /var/www/Superrpm/
chown root:root /etc/httpd/conf.d/superrpm.conf

service httpd reload


%files
#%defattr(755,root,root,644)
%defattr(-,-,-)
#/*
/etc/cron.daily/update-plop
/etc/cron.hourly/tache_plop.sh
/etc/httpd/conf.d/plop.conf
/etc/yum.repos.d/plop.repo
/etc/php-fpm.d/plop.conf
/etc/my.cnf.d/plop.cnf
/var/www/plop/


%changelog
* Mon Apr 25 2016 Equipe dev Acme <dev@null.fr>
- Plop : bugfixed
* Mon May 4 2009 Equipe dev Acme <dev@null.fr>
- Première paquet RPM

Notes attr

1. The default permissions, or "mode" for files.
2. The default user id.
3. The default group id.
4. The default permissions, or "mode" for directories.
Autres
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
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