Utilisation de git

Débuter avec git

L’environnement utiliser est de type UNIX (Linux) et doit fonctionner sur Mac OS X.
Toutes les commandes sont présentée pour une Debian (9.1/stretch)

Installation de git

depuis le shell : sudo apt-get update; sudo apt-get install git
Je ne donne pas plus d’informations a ce point.

notions de base

Commandes utiles

Compter le nombre de commits par utilisateur
git shortlog -sne


Compter le nombre de ligne par utilisateur pour un type de fichier
git ls-tree -r HEAD|cut -f 2|grep -E ‘\.(java|xml)$’ | xargs -n1 git blame –line porcelain|grep « author « |sort|uniq -c|sort -nr
    
A changer java|xml par ce qui correspond et ‘Author’ par le nom d’utilisateur des commits

Récupérer un fichier dans la dernière version commitée sans vos potentiel changements.
git checkout <myfile>
    
Avant toute modification il faut mettre a jour le repository:
git pull --rebase

   
Travailler sur des fichiers puis les envoyer sur le serveur git:
git add <file>
git commit | git commit -m "<Commentaire>"
git review | git push


Si c’est une correction ou un changement sur un fichier deja commit:
git add <file>
git commit --amend


A ce point verifier le commit id mais normalement il suffit de le sauvegarder
Si besoin:
git rebase master | git rebase -i master
git review

Remove a git commit which has not pushed
If you have NOT pushed your changes to remote:
git reset HEAD~1

Else you have pushed your changes to remote:
git revert HEAD
or
git reset --hard origin/master

Documentation et guide

Pas a pas en partant de 0 par exercices de 3 ou 4 commandes (EN):
http://gitimmersion.com/index.html

Vidéos et Tutos a tester (FR):
https://www.grafikart.fr/formations/git

Guide complet sur git (FR):
https://git-scm.com/book/fr/v1/D%C3%A9marrage-rapide

Git : Apprendre à utiliser le gestionnaire de versions
Git: Apprendre à utiliser le gestionnaire de versions

VIM as IDE

* Installation of vim

Use vundle for the package of vim: https://github.com/VundleVim/Vundle.vim
Don’t forget to add the promptline plugin: https://github.com/edkolev/promptline.vim
Add in the .vimrc this section:
    Plugin Plugin ‘edkolev/promptline.vim’

* Configuration
Base dot-net configuration from: https://github.com/amacgregor/dot-files
Idea of what it is: https://coderoncode.com/tools/2017/04/16/vim-the-perfect-ide.html

For Python configuration and tools:
https://www.fullstackpython.com/vim.html

Add git status on vim:

Fancy promptline with git status details

* Issue with on Mac OS X

There are two ctags known as GNU ctags and exuberant-ctags, what the tagbar need to use is exuberant-ctags. exuberant-ctags need to be installed by yourself.

What I do to solve this problem is
    brew install ctags-exuberant
and find it’s installed in /usr/local/Cellar/ctags/5.8_1
then I add a line in .vimrc:
    let g:Tlist_Ctags_Cmd=’/usr/local/Cellar/ctags/5.8_1/bin/ctags’

URLs and links to read later….

Liens et site de documentations / news a suivre

Technical
* Napalm:
http://blog.ipspace.net/2015/06/napalm-integrating-ansible-with-network.html

* Python/Napalm for network:
https://pynet.twb-tech.com/blog/automation/napalm-ios.html

* Tools & Automation
https://www.mirantis.com/blog/virtlet-vms-containers-opencontrail-network-kubernetes-nfv/

* Facebook tools: FBNet-Command-Runner: A thrift service to run commands on heterogeneous Network devices with configurable parameters: 

https://github.com/facebookincubator/FCR#device-vendors 
The presentation: https://code.facebook.com/posts/117615485632126/fcr-open-source-command-runner-for-network-devices-/


* DDOS with memcached:
https://www.wired.com/story/github-ddos-memcached/amp?__twitter_impression=true

* AI with Google:
https://www.lesnumeriques.com/vie-du-net/google-lance-plateforme-pour-enseigner-machine-learning-ia-n72051.html

https://www.albatorssx.com/index.php?menu=multimedia&page=objetderive

