Rechercher dans ce blog

Affichage des articles dont le libellé est ubuntu. Afficher tous les articles
Affichage des articles dont le libellé est ubuntu. Afficher tous les articles

lundi 12 février 2024

Stop Ubuntu Pro Upgrade

Pour arrêter que la suggestion de la mise à jour PRO des packages n'apparaisse :

sudo pro config set apt_news=false


dimanche 22 janvier 2023

ubuntu no gui start

sudo systemctl set-default multi-user
gnome-session-quit
sudo systemctl set-default graphical
sudo systemctl start gdm3

mercredi 3 mars 2021

apfs-fuse basic commands

apfs-fuse -o uid=1000,gid=1000,allow_other  /dev/sdd2 /media/homeapfs/

Unmount a drive

As root:

umount <mount-directory>

As user:

fusermount -u <mount-directory>

SAMSUNG M2070W Activer Scanner linux Ubuntu 20.04

L'installation par défaut du pilote ne fonctionne pas. Pour corriger il faut créer des liens symboliques manuellement après l'installation.

Pour faire découvrir le scanner en réseau utiliser la commande :

smfpnetdiscovery

qui devrait retourner quelque chose comme

Network socket://192.168.0.105 "Samsung M2070 Series" "Samsung M2070 Series on 192.168.0.105" "MFG:Samsung;CMD:SPL,URF,FWV,PIC,EXT,SPDS;MDL:M2070 Series;CLS:PRINTER;CID:SA_SPLV3_BW;MODE:SCN,SPL3,R000105,SCP;"
network ipp://192.168.0.105 "Samsung M2070 Series" "Samsung M2070 Series on 192.168.0.105" "MFG:Samsung;CMD:SPL,URF,FWV,PIC,EXT,SPDS;MDL:M2070 Series;CLS:PRINTER;CID:SA_SPLV3_BW;MODE:SCN,SPL3,R000105,SCP;"


installer le pilote

puis création des liens symboliques

sudo ln -s /opt/smfp-common/scanner/lib/libsane-smfp.so.1.0.1 /usr/lib/x86_64-linux-gnu/sane/libsane-smfp.so.1.0.1
sudo ln -s /usr/lib/x86_64-linux-gnu/sane/libsane-smfp.so.1.0.1 /usr/lib/x86_64-linux-gnu/sane/libsane-smfp.so.1
sudo ln -s /usr/lib/x86_64-linux-gnu/sane/libsane-smfp.so.1 /usr/lib/x86_64-linux-gnu/sane/libsane-smfp.so


ajouter "smfp" dans /etc/sane.d/dll.conf

tous les autres backends peuvent être commentés

chmod 644 smfp-samsung.conf

ajouter

<model vendor="samsung" id="m2070w" modelstring="M2070 Series"/>

dans smfp.samsung.conf

scanimage -L

pour debugger scanimage -L

export SANE_DEBUG_DLL=255 && scanimage -L &> debug.txt

qui retourne quelque chose comme

