Table des matières
4 billet(s) pour janvier 2026
| AWX sur K8S Kind - partage de fichier pour les blob - Execution pods | 2026/01/26 10:15 | Jean-Baptiste |
| Notes rsh rcp | 2026/01/21 18:08 | Jean-Baptiste |
| Git - Duplication d'un dépôt | 2026/01/19 10:22 | Jean-Baptiste |
| Exemple simple de conf Nagios | 2026/01/14 10:07 | Jean-Baptiste |
Notes install Seafile Apache RedHat7 Memcached MySQL/MariaDB
Install Seafile avec MySQL / MariaDB
MySQL doit être démarré
Voir :
yum install python-distribute python-imaging MySQL-python python-memcached python-ldap #adduser --system seafile --shell /sbin/nologin -m adduser --group --system --disabled-password seafile su - seafile -s /bin/bash mkdir foo1 cd foo1 wget https://bintray.com/artifact/download/seafile-org/seafile/seafile-server_5.1.2_x86-64.tar.gz tar xvf ../seafile-server_5.1.2_x86-64.tar.gz Seafile avec MySQL Voir http://manual.seafile.com/deploy/using_mysql.html ./setup-seafile-mysql.sh
La 1er fois lancer
./seafile.sh start
Puis (c'est à cette étape que compte admin sera crée) ./seahub.sh start <port> Site Web. Port par défaut : TCP 8000
./seahub.sh start
Arrêt
./seahub.sh stop ./seafile.sh stop
Install de memcached
Voir http://manual.seafile.com/deploy/add_memcached.html
yum install memcached systemctl enable memcached systemctl start memcached
seahub_settings.py
CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': '127.0.0.1:11211', } }
Conf Apache
Voir http://manual.seafile.com/deploy/deploy_with_apache.html
/etc/httpd/conf.d/sea-foo1.conf
<VirtualHost *:80> ServerName www.myseafile.com # Use "DocumentRoot /var/www/html" for Centos/Fedora # Use "DocumentRoot /var/www" for Ubuntu/Debian DocumentRoot /var/www/html Alias /media /home/seafile/foo1/seafile-server-latest/seahub/media RewriteEngine On <Location /media> Require all granted </Location> # # seafile fileserver # ProxyPass /seafhttp http://127.0.0.1:8082 # retry=0 ProxyPassReverse /seafhttp http://127.0.0.1:8082 RewriteRule ^/seafhttp - [QSA,L] # WebDAV # We use http proxy, since SeafDAV is incompatible with FCGI proxy in Apache 2.4. # ProxyPass /seafdav http://127.0.0.1:8080/seafdav # retry=0 ProxyPassReverse /seafdav http://127.0.0.1:8080/seafdav # # seahub # SetEnvIf Request_URI . proxy-fcgi-pathinfo=unescape SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 ProxyPass / fcgi://127.0.0.1:8000/ # retry=0 </VirtualHost>
./seafile.sh start ./seahub.sh start-fastcgi
Conf Webdav (Lecteur réseau)
http://manual.seafile.com/extension/webdav.html
Voir conf Apache au dessus
conf/seafdav.conf
[WEBDAV] enabled = true port = 8080 fastcgi = false share_name = /seafdav
Notes script bash
Voir
Voir aussi :
- tinyramfs (implémentation initramfs écrite en shell POSIX
Variables
Fichier dans une variable - variable heredoc
ETCHOSTS=$(cat << 'EOF' 10.245.97.221 node1 10.245.102.221 node1b EOF )
Les boucles
Voir aussi :
- Les commandes Xargs et Find qui peuvent être des alternatives aux boucles
For
for (( i=1; $i<=10; i=i+1 )) do echo $i done
Voir exemple avec seq ci-dessous
seq
#for i in $(seq 10) for i in $(seq 1 10) do echo $i done
for i in {1..5} do echo $i done
seq -f "%f" 3 0.8. 6
seq -f "%g/04/2018" 10
seq -s - 8
pb curl break
fic.lst
foo bar
plop_sleep.sh
#! /bin/bash while read -r var do echo $var timeout 1 sleep inf done < fic.lst
plop_curl.sh
#! /bin/bash while read -r var do echo $var timeout 1 curl -s telnet://localhost:22 done < fic.lst
$ ./plop_sleep.sh foo bar $ ./plop_curl.sh foo
Contournement
plop_curl_2.sh
#! /bin/bash while read -r var do echo $var echo timeout 1 curl -s telnet://localhost:22 | bash -s -- done < fic.lst
Vraie solution
plop_curl_2.sh
#! /bin/bash while read -r var do echo $var timeout 1 curl -s telnet://localhost:22 </dev/null done < fic.lst
Gérer les locks
flock -n /tmp/plop.lock -c /opt/plop1.sh -c /opt/plop2.sh
bash Options
Bash suid binary privilege escalation
sudo cp -p /usr/bin/bash /usr/bin/bash-backdoor sudo chmod u+s /usr/bin/bash-backdoor /usr/bin/bash-backdoor -p
Notes scp
Voir :
Voir aussi :
- sftp
Remote to remote
#scp -3 -P 2222 ruser1@rhost1:/rpath/1 scp://ruser2@rhost2:2222//rpath/2 # Chemin absolut scp -3 scp://ruser1@rhost1:2222//rpath/1 scp://ruser2@rhost2:2222//rpath/2 # Chemin relatif scp -3 scp://ruser1@rhost1:2222/rpath/1 scp://ruser2@rhost2:2222/rpath/2
Notes scanner sane
Voir simple-scan, xsane,
apt-get install simple-scan
Pb
Pb 1
# lsusb |grep -i scanner Bus 002 Device 004: ID 07b3:0413 Plustek, Inc. OpticSlim 1200 Scanner
# sane-find-scanner # sane-find-scanner will now attempt to detect your scanner. If the # result is different from what you expected, first make sure your # scanner is powered up and properly connected to your computer. # No SCSI scanners found. If you expected something different, make sure that # you have loaded a kernel SCSI driver for your SCSI adapter. could not fetch string descriptor: Pipe error could not fetch string descriptor: Pipe error found USB scanner (vendor=0x07b3, product=0x0413 [600dpi USB Scanner], chip=GT-6816) at libusb:002:004 # Your USB scanner was (probably) detected. It may or may not be supported by # SANE. Try scanimage -L and read the backend's manpage. # Not checking for parallel port scanners. # Most Scanners connected to the parallel port or other proprietary ports # can't be detected by this program.
# scanimage -L device `gt68xx:libusb:002:004' is a Plustek OpticSlim 1200 flatbed scanner
Solution
Source https://forum.ubuntu-fr.org/viewtopic.php?id=1080701
wget https://bugs.archlinux.org/task/20374\?getfile\=5563 -O cism216.fw mkdir /usr/share/sane/gt68xx/ cp cism216.fw /usr/share/sane/gt68xx/ chmod -R a=rwX /usr/share/sane/gt68xx
cp -p /etc/sane.d/gt68xx.conf{,.orig} vim /etc/sane.d/gt68xx.conf
Il faut ajouter les lignes suivantes :
override "plustek-opticslim-1200" firmware "/usr/share/sane/gt68xx/cism216.fw"
Ça doit ressembler à
- /etc/sane.d/gt68xx.conf
############################################################################## # Autodetect Plustek OpticSlim 1200 usb 0x07b3 0x0413 override "plustek-opticslim-1200" firmware "/usr/share/sane/gt68xx/cism216.fw"
Pb 2
$ scanimage -L device `escl:http://127.0.0.1:60000' is a HP DeskJet 3630 series [9BE284] (USB) flatbed scanner device `hpaio:/usb/DeskJet_3630_series?serial=CN5CS2H5YV067P' is a Hewlett-Packard DeskJet_3630_series all-in-one $ scanimage -T -d escl:http://127.0.0.1:60000 Output format is not set, using pnm as a default. scanimage: open of device escl:http://127.0.0.1:60000 failed: Out of memory $ scanimage -T -d 'hpaio:/usb/DeskJet_3630_series?serial=CN5CS2H5YV067P' Output format is not set, using pnm as a default. scanimage: open of device hpaio:/usb/DeskJet_3630_series?serial=CN5CS2H5YV067P failed: Error during device I/O
Solution
sudo systemctl disable --now ipp-usb.service sudo systemctl mask ipp-usb.service