* Tools for dev
[vim editor – fonctions avancees](https://www.plpeeters.com/blog/fr/post/24-vim-fonctions-avancees)
[From gitlab an Infrastructur handbook](https://about.gitlab.com/handbook/infrastructure/)

* IoT / Domotic
New soft for domotic: (demo) http://iobroker.click/ + doc http://www.iobroker.net/docu/?lang=en
OpenHardware devices and howtos: https://www.mysensors.org/


# Social
* Working & related stuff
https://korben.info/teletravail.html  
https://korben.info/n-guide-materiel-teletravail.html

* Networking & Social net
[MP #198 : Réussir sa photo de profil pour les réseaux sociaux et sites de rencontres](https://phototrend.fr/2017/04/mercredi-pratique-reussir-photo-profil-enflammer-applis-sites-rencontres/)

[Mes petites astuces Instagram](https://santadenn.com/petites-astuces-instagram/)

https://www.grafikart.fr/tutoriels?page=2

https://yeuxdelibad.net/Blog/

https://solar-management.fr/nos-articles/

# Photos
* Photos

1. https://www.lebonbon.fr/nuit/
2. https://mariegphotography.exposure.co/
3. http://marielaganeva.com/new-gallery/gvltla0hobfstoab6fdmr714flkwby

* Videos

Paris in Video:
<iframe allowfullscreen= » » frameborder= »0″ height= »295″ mozallowfullscreen= » » src= »https://player.vimeo.com/video/226419760″ title= »Paris. » webkitallowfullscreen= » » width= »525″></iframe>

Google Authenticator VS Authy:
[Authy vs. Google Authenticator](https://authy.com/blog/authy-vs-google-authenticator/)
<iframe allowfullscreen= » » frameborder= »0″ height= »295″ mozallowfullscreen= » » src= »https://authy.com/blog/authy-vs-google-authenticator/embed/#?secret=cLlSVT6Zen » title= »Authy vs. Google Authenticator » webkitallowfullscreen= » » width= »525″></iframe>


# Not checked
* Technical
Dev/Net visialisation tools in python for BGP: https://basimaly.wordpress.com/2017/07/03/bgp-visualization-using-python/
dotfiles management: http://sametmax.com/regrouper-ses-fichiers-de-settings-avec-stow/

* Blogs
http://www.brendangregg.com/overview.html

* Photos

* dev
https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django
Check code in git searching for password and other bad stuff: https://github.com/zricethezav/gitleaks
Liste of django apps: https://gitlab.com/rosarior/awesome-django

* Docker / VM / Sec
VPN L2TP/IPSEC:
http://harrylee.me/2016/06/25/Docker-Create-your-own-IPsec-L2TP-VPN-container/
https://wiki.strongswan.org/projects/strongswan/wiki/InstallationDocumentation
https://vincent.bernat.im/en/blog/2017-route-based-vpn

Password / vault managment: https://www.vaultproject.io/intro/getting-started/first-secret.html

* Other
https://mitmproxy.org/
https://www.justwatch.com/gopass/docs/  
https://github.com/justwatchcom/gopass
https://deadc0de.re/articles/dotfiles.html
https://docs.docker.com/compose/django/
http://www.mairie15.paris.fr/actualites/balades-a-velo-rail-sur-la-petite-ceinture-351
[832 TB – ZFS on Linux – Project “Cheap and Deep”: Part 1](http://www.jonkensy.com/832-tb-zfs-on-linux-project-cheap-and-deep-part-1/)

Story of someone at criteo: https://www.criteo.com/insights/meet-andreea-dicu-criteos-global-director-people-culture-brand/?utm_source=Social&utm_medium=Twitter&utm_campaign=Blog

—————

To check:

https://www.albatorssx.com/index.php?menu=multimedia&page=objetderive

https://korben.info/teletravail.html  
https://korben.info/n-guide-materiel-teletravail.html

[MP #198 : Réussir sa photo de profil pour les réseaux sociaux et sites de rencontres](https://phototrend.fr/2017/04/mercredi-pratique-reussir-photo-profil-enflammer-applis-sites-rencontres/)

<iframe class= »wp-embedded-content » data-secret= »HjfZuDvvrv » frameborder= »0″ height= »296″ marginheight= »0″ marginwidth= »0″ sandbox= »allow-scripts » scrolling= »no » security= »restricted » src= »https://phototrend.fr/2017/04/mercredi-pratique-reussir-photo-profil-enflammer-applis-sites-rencontres/embed/#?secret=HjfZuDvvrv » style= »position: absolute; clip: rect(1px, 1px, 1px, 1px); » title= »« MP #198 : Réussir sa photo de profil pour les réseaux sociaux et sites de rencontres » — Phototrend.fr » width= »525″></iframe>

 https://www.grafikart.fr/tutoriels?page=2

> [Git : Apprendre à utiliser le gestionnaire de versions](http://borntocode.fr/git-tutoriel-et-configuration-sur-le-gestionnaire-de-versions/)

<iframe class= »wp-embedded-content » data-secret= »2n6dRGttNM » frameborder= »0″ height= »296″ marginheight= »0″ marginwidth= »0″ sandbox= »allow-scripts » scrolling= »no » security= »restricted » src= »http://borntocode.fr/git-tutoriel-et-configuration-sur-le-gestionnaire-de-versions/embed/#?secret=2n6dRGttNM » style= »position: absolute; clip: rect(1px, 1px, 1px, 1px); » title= »« Git : Apprendre à utiliser le gestionnaire de versions » — Born to Code: la programmation par l’exemple » width= »525″></iframe>

 https://www.plpeeters.com/blog/fr/post/24-vim-fonctions-avancees

 https://yeuxdelibad.net/Blog/

 https://solar-management.fr/nos-articles/

> [Mes petites astuces Instagram](https://santadenn.com/petites-astuces-instagram/)

<iframe class= »wp-embedded-content » data-secret= »yjp6qcwU0Y » frameborder= »0″ height= »296″ marginheight= »0″ marginwidth= »0″ sandbox= »allow-scripts » scrolling= »no » security= »restricted » src= »https://santadenn.com/petites-astuces-instagram/embed/#?secret=yjp6qcwU0Y » style= »position: absolute; clip: rect(1px, 1px, 1px, 1px); » title= »« Mes petites astuces Instagram » — Santadenn » width= »525″></iframe>

> [Authy vs. Google Authenticator](https://authy.com/blog/authy-vs-google-authenticator/)

<iframe class= »wp-embedded-content » data-secret= »cLlSVT6Zen » frameborder= »0″ height= »296″ marginheight= »0″ marginwidth= »0″ sandbox= »allow-scripts » scrolling= »no » security= »restricted » src= »https://authy.com/blog/authy-vs-google-authenticator/embed/#?secret=cLlSVT6Zen » style= »position: absolute; clip: rect(1px, 1px, 1px, 1px); » title= »“Authy vs. Google Authenticator” — Authy » width= »525″></iframe>

 https://mitmproxy.org/

 

 https://www.justwatch.com/gopass/docs/  
 https://github.com/justwatchcom/gopass

 

 https://deadc0de.re/articles/dotfiles.html

 https://docs.docker.com/compose/django/

 https://www.mirantis.com/blog/virtlet-vms-containers-opencontrail-network-kubernetes-nfv/

<iframe allowfullscreen= » » frameborder= »0″ height= »295″ mozallowfullscreen= » » src= »https://player.vimeo.com/video/226419760″ title= »Paris. » webkitallowfullscreen= » » width= »525″></iframe>

 

 http://www.mairie15.paris.fr/actualites/balades-a-velo-rail-sur-la-petite-ceinture-351

 https://www.lebonbon.fr/nuit/

 https://mariegphotography.exposure.co/

 http://marielaganeva.com/new-gallery/gvltla0hobfstoab6fdmr714flkwby

> [832 TB – ZFS on Linux – Project “Cheap and Deep”: Part 1](http://www.jonkensy.com/832-tb-zfs-on-linux-project-cheap-and-deep-part-1/)

<iframe class= »wp-embedded-content » data-secret= »JxOAVbIJMl » frameborder= »0″ height= »296″ marginheight= »0″ marginwidth= »0″ sandbox= »allow-scripts » scrolling= »no » security= »restricted » src= »http://www.jonkensy.com/832-tb-zfs-on-linux-project-cheap-and-deep-part-1/embed/#?secret=JxOAVbIJMl » style= »position: absolute; clip: rect(1px, 1px, 1px, 1px); » title= »“832 TB – ZFS on Linux – Project “Cheap and Deep”: Part 1” — JonKensy.com » width= »525″></iframe>