Table des matières
- 2026:
- 2025:
4 billet(s) pour septembre 2026
| Notes HTTP Strict Transport Security - HSTS | 2026/09/18 11:04 | Jean-Baptiste |
| Notes GNU Linux GPU carte graphiques | 2026/09/08 15:49 | Jean-Baptiste |
| Notes GNU Linux graphique | 2026/09/08 15:42 | Jean-Baptiste |
| Notes urlencoding - passer des mots de passe en HTTPS | 2026/09/03 17:58 | Jean-Baptiste |
Notes CMS Drupal
Voir aussi :
- Backdrop
CREATE DATABASE drupalqua; CREATE USER 'drupalqua'@'localhost' IDENTIFIED BY 'drupal'; GRANT ALL PRIVILEGES ON drupalqua.* TO "drupalqua"@"localhost" IDENTIFIED BY 'drupal'; FLUSH PRIVILEGES; CREATE DATABASE drupalpprod; CREATE USER 'drupalpprod'@'localhost' IDENTIFIED BY 'drupal'; GRANT ALL PRIVILEGES ON drupalpprod.* TO "drupalpprod"@"localhost" IDENTIFIED BY 'drupal'; FLUSH PRIVILEGES;
msql -u drupalqua -D drupalqua -p < ~/orig/mysql.drupal msql -u drupalpprod -D drupalpprod -p < ~/orig/mysql.drupal UPDATE users SET pass = MD5('drupal') WHERE uid=1;
$db_url = 'mysql://drupalqua:drupal@localhost/drupalqua'; $base_url = 'http://qua.parinux.org'; FIXME $conf = array( 'mimedetect_magic' => '/usr/share/file/magic', );
Logs
http://localhost:8092/admin/reports/dblog
Status
http://localhost:8092/admin/reports/status
Config URLS
http://localhost:8092/admin/config/system/site-information
Reconstruire les permissions
http://localhost:8092/admin/reports/status/rebuild
Vider le cache
drush cache-clear all
PHP Fatal error: Unsupported operand types in drupal-7.39/includes/theme.inc on line 1088
Avant la migration de la base, prévoir suffisament d'espace disque. Sauvegarde avant migration
Sous Apache
a2enmod rewrite
book_access http://ftp.drupal.org/files/projects/book_access-7.x-2.1.tar.gz calendar http://ftp.drupal.org/files/projects/calendar-7.x-3.5.tar.gz cck - intégré dans Drupal core custom_pagers http://ftp.drupal.org/files/projects/custom_pagers-7.x-1.x-dev.tar.gz date http://ftp.drupal.org/files/projects/date-7.x-2.9.tar.gz diff http://ftp.drupal.org/files/projects/diff-7.x-3.2.tar.gz event Rien pour Drupal 7 !? filefield Intégré dans Drupal core ? Rien pour Drupal 7 !? imageapi http://ftp.drupal.org/files/projects/imageapi-7.x-1.x-dev.tar.gz imagecache Rien pour Drupal 7 !? imagefield Intégré dans Drupal core imagefield_import Rien pour Drupal 7 !? ldap_integration Rien pour Drupal 7 !? link http://ftp.drupal.org/files/projects/link-7.x-1.3.tar.gz mimedetect http://ftp.drupal.org/files/projects/mimedetect-7.x-1.x-dev.tar.gz pathauto http://ftp.drupal.org/files/projects/pathauto-7.x-1.x-dev.tar.gz signup http://ftp.drupal.org/files/projects/signup-7.x-1.x-dev.tar.gz tagadelic http://ftp.drupal.org/files/projects/tagadelic-7.x-2.x-dev.tar.gz thickbox Rien pour Drupal 7 !? token http://ftp.drupal.org/files/projects/token-7.x-1.6.tar.gz views http://ftp.drupal.org/files/projects/views-7.x-3.8.zip views_bonus Rien pour Drupal 7 !? webform http://ftp.drupal.org/files/projects/webform-7.x-4.9.tar.gz webformblock Rien pour Drupal 7 !? xmlsitemap ????????? #Dépendances ctools http://ftp.drupal.org/files/projects/ctools-7.x-1.9.zip panels http://ftp.drupal.org/files/projects/panels-7.x-3.5.tar.gz Advanced_help http://ftp.drupal.org/files/projects/advanced_help-7.x-1.3.tar.gz Context http://ftp.drupal.org/files/projects/context-7.x-3.6.tar.gz I18n http://ftp.drupal.org/files/projects/i18n-7.x-1.9.tar.gz
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?i
Pour éviter cette erreur bloquante empêchant le rebuild (Reconstruire les permissions) il convient de laisser le module book_access désactivé puis de faire un update.php avant le rebuild
Tout sauvegarder (dossier et db MySQL)
Déplacer files/ et sites/default/settings.php dans le nouveau Drupal 7
Faire un drush updatedb
Se logger avec le compte admin http://qua.acme.fr/?q=user
Aller à http://qua.acme.fr/admin/config/system/site-information
Page de garde par défaut http://qua.acme.fr/accueil ⇒ http://qua.acme.fr/
Définir les thèmes souhaités Une fois les modules installés, il sera possible de remettre http://qua.acme.fr/accueil
Notes cloudinit
Voir :
Voir aussi :
- Tiny Cloud
ubuntu@vm-testjb1:~$ curl 169.254.169.254/1.0/meta-data/public-keys/0/openssh-key ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCZQwNs9aV//oN/N/NmbVqL83ahLatiVccLR1w2YEVBGX2fj5ANnj7a7hNk1tyld+CQlP93I6z7CW9bBxUjwwcxYWeVmBVRBLtFnjhN56gL7jGfXy6uwtUAf84tKWRem10tThIZhjWIIMHfDyFT7vVVN/hk9E3tQ7CejHK3NzhBUjDzrQ8yVIRynveNe93KNlCHW8T0rD83vqmEwApep/EuGD4rwb1e4zYAeh0HXVQIQzaoXlz8OwEBgzkvygCRrtUJcn3bQIloBmu2KrDvPskhqgCU4I9sbkN/K9PLn5hJVmhHVT3Prf0eU8hbrzdnfXlczmLbmVYTqUlOIvrvbAT jibe@vmdeb1ubuntu@vm-testjb1:~$
#cloud-config packages: - git-core #cloud-config apt_update: true #! echo "plop" > /plop environment: "production" output: {all: '| tee -a /var/log/cloud-init-output.log'}
************************************************************************** # This system is using the EC2 Metadata Service, but does not appear to # # be running on Amazon EC2 or one of cloud-init's known platforms that # # provide a EC2 Metadata service. In the future, cloud-init may stop # # reading metadata from the EC2 Metadata Service unless the platform can # # be identified. # # # # If you are seeing this message, please file a bug against # # cloud-init at # # https://bugs.launchpad.net/cloud-init/+filebug?field.tags=dsid # # Make sure to include the cloud provider your instance is # # running on. # # # # For more information see # # https://bugs.launchpad.net/bugs/1660385 # # # # After you have filed a bug, you can disable this warning by # # launching your instance with the cloud-config below, or # # putting that content into # # /etc/cloud/cloud.cfg.d/99-ec2-datasource.cfg # # # # #cloud-config # # datasource: # # Ec2: # # strict_id: false # ************************************************************************** Disable the warnings above by: touch /home/ubuntu/.cloud-warnings.skip or touch /var/lib/cloud/instance/warnings/.skip
DRAFT - Se connecter à une instance dont on ne possède pas la clef
Voir :
aws --region=eu-central-1 ec2 describe-instances --output=table
my_script.sh
#!/bin/bash cat >> /home/ec2-user/.ssh/authorized_keys <<EOF ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCZQwNs9aV//oN/N/NmbVqL83ahLatiVccLR1w2YEVBGX2fj5ANnj7a7hNk1tyld+CQlP93I6z7CW9bBxUjwwcxYWeVmBVRBLtFnjhN56gL7jGfXy6uwtUAf84tKWRem10tThIZhjWIIMHfDyFT7vVVN/hk9E3tQ7CejHK3NzhBUjDzrQ8yVIRynveNe93KNlCHW8T0rD83vqmEwApep/EuGD4rwb1e4zYAeh0HXVQIQzaoXlz8OwEBgzkvygCRrtUJcn3bQIloBmu2KrDvPskhqgCU4I9sbkN/K9PLn5hJVmhHVT3Prf0eU8hbrzdnfXlczmLbmVYTqUlOIvrvbAT jibe@vmdeb1 EOF sed -i 's/^PasswordAuthentication/#&/' /etc/ssh/sshd_config systemctl restart sshd
base64 my_script.sh > my_script_base64.txt
aws ec2 --region=eu-central-1 modify-instance-attribute --instance-id i-08df328706b9e6d46 --attribute userData --value file://my_script_base64.txt
Autres
/var/lib/cloud/data/set-hostname
File /etc/cloud/cloud-init.disabled
Kernel
cloud-init=disabled
Pb
Pb temps de démarrage élevé
# systemd-analyze
Startup finished in 3.195s (kernel) + 23.788s (userspace) = 26.983s
graphical.target reached after 23.230s in userspace
# systemd-analyze blame
11.755s cloud-init-local.service
5.854s docker.service
3.440s mariadb.service
2.459s cloud-init.service
2.317s isc-dhcp-server.service
1.984s php7.3-fpm.service
1.916s proftpd.service
1.200s cloud-config.service
1.138s ifupdown-pre.service
946ms bind9.service
911ms dev-mapper-vgos\x2droot
Logs
- /var/log/cloud-init.log
- /var/log/cloud-init-output.log
curl http://169.254.169.254/openstack/2018-08-27/meta_data.json
Solution
dpkg -i cloud-init_20.2-2~deb10u1_all.deb cloud-guest-utils_0.29-1_all.deb echo "network: {config: disabled}" > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg rm /etc/network/interfaces.d/50-cloud-init.cfg
Notes Cloud AWS - Ansible
ansible localhost -m ec2_instance -a "instance_ids=i-0713194bd2d67ddb2 state=stopped"
Notes client FTP lftp
Voir aussi :
- rclone
- curl
- ~/.netrc
- /usr/kerberos/bin/ftp (paquet krb5-workstation)
- far2l
wget (download)
wget --ftp-user=FTP_USERNAME --ftp-password='FTP_PASSWORD' ftp://URL/PATH_TO_FTP_DIRECTORY/* wget ftp://paul:123@serveur.org/fichier
curl
Download / Télécharger
curl -u utilisateur:motdepasse ftp://ftp.example.com/fichier.txt -O
Upload / Téléverser
curl -T monfichier.txt -u utilisateur:motdepasse ftp://ftp.example.com/
lftp
Exemple de configuration lftp
~/.lftp/rc
# set ftp:ssl-force false
set ssl:verify-certificate/ftp.truc.com no
#set prompt "lftp \S\? \u\@\h:\w> "
#set ftp:passive-mode off
#set ftp:ssl-force/ftp.adobe.com off
#set ftp:use-feat/ftp.adobe.com off
set cache:enable no
Exemple utilisation
Liste toutes les variables lftp
set -a
Passage en mode binaire. Nécessaire ?
# set type binary quote type i
Exemple 1
lftp ftp://user:Passw0rd@ftp1.acme.fr
NOTE : le mot de passe être défine dans ~/.netrc
Exemple 2 - Envois sosreport à RedHat
lftp -v -c 'open -e "set ftps:initial-prot ""; \ set ftp:ssl-force true; \ set ftp:ssl-protect-data true; \ set ssl:verify-certificate true; \ set ftp:proxy http://192.168.56.1:3128 ; \ open anonymous:ftp@dropbox.redhat.com ; \ cd incoming ; \ put testfile'
Exemple 2 - mirroir - comme un rsync sur FTP
NOTE : Il est aussi possible d'utiliser
- la commande wget
- curlftpfs avec rsync ⇒ à la place de curlftpfs il est préfèrable d'utiliser rclone
lftp user@example.com:/pub> mirror -v data /ftp_mirror lftp user@example.com:/pub> mirror -Rv /data/remote_copy .
Source : http://rajaseelan.com/2011/12/20/rsync-over-ftp/
lftp -c "set ftp:list-options -a; open ftp://user:password@your.ftp.com; lcd ./web; cd /web/public_html; mirror --reverse --delete --use-cache --verbose --allow-chown --allow-suid --no-umask --parallel=2 --exclude-glob .svn"
#!/bin/bash HOST="your.ftp.host.dom" USER="username" PASS="password" FTPURL="ftp://$USER:$PASS@$HOST" LCD="/path/of/your/local/dir" RCD="/path/of/your/remote/dir" #DELETE="--delete" lftp -c "set ftp:list-options -a; open '$FTPURL'; lcd $LCD; cd $RCD; mirror --reverse \ $DELETE \ --verbose \ --exclude-glob a-dir-to-exclude/ \ --exclude-glob a-file-to-exclude \ --exclude-glob a-file-group-to-exclude* \ --exclude-glob other-files-to-exclude"
Source : https://serverfault.com/questions/24622/how-to-use-rsync-over-ftp
Pb
Pb 1
lftp ftp://utilisateur:pass@ftp.serveur.org/Prod/Rapport lftp utilisateur@ftp.serveur.org:/Prod/Rapport> get Fichier.csv get: L'accès a échoué : 534 Policy requires SSL. (Fichier.csv) set ftp:ssl-protect-data true lftp ssmf@91.121.109.131:/Prod/Rapport> get LmkMonthlyExport-20150201.csv 2086953 octets transférés
~/.lftp/rc
set ftp:ssl-protect-data/ftp.serveur.org true
Pb 2
lftp utilisateur@ftp.serveur.org:/Prod/Rapport> get Fichier.csv get: L'accès a échoué : 534 Protection level negotiation failed. (Fichier.csv)
Voir https://access.redhat.com/solutions/336113
Au tout début de la connexion
set ftp:ssl-force true set ftp:ssl-protect-data true
Autres
rclone config
1 / ProFTPd can't handle '*' in file names \ (Asterisk,Ctl,Dot,Slash) 2 / PureFTPd can't handle '[]' or '*' in file names \ (BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket) 3 / VsFTPd can't handle file names starting with dot \ (Ctl,LeftPeriod,Slash)
Paquet RPM lftp-scripts.noarch :
- /usr/share/lftp/convert-mozilla-cookies
- /usr/share/lftp/import-ncftp
- /usr/share/lftp/import-netscape
- /usr/share/lftp/verify-file
- /usr/share/lftp/xdg-move
