<commit_before>% Installation tips of the developer environment
================================================

Terminal keys and colors
========================

If you use PuTTY/MobaXterm/... on Windows to access your Linux VM, add in your `~/.bashrc` in order to use the [Numeric keypad](https://en.wikipedia.org/wiki/Numeric_keypad).

    export TERM=linux
    
Else you use a fast and recent X11 client (i.e. not Windows)

    export TERM=xterm-256color

    
Become a sudoer
===============

    su  # enter root password
    visudo

Append in the bottom

    yourlogin ALL=(ALL) NOPASSWD:ALL

or if you prefer having to enter your password:

    yourlogin ALL=(ALL) ALL


Install packages
================

    gcc-c++ git cmake boost-devel zlib-devel gtest-devel
    lcov gcovr           # Source-code coverage
    openssl-devel        # Often required by app dependencies
    clang                # Run static analyzer, formatter...
    ccache               # Reduce build time
    samba                # Access remote files from Windows
    doxygen graphviz     # Generate source-code doc
    bash-completion      # Optional
    man-pages            # man pages for kernel/glibc/...
    man-pages-fr         # Si pas comprendre Anglais
    gedit-plugins        # Display special characters with gedit


Enabling multicast reception
============================

If your machine uses the `firewalld` (you can verify with `firewall-cmd --state`),
you need to allow the multicast IPs:

    firewall-cmd --direct --add-rule ipv4 filter IN_public_allow 1 -d <ip> -j ACCEPT
    
`<ip>` is something like 172.16.31.10.



Access VM files from Windows
============================

1. Install Samba `yum install samba`
2. Enable samba in firewall `firewall-cmd --add-service=samba`
3. Add your user to the samba users database `pdbedit -a -u yourlogin` (and enter password)
4. Enable shared folder access `chcon -Rt samba_share_t /home/user/public` (Do not share folder where your `.ssh` or other sensitive data is accessible)
5. Run Samba deamon `service smb start`
6. Check if your Windows machine can access your VM share using `telnet <your-VM-hostname> 139` (if it connects the route is OK)
7. Ensure Samba deamon is well launched with `service smb status`

You can access to your remote folder from Windows using `\\<hostname>`  
(Attention: the hostname printed by the commande `hostname` may be different from the `hostname` used by your Windows machine to access it)


Synchronize Password
====================

Linux-based VMs are not always configured to be automatically synchronised with LDAP server.
In order to have samba access from Windows to the Linux VM,
use the command `pdbedit` to enter the same password as the Windows one. <commit_msg>Update chapter Access remote files from Windows<commit_after>% Installation tips of the developer environment
================================================

Terminal keys and colors
========================

If you use PuTTY/MobaXterm/... on Windows to access your Linux VM, add in your `~/.bashrc` in order to use the [Numeric keypad](https://en.wikipedia.org/wiki/Numeric_keypad).

    export TERM=linux
    
Else you use a fast and recent X11 client (i.e. not Windows)

    export TERM=xterm-256color

    
Become a sudoer
===============

    su  # enter root password
    visudo

Append in the bottom

    yourlogin ALL=(ALL) NOPASSWD:ALL

or if you prefer having to enter your password:

    yourlogin ALL=(ALL) ALL


Install packages
================

    gcc-c++ git cmake boost-devel zlib-devel gtest-devel
    lcov gcovr           # Source-code coverage
    openssl-devel        # Often required by app dependencies
    clang                # Run static analyzer, formatter...
    ccache               # Reduce build time
    samba                # Access remote files from Windows
    doxygen graphviz     # Generate source-code doc
    bash-completion      # Optional
    man-pages            # man pages for kernel/glibc/...
    man-pages-fr         # Si pas comprendre Anglais
    gedit-plugins        # Display special characters with gedit


Enabling multicast reception
============================

If your machine uses the `firewalld` (you can verify with `firewall-cmd --state`),
you need to allow the multicast IPs:

    firewall-cmd --direct --add-rule ipv4 filter IN_public_allow 1 -d <ip> -j ACCEPT
    
`<ip>` is something like 172.16.31.10.



Access your remote files from your Windows desktop
==================================================

On remote GNU/Linux server

    # Install samba
    sudo apt install samba
    sudo dnf install samba

    # Ensure firewall allows service samba
    service firewalld status
    firewall-cmd --add-service=samba

    # Add you to the samba users database
    sudo pdbedit -a -u yourlogin # then enter password

    # Decide the folder(s) to shared
    # Do not share folder where your .ssh or other sensitive data is accessible
    chcon -Rt samba_share_t /home/user/public 
    
    # Run Samba deamon
    sudo service smb start
    service smb status

On Windows desktop:

* Check if you can access to your remote shared folder using `telnet <your-VM-hostname> 139` (if it connects the route is OK)  
  If you do not have `telnet` see if you can use [PowerShell](http://stackoverflow.com/a/35624189/938111)
* Access to your remote folder using `\\<hostname>`  
  (Attention: the hostname printed on remote machine by the commande `hostname` may be different from the `hostname` used from your Windows machine to access it)


Synchronize Password
====================

Linux-based VMs are not always configured to be automatically synchronised with LDAP server.
In order to have samba access from Windows to the Linux VM,
use the command `pdbedit` to enter the same password as the Windows one. 
{'fraction_non_alphanumeric': 0.12322193658954585, 'fraction_numerical': 0.01011139674378749, 'mean_word_length': 3.1775232641374376, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5782647', 'n_tokens_mistral': 1683, 'n_tokens_neox': 1555, 'n_words': 702}