edit /etc/apparmor.d/usr.sbin.mysqld
Ajouter les répertoires contenant les csv pour LOAD
/usr/sbin/mysqld {
[...]
/home/www/douane/export/ftp_tempo/ r,
/home/www/douane/export/ftp_tempo/* rw
/home/mysql_log r,
/home/mysql_log/** rwk
[...]
}
/etc/init.d/apparmor reload
Autre pb selon serveur
/etc/systemd/system/mysqld.service -> ProtectHome=false
/lib/systemd/system/mariadb.service and /lib/systemd/system/mariadb@.service
ou sudo systemctl edit mariadb.service
systemctl daemon-reload
/etc/init.d/mysql stop
/etc/init.d/mysql start
On peut alors faire
CREATE DATABASE DBF_TABLES CHARACTER SET CP850;
USE DBF_TABLES;
CREATE TABLE stock engine=CONNECT table_type=DBF READONLY=0 file_name='/home/lecteurh/dbf/fichiers/stock.dbf';
Pour certaines version -> erreur 174
CREATE TABLE stock engine=CONNECT table_type=DBF READONLY=0
option_list='Accept=1' file_name='/home/lecteurh/dbf/fichiers/stock.dbf';
création d'au moins un index:
ALTER TABLE `stock` ADD PRIMARY KEY (`id_stock`);
-> fichier stock.dbx créé <- vérifier car pas de message d'erreur si pb de droits
PHP DEBUG
Test PHP en ligne
http://sandbox.onlinephpfunctions.com/
apt install php-xdebug // dans le php.ini xdebug.remote_enable=On xdebug.remote_connect_back=1 xdebug.remote_port=9000 xdebug.remote_handler="dbgp" install eclipse pour php : https://www.eclipse.org/pdt/
TELEPHONE CODES Android
*#*#4636#*#* -> infos et stat téléphone *#*#7780#*#* -> retour paramètres usine sur (irréversible) *2767*3855# -> paramètres usine + install par defaut
DOCKER notes
docker container list / docker container ls docker images run ... -v host_chemin:container_chemin run ... --network="host" run ... --restart=always docker stop $(docker ps -a -q) stop tous containers docker rm $(docker ps -a -q) enlève tous containers (pas images) # connexion ssh dans le container ( ici guacamole, puis container par id) docker exec -it guacamole /bin/bash docker run -it 34bf7416e973 bash -> interactif
Licences accès distant prolonger période essais
cmd -> regedit
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod
clique droit autorisations -> propriétaire -> administrateur (root)
Supprimer la clef L$RTM…
reboot
DOCKER sur Debian 9
apt update apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" apt update apt install docker-ce systemctl status docker
docker search nom_du_module docker container ls --all // -> liste -> ID du container docker stop ID // arret docker rm ID // enlève l'image docker images ls docker stop $(docker ps -a -q) // stop tout docker rm $(docker ps -a -q) // enlève tout
Exemples
docker run -v /home/www/monsite:/var/www/html -p 9000:9000 --restart=always andthensome/docker-php-5.3-fpm docker run -v /home/docker/test12/www:/var/www/html -p 82:80 --restart=always nouphet/docker-php4
MYSQL CHANGE PASSWORD
/etc/init.d/mysql stop
/usr/sbin/mysqld --skip-grant-tables
mysql> FLUSH PRIVILEGES;
mysql> SET PASSWORD FOR root@'localhost' = PASSWORD('votre_nouveau_mot_de_passe');
mysql> FLUSH PRIVILEGES;
mysql> exit
/etc/init.d/mysql start
// création user grant all CREATE USER [IF NOT EXISTS] 'monadmin'@'%' IDENTIFIED BY 'monpass'; GRANT ALL ON *.* TO 'monadmin'@'%';
TUNNEL SSH
ssh-keygen -t rsa -b 4096 // création clef ssh ( si pas déjà fait) ssh user@dev.monserveur.com <-password // première connexion serveur relais manuelle ssh-copy-id root@ monserveur.com // copie clef dans sshd_config ajouter : GatewayPorts yes /etc/init.d/ssh restart //(debian) ssh -R 4444:localhost:80 user@dev.monserveur.com en se connectant sur dev.monserveur.com:4444 c'est localhost:80 qui répond. autossh -M 0 -q -f -N -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -R 4444:localhost:80 user@dev.monserveur.com même chose mais en tache de fond avec reconnexion automatique Lancement au boot ajouter un fichier /etc/systemd/system/autossh-tunnel.service [Unit] Description=AutoSSH tunnel service local 80 port 4444 dev.monserveur.mobi After=network.target [Service] Environment="AUTOSSH_GATETIME=0" ExecStart=/usr/bin/autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -NR 4444:localhost:80 root@dev.monserveur.mobi Restart=always User=pi [Install] WantedBy=multi-user.target puis: sudo systemctl start autossh-tunnel.service sudo systemctl stop autossh-tunnel.service sudo systemctl enable autossh-tunnel.service pour démarrage auto
NEXTCLOUD pb update
Dans le .htaccess mettre en commentaires les lignes :
<IfModule mod_php5.c>
# php_value upload_max_filesize 511M
# php_value post_max_size 511M
# php_value memory_limit 512M
# php_value mbstring.func_overload 0
# php_value always_populate_raw_post_data -1
# php_value default_charset 'UTF-8'
# php_value output_buffering 0
<IfModule mod_env.c>
SetEnv htaccessWorking true
</IfModule>
</IfModule>
<IfModule mod_php7.c>
# php_value upload_max_filesize 511M
# php_value post_max_size 511M
# php_value memory_limit 512M
# php_value mbstring.func_overload 0
# php_value default_charset 'UTF-8'
# php_value output_buffering 0
<IfModule mod_env.c>
SetEnv htaccessWorking true
</IfModule>
</IfModule>
<IfModule mod_dir.c>
# DirectoryIndex index.php index.html
</IfModule>
AddDefaultCharset utf-8
# Options -Indexes
Dans quelques cas, ajouer au my.cnf ou mariadb.conf.d/50-server.cnf (erreurs oc_addressbooks)
innodb_large_prefix=on
innodb_file_format=barracuda
innodb_file_per_table=true
PFSENSE astuces
Clavier FR sur la console : Services: Shellcmd Setting:EDIT Ajout commande :kbdcontrol -l /usr/share/vt/keymaps/fr.kbd Description Clavier AZERTY reboot