[23:41:10.277791] [sanei_debug] Setting debug level of dll to 255.
[23:41:10.277967] [dll] sane_init: SANE dll backend version 1.0.13 from sane-backends 1.0.29
[23:41:10.277998] [dll] sane_init/read_dlld: attempting to open directory `./dll.d'
[23:41:10.278067] [dll] sane_init/read_dlld: attempting to open directory `/etc/sane.d/dll.d'
[23:41:10.278108] [dll] sane_init/read_dlld: using config directory `/etc/sane.d/dll.d'
[23:41:10.278183] [dll] sane_init/read_dlld: considering /etc/sane.d/dll.d/hplip
[23:41:10.278241] [dll] sane_init/read_config: reading dll.d/hplip
[23:41:10.278297] [dll] add_backend: adding backend `hpaio'
[23:41:10.278350] [dll] sane_init/read_dlld: done.
[23:41:10.278395] [dll] sane_init/read_config: reading dll.conf
[23:41:10.278475] [dll] add_backend: adding backend `smfp'
[23:41:10.278541] [dll] sane_get_devices
[23:41:10.278571] [dll] load: searching backend `smfp' in `/usr/lib/x86_64-linux-gnu/sane:/usr/lib/sane:/usr/lib64/sane'
[23:41:10.278604] [dll] load: trying to load `/usr/lib/x86_64-linux-gnu/sane/libsane-smfp.so.1'
[23:41:10.278652] [dll] load: dlopen()ing `/usr/lib/x86_64-linux-gnu/sane/libsane-smfp.so.1'
[23:41:10.283749] [dll] init: initializing backend `smfp'
[23:41:10.286285] [dll] init: backend `smfp' is version 1.0.1
[23:41:11.664860] [dll] load: searching backend `hpaio' in `/usr/lib/x86_64-linux-gnu/sane:/usr/lib/sane:/usr/lib64/sane'
[23:41:11.664928] [dll] load: trying to load `/usr/lib/x86_64-linux-gnu/sane/libsane-hpaio.so.1'
[23:41:11.664979] [dll] load: dlopen()ing `/usr/lib/x86_64-linux-gnu/sane/libsane-hpaio.so.1'
[23:41:11.670235] [dll] init: initializing backend `hpaio'
[23:41:11.671274] [dll] init: backend `hpaio' is version 1.0.0
[23:41:13.112936] [dll] sane_get_devices: found 1 devices
device `smfp:net;192.168.0.105' is a Samsung M2070 Series on 192.168.0.105 Scanner
[23:41:13.112971] [dll] sane_exit: exiting
[23:41:13.112984] [dll] sane_exit: calling backend `smfp's exit function
[23:41:13.113309] [dll] sane_exit: calling backend `hpaio's exit function
[23:41:13.113755] [dll] sane_exit: finished

vendredi 8 janvier 2016

UBUNTU 14.04 - network manager cli command nmcli

Pour gérer le network manager et lister les infos comme le DNS


nmcli  dev list

nmcli  dev list iface eth1|grep IP4

apt-mark pour lister les paquets hold, auto, manual - UBUNTU

Pour  lister tous les paquets qui sont hold

apt-mark showhold

extrait du man page de apt-mark

DESCRIPTION

       apt-mark will change whether a package has been marked as being
       automatically installed.

       When you request that a package is installed, and as a result other
       packages are installed to satisfy its dependencies, the dependencies
       are marked as being automatically installed. Once these automatically
       installed packages are no longer depended on by any manually installed
       packages, they will be removed by e.g.  apt-get or aptitude.

       auto
           auto is used to mark a package as being automatically installed,
           which will cause the package to be removed when no more manually
           installed packages depend on this package.

       manual
           manual is used to mark a package as being manually installed, which
           will prevent the package from being automatically removed if no
           other packages depend on it.

       hold
           hold is used to mark a package as held back, which will prevent the
           package from being automatically installed, upgraded or removed.
           The command is only a wrapper around dpkg --set-selections and the
           state is therefore maintained by dpkg(1) and not affected by the
           --file option.

       unhold
           unhold is used to cancel a previously set hold on a package to
           allow all actions again.

       showauto
           showauto is used to print a list of automatically installed
           packages with each package on a new line. All automatically
           installed packages will be listed if no package is given. If
           packages are given only those which are automatically installed
           will be shown.

       showmanual
           showmanual can be used in the same way as showauto except that it
           will print a list of manually installed packages instead.

       showhold
           showhold is used to print a list of packages on hold in the same
           way as for the other show commands.

jeudi 7 janvier 2016

ubuntu wifi settings by cli iwconfig command

Pour se connecter à un réseau wifi protégé par web

iwconfig eth1 mode managed key restricted motdepasseduwifi
iwconfig eth1 essid MyWifi
ifconfig eth1 up
dhclient eth1

mercredi 9 décembre 2015

UPSTART job control UBUNTU / LINUX

from http://upstart.ubuntu.com/cookbook/

A job does not necessarily need a stop on stanza. If it lacks one, any running instances can still be stopped by an Administrator running either of:

    initctl stop
    stop



4.7.1   Display Runlevel

To display your current and previous runlevels separated by a space character, run the /sbin/runlevel command. Note that if this command is unable to determine the system runlevel, it may display simply "unknown":

$ runlevel
N 2

The output above shows that:

    there was no previous runlevel (the system was booted and went straight to the current runlevel).
    the current runlevel is "2".


4.7.2   Change Runlevel Immediately

To change runlevel immediately, use one of the commands below:

    reboot(8)
    shutdown(8)
    telinit(8)




6.33   start on

This stanza defines the set of Events that will cause the Job to be automatically started.

Syntax:

start on EVENT [[KEY=]VALUE]... [and|or...]

Each event EVENT is given by its name. Multiple events are permitted using the operators "and" and "or" and complex expressions may be performed with parentheses (within which line breaks are permitted).

You may also match on the environment variables contained within the event by specifying the KEY and expected VALUE. If you know the order in which the variables are given to the event you may omit the KEY.

VALUE may contain wildcard matches and globs as permitted by fnmatch(3) and may expand the value of any variable defined with the env stanza.

Negation is permitted by using "!=" between the KEY and VALUE.

Note that if the job is already running and is not an instance job, if the start on condition becomes true (again), no further action will be taken.

Note that the start on stanza expects a token to follow on the same line. Thus:

# ERROR: invalid
start on
  foo or bar

# OK
start on foo or bar

If no environment variables are specified via KEY to restrict the match, the condition will match all instances of the specified event.

See Really understanding start on and stop on for further details.
6.33.1   Normal start

If you are just writing an upstart job that needs to start the service after the basic facilities are up, either of these will work:

start on (local-filesystems and net-device-up IFACE!=lo)

or:

start on runlevel [2345]

The difference in whether to use the more generic 'runlevel' or the more explicit local-filesystems(7) and net-device-up events should be guided by your job's behaviour. If your service will come up without a valid network interface (for instance, it binds to 0.0.0.0, or uses setsockopt(2) SO_FREEBIND), then the runlevel event is preferable, as your service will start a bit earlier and start in parallel with other services.

However if your service requires that a non-loopback interface is configured for some reason (i.e., it will not start without broadcasting capabilities), then explicitly saying "once a non loopback device has come up" can help.

In addition, services may be aggregated around an abstract job, such as network-services:

start on started network-services

The network-services job is a generic job that most network services should follow in releases where it is available. [19] This allows the system administrator and/or the distribution maintainers to change the general startup of services that don't need any special case start on criteria.

We use the started(7) event so that anything that must be started before all network services can do "start on starting network-services".
6.33.2   Start depends on another service

start on started other-service

6.33.3   Start must precede another service

start on starting other-service

Example: your web app needs memcached to be started before apache:

start on starting apache2
stop on stopped apache2
respawn

exec /usr/sbin/memcached

6.34   stop on

This stanza defines the set of Events that will cause the Job to be automatically stopped if it is already running.

Syntax:

stop on EVENT [[KEY=]VALUE]... [and|or...]

Like the stop on stanza, start on expects a token to follow on the same line:

# ERROR: invalid
stop on
  foo or bar

# OK
stop on foo or bar

See start on for further syntax details.
6.34.1   Normal shutdown

stop on runlevel [016]

Or if a generic job is available such as network-services [19]

stop on stopping network-services

6.34.2   Stop before depended-upon service

stop on stopping other-service

Note that this also will stop when other-service is restarted, so you will generally want to couple this with the start on condition:

start on started other-service

6.34.3   Stop after dependent service

stop on stopped other-service




6.28   respawn

Note

If you are creating a new Job Configuration File, do not specify the respawn stanza until you are fully satisfied you have specified the expect stanza correctly. If you do, you will find the behaviour potentially very confusing.

Without this stanza, a job that exits quietly transitions into the stop/waiting state, no matter how it exited.

With this stanza, whenever the main script/exec exits, without the goal of the job having been changed to stop, the job will be started again. This includes running pre-start, post-start and post-stop. Note that pre-stop will not be run.

There are a number of reasons why you may or may not want to use this. For most traditional network services this makes good sense. If the tracked process exits for some reason that wasn't the administrator's intent, you probably want to start it back up again.

Likewise, for tasks, (see below), respawning means that you want that task to be retried until it exits with zero (0) as its exit code.

One situation where it may seem like respawn should be avoided, is when a daemon does not respond well to SIGTERM for stopping it. You may believe that you need to send the service its shutdown command without Upstart being involved, and therefore, you don't want to use respawn because Upstart will keep trying to start your service back up when you told it to shutdown.

However, the appropriate way to handle that situation is a pre-stop which runs this shutdown command. Since the job's goal will already be 'stop' when a pre-stop is run, you can shutdown the process through any means, and the process won't be re-spawned (even with the respawn stanza).

Note that if a job is respawned, the variable "$PROCESS" will be set to the name of the job process that failed (for example "pre-start" or "main"). See stopped(7) for further details.

Further note that if the job does not specify the respawn limit stanza as well as the respawn stanza, the job will have the default respawn limit applied (see respawn limit).
6.29   respawn limit

Yes, this is different to a plain respawn: specifying respawn limit does not imply respawn.

Syntax:

respawn limit COUNT INTERVAL | unlimited

Example:

# respawn the job up to 10 times within a 5 second period.
# If the job exceeds these values, it will be stopped and
# marked as failed.
respawn
respawn limit 10 5

# respawn the job indefinitely
respawn limit unlimited

Respawning is subject to a limit. If the job is respawned more than COUNT times in INTERVAL seconds, it will be considered to be having deeper problems and will be stopped. Default COUNT is 10. Default INTERVAL is 5 seconds.

To have the job respawn indefinitely, specify an argument of "unlimited". However, care should be taken using this option: does your service really stop that frequently? Should it?

Specifying either COUNT or INTERVAL as 0 (zero) implies unlimited.

Note that respawn only applies to automatic respawns and not the restart(8) command.

If the job has been respawned up to its respawn limit, the variable "$PROCESS" will be set to "respawn" to denote that the respawn limit was reached. See stopped(7) for further details.

UFW enable no logging UBUNTU / LINUX

vi /lib/ufw/ufw-init-functions


Coller ça:

 if [ ! -z "$LOGLEVEL" ]; then
            /usr/sbin/ufw logging $LOGLEVEL || true
        fi

juste avant ça dans la fonction ufw_start()

 if [ ! -z "$IPT_SYSCTL" ] && [ -s "$IPT_SYSCTL" ]; then
            sysctl -e -q -p $IPT_SYSCTL || true
        fi

        if [ "$error" = "yes" ]; then
            /bin/echo -e "$out"
            return 1
        fi


/etc/ufw# vi ufw.conf

# Please use the 'ufw' command to set the loglevel. Eg: 'ufw logging medium'.
# See 'man ufw' for details.
LOGLEVEL=off

Change DISK UUID LINUX / UBUNTU

tune2fs /dev/sdb1 -U 310fd3b1-bc68-45cf-b04b-c9498ae59e27






Problème sur disque monté

when I tried to change my root filesystem's uuid on new 14.04 ubuntu, tune2fs reported back: I can't do that to mounted file systems.

There's a flag that needs to be disabled, to allow mounted-uuid changes with the new tune2fs. this is what my process looked like:

root@ubuntu1404:~# blkid
/dev/sda1: UUID="2ec827b0-72be-4c73-b58a-102a37aa24a3" TYPE="ext4"
root@ubuntu1404:~# uuid="deafcafe-abba-daba-deca-fc0ffee05065"
root@ubuntu1404:~# root_disk=$(df /|grep /|cut -d' ' -f1)
root@ubuntu1404:~# echo $root_disk
/dev/sda1
root@ubuntu1404:~# tune2fs -U $uuid $root_disk
tune2fs 1.42.9 (4-Feb-2014)
The UUID may only be changed when the filesystem is unmounted.
root@ubuntu1404:~# tune2fs -O ^uninit_bg $root_disk
tune2fs 1.42.9 (4-Feb-2014)
root@ubuntu1404:~# tune2fs -U $uuid $root_disk
tune2fs 1.42.9 (4-Feb-2014)
root@ubuntu1404:~# tune2fs -O +uninit_bg $root_disk
tune2fs 1.42.9 (4-Feb-2014)
root@ubuntu1404:~# df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       7.3G  3.9G  3.0G  58% /
root@ubuntu1404:~# blkid
/dev/sda1: UUID="deafcafe-abba-daba-deca-fc0ffee05065" TYPE="ext4"
root@ubuntu1404:~#

Générer une image ISO de DVD à partir d'un dossier VIDEO_TS en CLI / UBUNTU

Utiliser la commande :

genisoimage -dvd-video -o dvd.iso DIRECTORY/

Le dossier VIDEO_TS doit être un sous-dossier de DIRECTORY

La commande genisoimage semble installée d'origine sur ubuntu 14.04 (en tout cas je ne me souviens pas de l'avoir installée).


mardi 21 avril 2015

HP Elitebook 8470p fingerprint reader validity


Procédure pour activer le lecteur d'empreintes digitales sur HP elitebook 8470p sous UBUNTU 14.04


Uninstallation
===========
GNOME users: The package policykit-

1-fingerprint-gui replaces GNOME's standard PolicyKit daemon (contained in package policykit-1-gnome). However, when you decide to uninstall Fingerprint GUI (and hence remove policykit-1-fingerprint-gui), policykit-1-gnome will not get automatically installed back, hence there won't be any PolicyKit daemon in the system, and APT will try to remove all the packages that depend on it. Therefore, if you want to remove Fingerprint GUI, make sure you install policykit-1-gnome back first.
   sudo apt-get install policykit-1-gnome
   sudo apt-get remove fingerprint-gui


Je donne toutes les démarches à faire pour obtenir le fonctionnement, mais on peut simplifier en installant directement installer le pkg et copier le fichier de démarrage et ensuite on peut passer toutes les étapes de la compilation en récupérant la libfprint0 déjà compilée comme le pkg et le script sur mon drive google (https://drive.google.com/fingerprint_reader_files).

uname -a :

Linux uranix 3.13.0-49-generic #83-Ubuntu SMP Fri Apr 10 20:11:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

lsusb -s 001:003 -v :

Bus 001 Device 003: ID 138a:003d Validity Sensors, Inc.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass        17
  bDeviceProtocol       255
  bMaxPacketSize0         8
  idVendor           0x138a Validity Sensors, Inc.
  idProduct          0x003d
  bcdDevice            1.04
  iManufacturer           0
  iProduct                0
  iSerial                 1 0030d8cdc38f
  bNumConfigurations      1






... cut ...








Le plus simple est d'installer :

sudo apt-get install libbsapi policykit-1-fingerprint-gui fingerprint-gui

Cela devrait installer automatiquement : libfprint0

Si nécessaire installer d'abord :

sudo apt-add-repository ppa:fingerprint/fingerprint-gui
sudo apt-get update


Attention : la version 1.07 de fingerprint ne fonctionne pas correctement aussi je maintiens la version 1.07. Comme les packages ne sont pas disponible dans cette version via le ppa je mets les pkg version 1.06 sur le drive google avec les autres fichiers. A suivre lorsqu'il y aura une mise à jour fingerprint...

Dans cet état le fingerprint reader ne fonctionne pas.

Il faut installer une libfprint0 qui le reconnaisse et qui est (si je comprends bien) un wrapper pour le pilote que HP a développé pour la distribution Suse. Je suis ici les indications données sur le blog (merci à lui) mais en les modifiant et les complétant là où c'est nécessaire :

http://blog.pasqualefiorillo.it/post/hp-probook-4540s-validity-sensors-driver-su-linux-mintdebian/


1 - télécharger le pilote :

ftp://ftp.hp.com/pub/softpaq/sp57001-57500/sp57317.tar
 
2 -  tar xvf sp57317.tar

3 - On obtient un paquet .rpm

Validity-Sensor-Setup-4.4-100.00.x86_64.rpm

On le convertit en paquet debian

sudo alien -d Validity-Sensor-Setup-4.4-100.00.x86_64.rpm

4 - On installe le paquet debian

sudo dpkg -i validity-sensor-setup-4.4-100.00.x86_64.deb

5 - On modifie le script de démarrage

/etc/init.d/vcsFPServiceDaemon

en remplaçant son contenu par

#!/bin/sh
### BEGIN INIT INFO
# Provides: Validity Fingerprint Service Daemon
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 5
# Default-Stop: 0 6
# Short-Description: Validity Fingerprint Service Daemon
# Description: Start vcsFPService to provide Validity FP Service
### END INIT INFO
#
# Note on runlevels:
# 0 - halt/poweroff 6 - reboot
# 1 - single user 2 - multiuser without network exported
# 3 - multiuser w/ network (text mode) 5 - multiuser w/ network and X11 (xdm)
#

. /lib/lsb/init-functions

vcsFPService_BIN=/usr/bin/vcsFPService
test -x $vcsFPService_BIN || { echo "$vcsFPServiceDaemon is not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }

case "$1" in
start)
echo -n "Starting vcsFPService Daemon \n"
start-stop-daemon --start --background --quiet --exec "$vcsFPService_BIN" > /dev/null 2 >&1

;;
stop)
echo -n "Stopping vcsFPService Daemon \n"

#/sbin/killall -TERM $vcsFPService_BIN
start-stop-daemon --stop --quiet --quiet --oknodo --retry=0/1/KILL/5 --exec "$vcsFPService_BIN" > /dev/null 2 >&1

;;
status)
echo "Checking for vcsFPService Daemon \n"

if pidof -o %PPID $vcsFPService_BIN> /dev/null; then
echo "client is running. \n"
exit 0
else
echo "client is not running. \n"
exit 1
fi
;;
*)
echo "Usage: $0 {start|stop|status}"
exit 1
;;
esac

exit 0

6 - On met à jour  les liens de démarrage

sudo update-rc.d vcsFPServiceDaemon defaults

Pour savoir si le service fonctionne ou non :

sudo /etc/init.d/vcsFPServiceDaemon status

7 - Téléchargement de libfprint0

http://suse.mes.edu.cu/SLES_11_SP2/CD2/suse/src/libfprint-0.0.6-18.20.1.src.rpm

 8 - Extraire le contenu du paquet rpm avec le gestionnaire d'archives soit par l'interface graphique soit en utilisant la commande :

file-roller -h libfprint-0.0.6-18.20.1.src.rpm

9 - cd libfprint-0.0.6-18.20.1.src/

Extraire

bzip2 -d libfprint-0.0.6.tar.bz2

Untarer :

tar xf libfprint-0.0.6.tar

10 - Patcher pour ajouter le support pour le fingerprint reader validity 0138:003d

cd libfprint-0.0.6/
patch -p1 <../libfprint-validity.patch


moi@uranix:~/Téléchargements/libfprint-0.0.6-18.20.1.src/libfprint-0.0.6$ patch -p1 <../libfprint-validity.patch
patching file libfprint/Makefile.am
Hunk #1 succeeded at 7 (offset -1 lines).
Hunk #2 succeeded at 64 (offset -9 lines).
patching file libfprint/Makefile.in
patching file libfprint/core.c
patching file libfprint/drivers/validity/vfsDriver.c
patching file libfprint/drivers/validity/vfsDriver.h
patching file libfprint/drivers/validity/vfsWrapper.h
patching file libfprint/fp_internal.h
Hunk #1 succeeded at 122 (offset -3 lines).
Hunk #2 succeeded at 149 (offset -4 lines).
patching file libfprint/imgdev.c


11 - Compiler

./configure
make


12 - Remplacer libfprint0 de ubuntu par celle que l'on vient de compiler.

 cp libfprint/.libs/libfprint.so.0.0.0 /usr/lib

Attention, s'il y a une mise à jour de libfprint0 alors elle sera remplacée de nouveau par la version d'ubuntu.

Donc en faire une copie de sauvegarde dans /usr/local/lib par exemple.

cp libfprint/.libs/libfprint.so.0.0.0 /usr/local/lib

Mais aussi faire un hold sur la lib en faisant :

echo "libfprint0 hold"|dpkg --set-selections

ou

apt-mark hold libfprint0

13 A partir de là, le fingerprint reader doit être reconnu (bien s'assurer que le service vcsFPServiceDaemon est running...

avec fingerprint-gui on peut enregistrer ses empreintes et tester les différents services comme sudo, screenlocker, etc.




Je mets tous les fichiers sur mon drive google.

https://drive.google.com/fingerprint_reader_files




lundi 20 avril 2015

HP ELITEBOOK 8470p FIX Brightness control UBUNTU 14.04

Put in

/usr/share/X11/xorg.conf.d/20-intel.conf

20-intel.conf

Section "Device"
        Identifier  "card0"
        Driver      "intel"
        Option      "Backlight"  "intel_backlight"
        BusID       "PCI:0:2:0"
EndSection


root@uranix:/usr/share/X11/xorg.conf.d# ls -ltr
total 36
-rw-r--r-- 1 root root  842 fév  5  2014 50-wacom.conf
-rw-r--r-- 1 root root  364 fév  5  2014 11-evdev-trackpoint.conf
-rw-r--r-- 1 root root  590 fév  5  2014 11-evdev-quirks.conf
-rw-r--r-- 1 root root  115 fév  5  2014 50-vmmouse.conf
-rw-r--r-- 1 root root  590 avr 10  2014 51-synaptics-quirks.conf
-rw-r--r-- 1 root root 1757 avr 10  2014 50-synaptics.conf
-rw-r--r-- 1 root root 1867 fév 12 15:51 10-quirks.conf
-rw-r--r-- 1 root root 1099 fév 12 15:51 10-evdev.conf
-rw-r--r-- 1 root root  167 mar 26 09:57 20-intel.conf

Now brightness control work fine.

vendredi 22 août 2014

How to pass memmap parameters to kernel via grub to not use bad ram

memmap linux kernel parameters are:

        mem=nn[KMG]     [KNL,BOOT] Force usage of a specific amount of memory
                        Amount of memory to be used when the kernel is not able
                        to see the whole system memory or for test.
                        [IA-32] Use together with memmap= to avoid physical
                        address space collisions. Without memmap= PCI devices
                        could be placed at addresses belonging to unused RAM.

        mem=nopentium   [BUGS=IA-32] Disable usage of 4MB pages for kernel
                        memory.

        memmap=exactmap [KNL,IA-32] Enable setting of an exact
                        E820 memory map, as specified by the user.
                        Such memmap=exactmap lines can be constructed based on
                        BIOS output or other requirements. See the memmap=nn@ss
                        option description.

        memmap=nn[KMG]@ss[KMG]
                        [KNL] Force usage of a specific region of memory
                        Region of memory to be used, from ss to ss+nn.

        memmap=nn[KMG]#ss[KMG]
                        [KNL,ACPI] Mark specific memory as ACPI data.
                        Region of memory to be used, from ss to ss+nn.

        memmap=nn[KMG]$ss[KMG]
                        [KNL,ACPI] Mark specific memory as reserved.
                        Region of memory to be used, from ss to ss+nn.

When passing via grub you need to escape the $:

ie: memmap 128M\$1024M 

Without the escaping, memmap doesn't behave correctly.

In /etc/default/grub you need to escape \ too.

So option as to be writed this way: memmap 128M\\\$512M

Several memmap options could be used as the same time.


samedi 12 juillet 2014

SONY VAIO VGN-CS21S UBUNTU 14.04 TOUCHPAD KEYBOARD SLEEP HIBERNATION PROBLEMS SOLUTIONS

Voici ce que j'ai dû faire pour que l'hibernation et la mise en veille fonctionnent sur mon sony vaio vgn-cs21s ainsi que le touchpad.




J'ai essayé toutes les solutions proposées pour réactiver le clavier au réveil mais aucune n'a fonctionné.



#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noacpi nolapic atkbd.reset"
#GRUB_CMDLINE_LINUX="atkbr.reset i8042.reset i8042.nomux=1 i8042.nopnp i8042.noloop"
#GRUB_CMDLINE_LINUX="i8042.reset i8042.nomux=1 i8042.nopnp i8042.noloop"

Pour explications commandes atkbr voir ci-dessous

J'ai essayé de passer des paramètres comme

options nvidia modeset=1 et ce genre de trucs mais rien n'a donné de bons résultats.

dans /etc/modprobe.d/nvidia-331_hybrid.conf

Solutions

Suppression du module sony-laptop

#rmmod sony-laptop

Grub < atkbr.reset

Il faut quand même passer l'option atkbr.reset au kernel

/etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet atkbd.reset"


Il faut installer le driver propriétaire NVIDIA car le driver NOUVEAU ne fonctionne pas avec la mise en veille. 

Installation pilote NVIDIA


Dans "Paramètres système..." / "Logiciels et mises à jour"

Onglet "Pilotes additionnels" 

"Utilisation de NVIDIA binary driver - version 331.38 depuis nvidia-331 (propriétaire, testé)"

Script pour réinitialiser psmouse lors du réveil

Attention la commande "sleep 6" est nécessaire. Le timing a été trouvé expérimentalement. Sans ce délai d'attente ça ne fonctionne pas (je ne sais pas pourquoi). 6 secondes est le minimum qui fonctionne sur ma machine.

Dans /usr/lib/pm-utils/sleep.d




root@lunix:/usr/lib/pm-utils/sleep.d# cat 0000resetpsmouse

#!/bin/sh

resume_modules()
{
    sleep 6
    /sbin/rmmod psmouse
    /sbin/modprobe psmouse
    echo "Reloaded unloaded psmouse module."
}

case "$1" in
    thaw|resume)
        resume_modules
        ;;
    *) exit $NA
        ;;
esac


fichier : 0000resetpsmouse



Réinitialisation du touchpad en cours de session

Quelques fois en cours de session le touchpad ne répond plus correctement ou bien le clic gauche ne fonctionne plus, etc. Pas trouvé de solution très rationnelle à ce problème. J'ai bricolé un script associé à un raccourci clavier pour reloader le driver psmouse.

Script pour réinitialiser la souris : resetmouse.sh

Pour que le script fonctionne avec les droits utilisateur, il faut suid /bin/kmod

#chmod a+s /bin/kmod

rmmod et modprobe sont des soft links vers kmod.

root@lunix:/usr/local/bin# cat resetmouse.sh
#!/bin/bash
/sbin/rmmod psmouse >> /home/moi/resetmouse.log 2>&1;/sbin/modprobe psmouse >> /home/moi/.resetmouse.log 2>&1

J'ai associé le script à un raccourci clavier : Ctrl + Maj + Sterling

Les trois touches forment un alignement. Si le touchpad débloquent, je presse le raccourci et tout rendre dans l'ordre.

J'ai constaté que le touchpad devient fou lorsque je touche les touches de commandes multimédia au-dessus du clavier et également la touche "Menu".

Je n'ai pas réussi à désactiver durablement la touche "Menu", la seule solution / bricolage que j'ai trouvé est de l'utiliser comme raccourci vers une commande qui ne fait rien genre /bin/true.

Réglage de la luminosité

Avec le driver NOUVEAU le réglage de la luminosité ne fonctionnait pas.

Gnome faisait varier de 0 à 7 la valeur de

/sys/class/backlight/sony/brightness

Alors que ce qui réglait effectivement la luminosité était de 0 à 100

/sys/class/backlight/nv_backlight/brightness

Avec le pilote propriétaire NVIDIA il n'y a plus du tout de fichier dans

/sys/class/backlight

J'ai contourné le problème de la façon suivante :

Le pilote crée dans le home directory un fichier : .nvidia-settings-rc

J'ai écrit un script qui modifie les settings du pilote pour faire varier la luminosité. J'ai ensuite associé ce script à des raccourcis clavier

Script : sony_brightness.pl

root@lunix:/usr/local/bin# cat sony_brightness.pl
#!/usr/bin/perl
# Script pour ajuster la luminosité de l'écran du Sony VGN-CS21S
# L'installation du pilote propriétaire NVIDIA rend inopérant le
# dispositif de réglage basé sur /sys/class/backlight
# Je contourne le problème en modifiant le fichier de configuration
# du pilote dans $HOME
# Le pilote libre "nouveau" ne fonctionne pas avec la mise en veille.
# fmc - 2014 06
# Version 1.0

$A = shift @ARGV;
$HOME="/home/elsa-louise";
$GREP="/bin/grep";
$SED="/bin/sed";
$AWK="/usr/bin/awk";
$FILE=".nvidia-settings-rc";

if ( $A ne "+" && $A ne "-" && $A ne "0" ) {

    print "Paramètre invalide ou manquant (+ ou -) \n";
    exit 1;
}

$CURRED=`$GREP RedBrightness $HOME/$FILE | $AWK -F "=" '{print \$2}'`;
$CURGREEN=`$GREP GreenBrightness $HOME/$FILE | $AWK -F "=" '{print \$2}'`;
$CURBLUE=`$GREP BlueBrightness $HOME/$FILE | $AWK -F "=" '{print \$3}'`;
$CUR=$CURRED;
chomp $CUR;
$MAX="1";
$MIN="-1";


if ( $A eq "+" ) {
    if ( $CUR < $MAX ) {

    $CUR=$CUR + 0.1;
}
}

if ( $A eq "-" ) {
    if ( $CUR > $MIN ) {

    $CUR=$CUR - 0.1;
}

}

if ( $A eq "0" ) {

    $CUR=0;
}

`$SED -i -r -e 's/Brightness.*/Brightness=$CUR/' $HOME/$FILE`;
`/usr/bin/nvidia-settings -l`;


Trois raccourcis clavier

Ctrl + Maj + F6 /usr/local/bin/sony_brightness.pl + Pour augmenter
Ctrl + Maj + F5 /usr/local/bin/sony_brightness.pl -   Pour diminuer
 Ctrl + Maj + F7 /usr/local/bin/sony_brightness.pl 0 Pour remettre à 0 = au milieu


Utils...

nvidia-settings --query all|more
nvidia-settings --query [DPY:LVDS-0]/RedBrightness
nvidia-settings --assign "[DPY:LVDS-0]/RedBrightness=1,1"

Commandes diverses


Pour lister infos sur module chargé
modinfo psmouse

cd /sys/module/psmouse/
lister les paramètres...

Liste les inputs...
cat /proc/bus/input/devices


Pour afficher les options que le kernel a reçu au démarrage
less /proc/cmdline


xrandr

xrandr permet de faire varier la luminosité de l'écran sous X

xrandr --output LVDS-0 --brightness "N"

Commande atkbr et i8042


#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noacpi nolapic atkbd.reset"
#GRUB_CMDLINE_LINUX="atkbr.reset i8042.reset i8042.nomux=1 i8042.nopnp i8042.noloop"
#GRUB_CMDLINE_LINUX="i8042.reset i8042.nomux=1 i8042.nopnp i8042.noloop"


atkbd.extra= [HW] Enable extra LEDs and keys on IBM RapidAccess,
EzKey and similar keyboards

atkbd.reset= [HW] Reset keyboard during initialization

atkbd.set= [HW] Select keyboard code set
Format: (2 = AT (default) 3 = PS/2)

atkbd.scroll= [HW] Enable scroll wheel on MS Office and
similar
keyboards

atkbd.softraw= [HW] Choose between synthetic and real raw mode
Format: (0 = real, 1 = synthetic
(default))



This is an arcane option, only necessary on some rare devices (one of which you have). The only documentation is one line in the kernel parameters list.

The i8042 controller controls PS/2 keyboards and mice in PCs. It seems that on your laptop, both the keyboard and the touchpad are connected through that chip.

From what I understand from the option name and a brief skim of the source code (don't rely on this to write an i8042 driver!), some i8042 chips are capable of multiplexing data coming from multiple pointing devices. The traditional PS/2 interface only provides for one keyboard and one mouse; modern laptops often have a two or more of a touchpad, a trackstick and an external PS/2 plug. Some controllers follow the active PS/2 multiplexing specification, which permit up to 4 devices; the data sent by each device carries an indication of which device it comes from.

The Linux driver tries to find out whether the i8042 controller supports multiplexing, but sometimes guessing wrongly. With the i8042.nomux=1 parameter, the driver does not try to detect whether the controller supports multiplexing and assumes that it doesn't. With the i8042.reset parameter, the driver resets the controller when starting, which may be useful to disable multiplexing mode if the controller does support it but in a buggy way.
shareimprove this answer

UBUNTU 14.04 Disable shopping suggestions


gsettings set com.canonical.Unity.Lenses disabled-scopes "['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope', 'more_suggestions-populartracks.scope', 'music-musicstore.scope', 'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope', 'more_suggestions-skimlinks.scope']"

vendredi 6 juin 2014

UBUNTU 14.04 GRUB DISABLE OS PROBED MEMTEST+ SUBMENU

Pour que update-grub n'ajoute pas dans grug.cfg certaines entrées :

memtest+ :

chmod -x /etc/grub.d/20_memtest86+

Recovery & Advanced Menu

GRUB_DISABLE_RECOVERY="true"
GRUB_DISABLE_SUBMENU="y"



SKIP LIST OS PROBED

Pour interdire certaines entrées des os détectés il faut modifier le script 30_os-prober de /etc/grub.d/ qui ne fonctionne pas tel quel. En fait il fait le test du contenu de la variable GRUB_OS_PROBER_SKIP_LIST en ajoutant à l'uuid de la partition l'id du device. Le plus simple surtout sur un portable avec un seul disque est de changer la variable de EXPUUID à UUID.

Ligne 142 changer

ORIG: if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" -a "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then
 
NEW: if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" -a "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${UUID}'\b'`" != "x" ] ; then

