AirV's Blog

Just another blog

PDF sous linux

Fusionner 2 documents pdf

  • 1ère version from Linuxerie
    ghostscript -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=a4 -sOutputFile=resultat.pdf fichier1.pdf fichier2.pdf fichier3.pdf fichier4.pdf

  • 2ère version from Blogosteff

$ pdf2ps toto.pdf
$ pdf2ps tata.pdf
$ cp tata.ps tatatoto.ps
$ cat toto.ps >> tatatoto.ps
$ ps2pdf tatatoto.ps

  • Un script concatpdf.sh (à tester)

#!/bin/sh
NOMFINAL= » »
touch aux.ps
while [ « $# » -gt « 0 » ]
do
pdf2ps $1
FICHIER=$(basename $1 .pdf)
cat $FICHIER.ps >> aux.ps
NOMFINAL=$FICHIER$NOMFINAL
rm $FICHIER.ps
shift
done
ps2pdf aux.ps
rm aux.ps
mv aux.pdf $NOMFINAL.pdf

  • Extension pour plusieurs fichiers

./concatpdf *


WakeOnLan

Sous Windows

  • Airytec Switch Off permet d’éteindre, de redémarrer ou de mettre en hibernation un ordinateur de manière automatique ou à distance à partir d’un autre ordinateur ou d’un téléphone mobile. Le logiciel peut aussi déconnecter les connexions dial-up (connexions à un réseau par une ligne téléphonique) et VPN (réseau privé virtuel). L’opération peut être programmée à partir de n’importe quel ordinateur ou téléphoné doté d’un navigateur Web.

Sous linux

From Doc-Ubuntu-fr.org

« Le Wake-on-LAN ou mise en marche du PC depuis le réseau est une technologie développée par AMD et IBM, permettant à un ordinateur mis en veille d’être démarré à distance par l’envoi d’un « magic-packet » sur la carte réseau supportant le Wake-on-LAN.

Plus techniquement, le réveil est déclenché quand la carte ethernet de l’ordinateur reçoit un « magic packet » qui est une trame de données ethernet contenant les octets FF FF FF FF FF FF suivis de seize répétitions de l’adresse MAC de la cible, puis d’un mot de passe (si nécessaire) de quatre ou six octets. »

Derrière une Freebox il suffit de cocher la case Proxy WOL (Wake On Lan) depuis la console de gestion. Si l’on ajoute la redirection de ports (9) cela ne fonctionnera pas…

Un script en ligne pour allumer son PC.

NB : ne pas oublier de préciser la mac-address

En ligne de commande :

wakeonlan -i IP MACADRESS


Sécuriser Apache2 avec SSL

From Doc.Ubuntu-fr.org :

  • Pour que le protocole SSL puisse fonctionner avec le Serveur HTTP Apache2, il faut activer le module ssl avec la commande :
sudo a2enmod ssl
  • puis recharger la configuration d’Apache2 faîtes :
sudo service apache2 force-reload
  • Création du certificat

Avec Intrepid Ibex (8.10) et supérieur

    • Installer si necessaire le package : apt-get install ssl-cert (déjà installé sous Lucid)
    • Pour générer un certificat auto-signé avec Ubuntu, il nous suffit de taper les commandes suivantes dans un terminal :
sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/private/localhost.pem
  • Configuration Apache2
    • Méthode 1 : en se basant sur la configuration du site par défaut
      Se placer dans le dossier de configuration des sites apache :
      cd /etc/apache2/sites-available/
    • Recopier la configuration par défaut pour la nouvelle configuration ssl :
      sudo cp default ssl
    • Assigner le port ssl :
      sudo sed -i ‘1,2s/*:80/*:443/’ ssl
    • Ajouter les directives SSLEngine On et SSLCertificateFile /etc/ssl/private/localhost.pem à la configuration :
      sudo sed -i « 3a\tSSLEngine OnntSSLCertificateFile /etc/ssl/private/localhost.pem » ssl
  • Activer la configuration du site ssl :
    sudo a2ensite ssl
  • Reload du Serveur Http Apache2
    sudo /etc/init.d/apache2 reload
Normalement, si tout s’est bien passé, vous devriez désormais avoir accès à votre site Web de manière sécurisée.

Utilitaire disque sous linux

From HowToGeek.com :

Knowing how to check the condition of your hard disk is useful to determine when to replace your hard disk. In today’s article, we will show you some Linux disk utilities to diagnose the health of your hard disk.

Image by Scoobay

S.M.A.R.T System

Most modern ATA and SCSI hard disks have a Self-Monitoring, Analysis, and Reporting Technology (SMART) system. SMART hard disks internally monitor their own health and performance.

The SMART tool assesses the condition of your hard disk based on: the throughput of the hard disk, the seek errors rate of the magnetic heads, and other attributes that your hard disk manufacturer built into their hard disk.

Most implementations of SMART systems allow users to perform self-tests to monitor the performance and reliability of their hard disks. The simplest way to perform a SMART system test with Ubuntu is using the ‘Disk Utility’ under the ‘System’ > ‘Administration’ menu.



The disk utility lets you see the model, serial number, firmware, and the overall health assessment of the hard disk, as well as whether a SMART system is enabled on the hard disk.

The ‘SMART data’ button lets you see the SMART features of your hard disk.

The ‘Run Self-test’ button lets you initiate a short,extended, or a conveyance self-test on the hard disk.

When you execute these tests, you’ll see a progress meter, letting you see how far through the test is and what the estimated time of completion is.

The ‘Attributed section’ lets you see the errors and self-test information.

File System Check

There some other tools, beside the Disk Utility GUI, that we can use to diagnose the health of our hard disk. The File System Check (FSCK), that only comes as a command line tool, is one of the tools that we often use to check the condition of our hard disk.

You can use the ‘Check Filesystem’ feature of the ‘Disk Utility’ to perform the same check,if you are not a command line geek like us.

Of course, there are some situations where we have to use the command line tool to check our file system. For example when we are using a headless system, when our Linux box fails to boot, or when we simply want to show off our command line Kungfu skills to our friends.

At first, the FSCK command line tool looks like something that only a computer geek can handle; But you will find that FSCK is a very easy tool to use. There is one thing to note before you run FSCK; You need to unmount the file system using the ‘umount’ command. Fixing a mounted file system with FSCK could end up creating more damage than the original problem.

sudo umount /dev/sdb

The FSCK command is pretty straightforward:

sudo fsck -t ext4 /dev/sdb

This command checks an ext4 file system (/dev/sdb) for inconsistencies. You should replace /dev/sdb with your own partition. You can run the ‘fdisk’ command to find out your system partitions:

sudo fdisk -l

Scheduled File System Checks

If you’re using Ubuntu, you will notice that Ubuntu runs an FSCK session when you boot your system from time to time. If you find this scheduled check annoying, you can re-schedule the scan using the ‘tune2fs’ command. Here’s how it typically looks like:

The mount count parameter tells us that Ubuntu scans our hard disk after 33 disk mounts.

We can configure the mount count using the ‘-c’ option:

sudo tune2fs -c 35 /dev/sda1

This command will re-configure Ubuntu to scan our hard disk after 35 hard disk mounts when the system boots.

Note: change ‘/dev/sda1/’ with your own partition

Bad Blocks

A bad sector is a sector on a computer’s disk drive that cannot be used due to permanent damage (or an OS inability to successfully access it), such as physical damage to the disk surface.

There are two ways to detect bad sectors in Linux: you can use the Disk Utility GUI, or if you are a command line geek like us, you can use the badblocks command to check your hard disk for bad sectors:

sudo badblocks -v /dev/sdb1

Badblock will give us the number of bad sectors in our hard disk.


zainul@zainul-laptop:~$ sudo badblocks -v /dev/sdb1
Checking blocks 0 to 97683200
Checking for bad blocks (read-only test): 3134528 done, 3:27 elapsed
3134560 done, 8:33 elapsed
3134561 done, 10:15 elapsed
3134562 done, 11:57 elapsed
3134563 done, 13:39 elapsed
done
Pass completed, 5 bad blocks found.

You have two options when you see bad blocks. You can either look for a new hard disk, or mark these bad blocks as unusable hard disk sectors. This involves two steps:

First we have to write the location of the bad sectors into a flat file.

sudo badblocks /dev/sdb > /home/zainul/bad-blocks

After that, we need to feed the flat file into the FSCK command to mark these bad sectors as ‘unusable’ sectors.

sudo fsck -l bad-blocks /dev/sdb


FSCK, Badblocks, and Disk Utility are some of the disk utilities that we often use to scan our hard disks. Do share with the other fellow readers if you know other Linux disk utilities to scan hard disks.

Comment réinstaller Grub2

From Doc-Ubuntu.org :

  • Amorcez votre ordinateur sur un CD Live
  • Monter la partition contenant votre grub2

menu Raccourcis et sélectionnez la partition à monter dans la liste des partitions existantes

  • Vérifiez que vos OS sont listés

sudo os-prober

  • Réinstallez grub

sudo grub-install –root-directory=/media/MaPartionGrub2 /dev/sda

Autre solution le chroot

Backup Ubuntu

From Freshmeat.net :

« …Arkeia Network Backup Enterprise Edition for Ubuntu is a completely free version of the Arkeia Network Backup software specifically for Ubuntu servers. It allows an administrator to backup and restore files via a powerful easy to use Web UI. This edition has the option to backup to a 250 GB VTL or tape drive. All Arkeia products support any tape drive that is compatible with the Linux st driver. This edition allows you to backup Windows desktops, Mac desktops, Linux servers, FreeBSD servers, and more… »

Site officiel

A tester.

Packages installés

From Ubuntu.org :

Sauvegarde

  • Récupérez la liste des paquets installés sur le système :
   # dpkg --get-selections > liste-des-paquets
  • sauvegardez le fichier /etc/apt/sources.list

Restauration

  • Récupérez votre fichier « liste-des-paquets » puis :
   # sudo apt-get update
   # sudo dpkg --set-selections < liste-des-paquets
   # sudo apt-get -u dselect-upgrade

Script post-installation

  • voir le script de post-installation de . Ernst
  • script d’installation de packages

Post-installation

PAC Manager

From Davidtv :

« …PAC is a Perl/GTK Gnome replacement for SecureCRT/Putty/etc… It provides a GUI to configure SSH/Telnet connections: users, passwords, EXPECT regular expressions, macros, etc. You like ‘SSHMenu’? If so, you must check this tool. Just let me know how do you feel about it!… »

Testé et approuvé 🙂

Dépôt :

  • Add to your /etc/sources.list file

deb http://archive.getdeb.net/ubuntu lucid-getdeb apps

  • then « update »
  • and finally install « pac ».

xPUB a kiosk solution

From Linux-live-cd.org :

xPUD, est un live CD léger 60Mo (base Ubuntu), qui permet de réaliser un kiosk (firefox en plein écran en guise de bureau) et de personnaliser facilement la page d’accueil de celui-ci en ajoutant des modules (http://ce-que-vous-voulez.libre) en option au moment du boot du live CD. L’outils opt-get permet d’ajouter des modules avec comme extension disponible sur cette page (que 6 actuellement) :

http://download.xpud.org/opt/

Pour les utiliser, il faut se rendre dans l’onglet Settings et choisir opt-get, et il vous sera proposé 4 installations (Skype, adobe, codec et un driver B43 wireless)

Site officiel : http://xpud.org/

Un blog qui en parle très bien : http://penkia.blogspot.com/2009/10/xpud-091-minimal-browser-os.html

Site officiel: http://xpud.org/

Base: Ubuntu
Version actuelle: 0.9.5

Ultamatix

Dans la suite de Automatix voici Ultamatix :

From Wikipedia : « …Ultamatix is a tool that automates the addition of applications, codecs, fonts andlibraries not provided directly by the software repositories of Debian-based distributions like Ubuntu… »

« Page précédentePage suivante »