Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
public:linux:astuces [2023/10/11 16:52] – ↷ Page déplacée de fr:public:linux:astuces à public:linux:astuces yannpublic:linux:astuces [2024/10/02 17:56] (Version actuelle) yann
Ligne 2: Ligne 2:
  
 ====== Petits scripts utiles ====== ====== Petits scripts utiles ======
 +
 +
 +===== Iso vers UTF-8 =====
 +
 +https://stackoverflow.com/questions/11316986/how-to-convert-iso8859-15-to-utf8
 +
 +<code bash>
 +#!/bin/bash
 +TO="UTF-8"; FILE=$1
 +FROM=$(file -i $FILE | cut -d'=' -f2)
 +if [[ $FROM = "binary" ]]; then
 + echo "Skipping binary $FILE..."
 + exit 0
 +fi
 +iconv -f $FROM -t $TO -o $FILE.tmp $FILE; ERROR=$?
 +if [[ $ERROR -eq 0 ]]; then
 +  echo "Converting $FILE..."
 +  mv -f $FILE.tmp $FILE
 +else
 +  echo "Error on $FILE"
 +fi
 +</code>
 +
 +Set the executable bit
 +<code bash>
 +chmod +x to-utf8.sh
 +</code>
 +Do a conversion
 +<code bash>
 +./to-utf8.sh MyFile.txt
 +</code>
 +
 +If you want to convert all files under a folder, do
 +
 +<code bash>
 +find /your/folder/here | xargs -n 1 ./to-utf8.sh
 +</code>
 +
 +
 +===== réduire la taille d'un PDF =====
 +
 +
 +<code bash>
 +gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
 +</code>
  
 Exporter un gif animé en image png Exporter un gif animé en image png
public/linux/astuces.1697035929.txt.gz · Dernière modification : de yann
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0