et ajouter dans /etc/default/grub la variable suivante


GRUB_OS_PROBER_SKIP_LIST="uuid de la partition de l'OS que l'on veut exclure"


Si l'on veut que les Probed OS soient au début du menu grup il suffit de changer le numéro du script ; par exemple 09_os-prober.


REMARQUE
Attention les paramètres passés par /etc/default/grub  GRUB_CMDLINE_LINUX="par1 par2" sont ajoutés au kernel UNIQUEMENT avant les paramètres passés dans GRUB_CMDLINE_LINUX_DEFAULT. Ca a son importance si le paramètres doit être passé avant ou après un autre.



vendredi 23 mai 2014

UBUNTU / LUBUNTU 14.04 notes d'installation et configuration

Dépôt à ajouter

deb http://www.deb-multimedia.org wheezy main non-free


Ce dépôt pour le multimedia (utile pour installer les lib de décryptage des dvd notamment) donne un message d'avertissement (warning) lors de l'upade de la liste des paquets car la clef n'est pas installée.

On peut l'installer ainsi :

#apt-get install deb-multimedia-keyring

Installer lib décryptage des DVD

apt-get install libdvdcss2

Lubuntu autoriser hibernation

I found that you can at least active the menu by doing the following:

Create the file /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

The file must have the following content:

