Outils pour utilisateurs

Outils du site


blog

Vérifier l'intégrité des fichiers avec Fim

Installation

Pour Java 8 sous Jessie, les backports sont nécessaire

echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
 
apt-get update
Install
apt-get install -t jessie-backports openjdk-8-jre-headless
A partir des sources

Nous allons compiler le code Java.

apt-get install maven
apt-get install -t jessie-backports openjdk-8-jdk
cd /opt
git clone https://github.com/evrignaud/fim.git
cd fim
 
mvn clean install
 
export PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:$PATH
 
alias fim='PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:$PATH /opt/fim/fim' 
2025/03/24 15:06

Vérifier l'intégrité des fichiers

Voir :

find -type f -exec sha512sum {} \; > SHA512SUMS 2>SHA512SUMS.err
sha512sum --quiet -c SHA512SUMS

Sur Debian, vérifier l'intégrité des fichiers de paquets .deb

dpkg --verify
debsums -as

Pour RedHat/CentOS

rpm -Va
2025/03/24 15:06

Serveur NFS v3 et montage client

Préférez la version 4. Voir NFSv4

Voir :

  • rclone serv

Sur le serveur

/etc/exports

/data/plop                  machine1(async,rw,no_root_squash)
exportfs -rv

Si besion

chmod 1777 /data/plop

Sur le client

/etc/fstab

serveurnfs:/data/plop         /import/plop          nfs     defaults,_netdev,nfsvers=3      0 0

rw,bg,hard,rsize=32768,wsize=32768,tcp,vers=3,timeo=600

mkdir -p /import/plop
mount /import/plop

Mount options

nocto: Suppress the retrieval of new attributes when creating a file.
noac: Disable all forms of attribute caching entirely. This extracts a significant performance penalty but it allows two different NFS clients to get reasonable results when both clients are actively writing to a common export on the server.
noacl: Disables Access Control List (ACL) processing.

vers=4.1: NFS v4.1 should be used instead of v4.0 because there is a Linux NFS client bug in v4.0 that can cause significant problems due to stale data.

nofail: Don't halt boot process waiting for this mount to become available

lookupcache=positive: Tells the NFS client to honor positive cache results but invalidates any negative cache results. Negative cache results cause problems with Git. Specifically, a git push can fail to register uniformly across all NFS clients. The negative cache causes the clients to 'remember' that the files did not exist previously.

Test

Supervision

Voir aussi :

Le plus simple pour monitorer NFS étant de créer un fichier de le l'effacer https://docs.netapp.com/us-en/ontap/nfs-config/test-access-client-systems-task.html

stat -f (system call statfs(2)
If the NFS mount is “stale”, then stat -f returns immediately but with a size of -1. The check detects that and results in a warning state.

mount -l | grep nfs
grep nfs /proc/mounts
nfsstat
nfsstat --mounts
mountpoint -q /mnt/foo
findmnt -rno SOURCE,TARGET "$1"
lsof -b
ss -a | grep :nfs
mountpoint="/mnt/testnfs"
#read -t1 < <(stat -t "$mountpoint" 2>&-)
read -r -t1 < <(stat -t "$mountpoint" 2>&-)
if [ -z "$REPLY" ] ; then
  echo "NFS mount stale. Removing..."
fi
2025/03/24 15:06

Remplacer uuencode/uudecode par openssl

Voir aussi :

  • base58

Exemple

$ echo -n "Test" | openssl base64
VGVzdA==
$ echo "VGVzdA==" | openssl base64 -d
Test

En encore

cat /usr/share/doc/systemd/LICENSE.LGPL2.1 | head -12 | gzip | openssl base64
H4sIAAsBF1cAA2VRwW7CMAy95yvecZO6ijLtwBFQQUgdQnTsMu2Qti6NVhKUuCD+
fg6MHTYrOdh+7/nJBv7Gcr1DkZdlvsUyX+fbaYHNblas5pCfr8tc/aPc4p18MM5i
nGYJFlT5QfsLsslkohTm7njxZt8xHuaPsSiY2MLCE6F0LZ+1JyzcYBvNIpNgZetU
4SUTiLZfvbEoWcAs4qblDoveOZ9g5gJH+OsUGI2zbPSUPY8yYFdOFfIT+YuzBBNw
JH8wzNSAHWrxA20bNCawN9XABMFWMvsQm4aCgmvBnTB7U5MNhMbVw4GsOBA86k7b
vbF7GI7y1jF037szNalSH2+RKI87Qmt8YHjqSQcZf/pZ1FWeUFAI5LHcFCmwiiIh
+hssiwV9UwhDXQvM+TvpeiVT+bjizVCJQ0mvLpNf/XGCjmxN6sq4V+1wqGScXCn9
VOob+cnrRwACAAA=
(
cat <<EOF
H4sIAAsBF1cAA2VRwW7CMAy95yvecZO6ijLtwBFQQUgdQnTsMu2Qti6NVhKUuCD+
fg6MHTYrOdh+7/nJBv7Gcr1DkZdlvsUyX+fbaYHNblas5pCfr8tc/aPc4p18MM5i
nGYJFlT5QfsLsslkohTm7njxZt8xHuaPsSiY2MLCE6F0LZ+1JyzcYBvNIpNgZetU
4SUTiLZfvbEoWcAs4qblDoveOZ9g5gJH+OsUGI2zbPSUPY8yYFdOFfIT+YuzBBNw
JH8wzNSAHWrxA20bNCawN9XABMFWMvsQm4aCgmvBnTB7U5MNhMbVw4GsOBA86k7b
vbF7GI7y1jF037szNalSH2+RKI87Qmt8YHjqSQcZf/pZ1FWeUFAI5LHcFCmwiiIh
+hssiwV9UwhDXQvM+TvpeiVT+bjizVCJQ0mvLpNf/XGCjmxN6sq4V+1wqGScXCn9
VOob+cnrRwACAAA=
EOF
) | openssl base64 -d | gzip -d > plop.txt

Base64 sans line return :
Utilisez '-A' Exemple

cat plop.sh | openssl base64 | tr -d '\n' | openssl base64 -A -d

Alternatives

2025/03/24 15:06

Utiliser Git pour vos logos en SVG

Voir http://w.xuv.be/projects/design_with_git

Faire du diffing graphique (oui ! pas en texte) avec Git sur des images vectorielle en SVG

compare.py

#!/usr/bin/env python
import sys, os
 
inkscape = "inkscape"
 
local = sys.argv[1]
remote = sys.argv[2]
tempdir = "/home/markv/gittemp/"
localpng = tempdir+"local.png"
remotepng = tempdir+"remote.png"
 
if(not (remote.endswith(".svg") and (local != "/dev/null"))):
    os.system("xxdiff %s %s" % (local, remote))
else:
    os.system(inkscape+" "+local+" --export-png="+localpng+" -w600 -h900 -C -bffffff -y1.0")
    os.system(inkscape+" "+remote+" --export-png="+remotepng+" -w600 -h900 -C -bffffff -y1.0")
    os.system("compare "+localpng+" "+remotepng+" - | display")
    os.remove(localpng)
    os.remove(remotepng)

Ajoutez dans votre .gitconfig (adapter le chemin)

~/.gitconfig

[difftool "compare"]
        cmd = "/home/USER/bin/compare.py $LOCAL $REMOTE - | display"

Puis par exemple

git difftool -y -t compare
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