Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| public:linux:astuces [2023/12/12 13:12] – [Petits scripts utiles] yann | public:linux:astuces [2024/10/02 17:56] (Version actuelle) – yann | ||
|---|---|---|---|
| Ligne 3: | Ligne 3: | ||
| ====== Petits scripts utiles ====== | ====== Petits scripts utiles ====== | ||
| - | réduire la taille d'un PDF | + | |
| + | ===== Iso vers UTF-8 ===== | ||
| + | |||
| + | https:// | ||
| + | |||
| + | <code bash> | ||
| + | # | ||
| + | TO=" | ||
| + | FROM=$(file -i $FILE | cut -d' | ||
| + | if [[ $FROM = " | ||
| + | echo " | ||
| + | exit 0 | ||
| + | fi | ||
| + | iconv -f $FROM -t $TO -o $FILE.tmp $FILE; ERROR=$? | ||
| + | if [[ $ERROR -eq 0 ]]; then | ||
| + | echo " | ||
| + | mv -f $FILE.tmp $FILE | ||
| + | else | ||
| + | echo "Error on $FILE" | ||
| + | fi | ||
| + | </ | ||
| + | |||
| + | Set the executable bit | ||
| + | <code bash> | ||
| + | chmod +x to-utf8.sh | ||
| + | </ | ||
| + | Do a conversion | ||
| + | <code bash> | ||
| + | ./ | ||
| + | </ | ||
| + | |||
| + | If you want to convert all files under a folder, do | ||
| + | |||
| + | <code bash> | ||
| + | find / | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== réduire la taille d'un PDF ===== | ||
| <code bash> | <code bash> | ||