[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=yes

Auto login lxde (lubuntu)

Dans  /etc/lightdm/lightdm.conf

[SeatDefaults]
autologin-guest=false
autologin-user=moi
autologin-user-timeout=0
autologin-session=lightdm-autologin


Pour régler les alternatives

Par exemple vi

pour lister les alternatives


update-alternatives --query vi

pour configurer avec un menu interactif

update-alternative --config vi

autres exemples d'alternatives

x-www-browser
x-terminal-emulator

lubuntu : dans l'application préférences/default applications for lxsession

lxsession configuration permet également de régler les applications au démarrage et d'ajouter via l'interface graphique les commandes personnalisées à exécuter au démarrage...

Ce qui est équivalent à éditer le fichier :

/home/moi/.config/lxsession/Lubuntu/autostart

Pour gérer le network manager et lister les infos comme le DNS

nmcli  dev list

nmcli  dev list iface eth1|grep IP4

Clavier et souris


Touchpad qui ne fonctionne pas sur SONY VAIO


1ère solution

1. Edit /etc/default/grub to include GRUB_CMDLINE_LINUX=”i8042.reset i8042.nomux i8042.nopnp i8042.noloop”
2. Run: sudo update-grub
3. Reboot.

2ième solution

in rc.local

modprobe -r psmouse
modprobe psmouse proto=imps

3ième solution

Charger psmouse proto=imps dans /etc/modules ce qui est plus rationnel que de le décharger pour le recharger avec la bonne option dans rc.local.

L'option imps au module semble plus stable que de passer les paramètres au kernel.

synclient

affiche et modifie les paramètres de la souris. Permet notamment de supprimer le touchad click.

Pour dumper les paramètres courants dans un fichier qui peut être utilisé pour recharger ces paramètres avec ou sans modifications.

synclient -l | sed 's/Parameter settings:/synclient/;s/ //g;s/$/ \\/g;$ s/ \\/\n/' > confSyn.sh

Pour lancer la commande au démarrage de la session.

/home/moi/.config/lxsession/Lubuntu/autostart

/usr/bin/synclient TapButton1=0

Mettre cette commande dans /etc/rc.local ne fonctionne pas.

Pour une description de toutes les options modifiables par synclient voir "man 4 synaptics"


Pour trouver les codes des touches on peut suivre la procédure suivante :

xinput -list

Liste les entrées.


A --------------------------------------------------------

xinput -list

⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ DualPoint Stick                           id=13   [slave  pointer  (2)]
⎜   ↳ Logitech USB Laser Mouse                  id=11   [slave  pointer  (2)]
⎜   ↳ AlpsPS/2 ALPS DualPoint TouchPad          id=14   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Sony Vaio Keys                            id=7    [slave  keyboard (3)]
    ↳ Video Bus                                 id=8    [slave  keyboard (3)]
    ↳ Power Button                              id=9    [slave  keyboard (3)]
    ↳ Sony Visual Communication Camer           id=10   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=12   [slave  keyboard (3)]

B ---------------------------------------------------------------

xinput list-props 'AlpsPS/2 ALPS DualPoint TouchPad'

Device 'AlpsPS/2 ALPS DualPoint TouchPad':
        Device Enabled (141):   1
        Coordinate Transformation Matrix (143): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        Device Accel Profile (270):     1
        Device Accel Constant Deceleration (271):       2.500000
        Device Accel Adaptive Deceleration (272):       1.000000
        Device Accel Velocity Scaling (273):    12.500000
        Synaptics Edges (293):  300, 1700, 210, 1190
       
(...)
        Device Product ID (259):        2, 8
        Device Node (260):      "/dev/input/event13"

C ----------------------------------------------------------------------------

evtest /dev/input/event13

Input driver version is 1.0.1
Input device ID: bus 0x11 vendor 0x2 product 0x8 version 0x300
Input device name: "AlpsPS/2 ALPS DualPoint TouchPad"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 272 (BTN_LEFT)
    Event code 273 (BTN_RIGHT)
    Event code 274 (BTN_MIDDLE)
    Event code 325 (BTN_TOOL_FINGER)
    Event code 330 (BTN_TOUCH)
    Event code 333 (BTN_TOOL_DOUBLETAP)
    Event code 334 (BTN_TOOL_TRIPLETAP)
    Event code 335 (BTN_TOOL_QUADTAP)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value      0
      Min        0
      Max     2000
    Event code 1 (ABS_Y)
      Value      0
      Min        0
      Max     1400
    Event code 24 (ABS_PRESSURE)
      Value      0
      Min        0
      Max      127
    Event code 47 (ABS_MT_SLOT)
      Value      0
      Min        0
      Max        1
    Event code 53 (ABS_MT_POSITION_X)
      Value      0
      Min        0
      Max     2000
    Event code 54 (ABS_MT_POSITION_Y)
      Value      0
      Min        0
      Max     1400
    Event code 57 (ABS_MT_TRACKING_ID)
      Value      0
      Min        0
      Max    65535
Properties:
  Property type 3 (INPUT_PROP_SEMI_MT)
Testing ... (interrupt to exit)
***********************************************
  This device is grabbed by another process.
  No events are available to evtest while the
  other grab is active.
  In most cases, this is caused by an X driver,
  try VT-switching and re-run evtest again.


Scripts de démarrage daemon et service 

Il y a deux systèmes de démarrage

Le traditionnel system V avec /etc/init.d/

et le système upstart

On peut lister les services avec la commande service --status-all

La commande initctl permet aussi de gérer les services.

Pour supprimer un service au démarrage de upstart, il faut supprimer le script dans le répertoire /etc/init/

J'ai créé le dir /etc/init_no pour placer les scripts upstart que je ne voulais pas lancer au démarrage.

Attention il peut y avoir pour le même service un script dans les deux systèmes... !

Commandes diverses

Pour redémarrer le window manager 

$service lightdm restart

Pour lister les paquets qui sont dans l'état hold

#apt-mark showhold

Pour modifier le mode de mise en hibernation

echo shutdown > /sys/power/disk
echo disk > /sys/power/state

Pour lister la carte graphique

lspci -nn|grep VGA





vendredi 9 mai 2014

fix touchpad problem sony vaio vgn-cs21s proto imps modprobe mouse

Under ubuntu 14.04

If you are using a generic synaptic touchpad, but it fails to respond to tapping or scrolling actions under a new installation, you can run the following two commands to immediately make it work:


modprobe -r psmouse
modprobe psmouse proto=imps

You can put this into rc.local.


Other way to make this change permanent, create a file such as touchpad.conf under /etc/modprobe.d/, and put the following line in it:
options psmouse proto=imps 
 
 

mercredi 9 avril 2014

Activer ssl / tls DOVECOT ubuntu 8.04 IMAPS

Dovecot SSL Configuration

To configure dovecot to use SSL, you can edit the file /etc/dovecot/dovecot.conf and amend following lines:

ssl_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
ssl_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
ssl_disable = no
disable_plaintext_auth = no


Si on génère des certificats selon la méthode ci-dessous, alors remplacer ssl-cert-snakeoil.pem ssl-cert-snakeoil.key par les server.crt server.key

Generating a Certificate Signing Request (CSR)

Whether you are getting a certificate from a CA or generating your own self-signed certificate, the first step is to generate a key.

If the certificate will be used by service daemons, such as Apache, Postfix, Dovecot, etc, a key without a passphrase is often appropriate. Not having a passphrase allows the services to start without manual intervention, usually the preferred way to start a daemon.

This section will cover generating a key with a passphrase, and one without. The non-passphrase key will then be used to generate a certificate that can be used with various service daemons.

[Warning]

Running your secure service without a passphrase is convenient because you will not need to enter the passphrase every time you start your secure service. But it is insecure and a compromise of the key means a compromise of the server as well.

To generate the keys for the Certificate Signing Request (CSR) run the following command from a terminal prompt:

openssl genrsa -des3 -out server.key 1024

%%%

Generating RSA private key,

1024 bit long modulus .....................++++++ .................++++++

unable to write 'random state' e is 65537 (0x10001)

Enter pass phrase for server.key:

You can now enter your passphrase. For best security, it should at least contain eight characters. The minimum length when specifying -des3 is four characters. It should include numbers and/or punctuation and not be a word in a dictionary. Also remember that your passphrase is case-sensitive.

Re-type the passphrase to verify. Once you have re-typed it correctly, the server key is generated and stored in theserver.key file.

Now create the insecure key, the one without a passphrase, and shuffle the key names:

openssl rsa -in server.key -out server.key.insecure

mv server.key server.key.secure

mv server.key.insecure server.key

The insecure key is now named server.key, and you can use this file to generate the CSR without passphrase.

To create the CSR, run the following command at a terminal prompt:

openssl req -new -key server.key -out server.csr

It will prompt you enter the passphrase. If you enter the correct passphrase, it will prompt you to enter Company Name, Site Name, Email Id, etc. Once you enter all these details, your CSR will be created and it will be stored in the server.csr file.

You can now submit this CSR file to a CA for processing. The CA will use this CSR file and issue the certificate. On the other hand, you can create self-signed certificate using this CSR.

Creating a Self-Signed Certificate

To create the self-signed certificate, run the following command at a terminal prompt:

openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

The above command will prompt you to enter the passphrase. Once you enter the correct passphrase, your certificate will be created and it will be stored in the server.crt file.

[Warning]

If your secure server is to be used in a production environment, you probably need a CA-signed certificate. It is not recommended to use self-signed certificate.

Installing the Certificate

You can install the key file server.key and certificate file server.crt, or the certificate file issued by your CA, by running following commands at a terminal prompt:

sudo cp server.crt /etc/ssl/certs

sudo cp server.key /etc/ssl/private

Now simply configure any applications, with the ability to use public-key cryptography, to use the certificate and key files. For example, Apache can provide HTTPS, Dovecot can provide IMAPS and POP3S, etc.



Si l'on veut un certificat qui dure plus longtemps que 365 jours simplement indiquer le nombre de jours voulus dans l'option -days