diff --git a/.gitignore b/.gitignore index 6ba322c..4ce844a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ output __pycache__ Makefile *.pid +plugins diff --git a/content/cheat sheets/git-fr.md b/content/cheat sheets/git-fr.md new file mode 100644 index 0000000..c8ff565 --- /dev/null +++ b/content/cheat sheets/git-fr.md @@ -0,0 +1,57 @@ +--- +Title: Quelques astuces git +Date: 2019-04-22 17:00 +Modified: 2019-04-23 14:23 +Author: Fabrice +Category: cheat sheets +Tags: git, termtosvg +Slug: git-tricks +Header_Cover: ../images/covers/water.jpg +Summary: Une compilations de commandes git que j'utilise ponctuellement +Lang: fr +--- + +Quelques astuces [git](https://git-scm.com/) que j'utilise de temps en temps que j’oublie tout le temps… + +**Attention:** Je ne suis pas un exemple à suivre comme utilisateur de git, et mes manières sont parfois un peu crues. +Récemment, la majorité de mes commits sont dues à [pass](password-store.html), et donc la plupart du temps, je suis en train de réparer mes propres erreurs. + +Remettre la branche master `master` sur la branche distante `origin/master` : +```sh +git checkout origin/master -B master +``` + +Aller au commit précédent où on avait checkout (de manière similaire à `cd -`) : +```sh +git checkout - +``` + + +Retrouver les commits disparus, c'est très utile lorsqu'on est a envie de `cherry-pick` un commit orphelin qu'on a oublié il y a quelque temps : +```sh +git log --graph --reflog +``` +Quelques explications s’imposent : `--graph` montre l'arbre des commits, ce qui se montre utile pour révéler les feuilles orphelines, et `--reflog` mets au jour tous nos secrets les plus sordides. + +Vous avez peut-être remarqué que vos répertoires git prennent du volume. +Pour corriger ça, on peut manuellement appeler le ramasse-miette de notre dépôt. +C'est censé se faire tout seul, mais pas assez souvent selon mes standards. +```sh +git gc --aggressive +``` + +Pour ajouter un changement atomique dans un fichier (de manière interactive): +```sh +git add -p +``` + +Une autre astuce utile : `git commit -v`, qui permet de réviser nos changements avant de commiter. +Une image vaut mieux que mille mots : + +![Example](/examples/git-cv.svg) + +Une interface ncurses pour git : [tig](https://jonas.github.io/tig/) +```sh +tig +``` + diff --git a/content/cheat sheets/git.md b/content/cheat sheets/git.md index 9697e3f..d72f844 100644 --- a/content/cheat sheets/git.md +++ b/content/cheat sheets/git.md @@ -8,16 +8,22 @@ Tags: git, termtosvg Slug: git-tricks Header_Cover: images/covers/water.jpg Summary: A compilation of some `git` tricks I keep forgetting. +Lang: en --- Some [git](https://git-scm.com/) tricks I use from time to time and that I forgot everytime… **Disclaimer:** I'm not the perfect git user, and my way of using it is especially crude. -Recently, most of my git commits are due to [`pass`](/password-store.html), therefore most of those commands are here to fix my mistakes. +Recently, most of my git commits are due to [`pass`](/password-store.html), therefore most of those commands are here to fix my own mistakes. Reset `master` to `origin/master`: ```sh -git co origin/master -B master +git checkout origin/master -B master +``` + +Jump back and forth from a commit to another (same behaviour as : +```sh +git checkout - ``` Find back lost commits, especially useful when you are doing dirty things and want to `cherry-pick` an orphan commit (for instance): @@ -31,9 +37,9 @@ If you noticed that your folder grows, you can manually cast the garbage collect git gc --aggressive ``` -To commit a small part of the file (in an interactive way): +To add changes in an atomic fashion on a file (in an interactive way): ```sh -git commit -p +git add -p ``` Another useful trick is `git commit -v`, it allows reviewing your changes before committing. @@ -44,3 +50,6 @@ A ncurse-based interface for git: [tig](https://jonas.github.io/tig/) ```sh tig ``` + + diff --git a/content/pages/disclaimers-fr.md b/content/pages/disclaimers-fr.md new file mode 100644 index 0000000..43bdc40 --- /dev/null +++ b/content/pages/disclaimers-fr.md @@ -0,0 +1,29 @@ +--- +title: Mentions légales +date: 2019-04-23 +author: Fabrice Mouhartem +Header_Cover: ../images/covers/flowers.jpg +slug: disclaimers +Lang: fr +--- + +Ceci est un blog **personnel** écrit par Fabrice Mouhartem. +Les opinions exprimées ici ne représentent *que mon avis, et ne reflètent en rien celui de mes employeurs passés et actuels*, et n'expriment pas mon engagement professionnel sauf mention contraire. +Mes informations professionnelles sont disponibles sur [fmouhart.epheme.re](https://fmouhart.epheme.re/index-fr.html). + +Les [images de couverture](/images/covers/) sont toutes issues de mon travail personnel et sont distribuées sous licences *creative commons* [CC-BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). + +Aucune garantie quelle qu'elle soit ne peut être donnée sur la correction et la justesse du contenu proposé sur ce site. + +Toute requêtes concernant ce blog devra être envoyée par e-mail à l'adresse suivante : courriel. + +Ce site utilise des cookies de traçages à des fins statistiques (le moteur étant hébergé sur le même serveur). +Néanmoins, les désactiver (par le biais de votre butineur par exemple) n'altère en rien la fonctionnalité du site. +La patte graphique du site est due au thème [pelican-clean-blog](https://github.com/gilsondev/pelican-clean-blog/) qui repose sur +[bootstrap](https://getbootstrap.com/) (v.3.3.0), qui pourrait utiliser du javascript (qui est auto-hébergé). +Les polices chargées depuis un site tiers ont été désactivées, et toutes les communications sont chiffrées via SSL (TLS 1.2) à l'aide de [Let's Encrypt](https://letsencrypt.org/). + +Ce blog est hébergé par [Online SAS](https://www.online.net/), BP 438 − 75366 Paris CEDEX 08 − France. + + diff --git a/content/pages/disclaimers.md b/content/pages/disclaimers.md index f028e07..0e883f8 100644 --- a/content/pages/disclaimers.md +++ b/content/pages/disclaimers.md @@ -1,9 +1,10 @@ --- title: Disclaimers -date: 2019-04-22 +date: 2019-04-23 author: Fabrice Mouhartem Header_Cover: images/covers/flowers.jpg slug: disclaimers +Lang: en --- This is a **personal** blog edited by Fabrice Mouhartem. diff --git a/content/pages/index-fr.md b/content/pages/index-fr.md new file mode 100644 index 0000000..2ee909f --- /dev/null +++ b/content/pages/index-fr.md @@ -0,0 +1,23 @@ +--- +title: Bienvenue +date: 2019-04-22 +author: Fabrice Mouhartem +Header_Cover: ../images/covers/home.jpg +slug: home +save_as: ./index.html +URL: +og_image: ../images/miniature.png +article_list: true +Lang: fr +--- + +Bienvenue sur mon *blog*, je suis Fabrice Mouhartem. +Je vais présenter ici quelques astuces, trucs, et autres joyeusetés pour libérer mon cerveau de la lourde tâche de mémoriser toutes les astuces que je rencontres tous les jours et qui ne me servent que ponctuellement (ou pas). +J’espère que vous aussi vous pourriez les apprécier et en trouver un quelconque intérêt. +La plupart de ces astuces concerne mon usage quotidien de *linux*, mais pas que. + +Si vous vous êtes perdus sur les internets et cherchez ma page professionnelle, elle est disponible par là ---> [*](https://fmouhart.epheme.re/index-fr.html), où vous pouvez néanmoins retrouver la liste de mes +[activités annexes](https://fmouhart.epheme.re/pages/etc-fr.html) ainsi qu’une liste des [logiciels libres que j’utilise au jour le jour](https://fmouhart.epheme.re/pages/etc-fr.html#le-logiciel-libre). + +Pour toutes remarques ou commentaires, n’hésitez pas à me contacter par e-mail à l’adresse suivante : courriel. + diff --git a/content/pages/index.md b/content/pages/index.md index 4697583..45c4bfb 100644 --- a/content/pages/index.md +++ b/content/pages/index.md @@ -3,10 +3,12 @@ title: Welcome date: 2019-04-22 author: Fabrice Mouhartem Header_Cover: images/covers/home.jpg +slug: home URL: og_image: images/miniature.png save_as: index.html article_list: true +Lang: en --- I'm Fabrice Mouhartem, and I welcome you to this _blog_, which aims at relieving my brain from the hard task of remembering all sorts of weird stuffs (thus, don't expect me to provide you some fresh original contents). I hope it'll help some of you as well. diff --git a/content/software/pass.md b/content/software/pass.md index 3529855..24f2528 100644 --- a/content/software/pass.md +++ b/content/software/pass.md @@ -8,6 +8,7 @@ Tags: pass, git Slug: password-store Header_Cover: images/covers/clovers.jpg Summary: A simple password manager that relies on gpg, and synchronized with git. +Lang: en --- As security breaches are discovered regularly, and so leakage happens, it is recommended to have a different password on each account. diff --git a/content/tips/emails-md.md b/content/tips/emails-md.md index 2bf9693..e66b002 100644 --- a/content/tips/emails-md.md +++ b/content/tips/emails-md.md @@ -7,6 +7,7 @@ Tags: emails, pandoc, Vim Slug: vim-md-emails Header_Cover: images/covers/amsterdam.jpg Summary: An example of how to easily manipulate email templates in a markdown. +Lang: en --- If you are like me and you don't like to spend time using WYSIWYG tools to format your texts, you may be interested in this. diff --git a/content/tips/latex-adblock.md b/content/tips/latex-adblock.md index d2c3ebc..49f0f2e 100644 --- a/content/tips/latex-adblock.md +++ b/content/tips/latex-adblock.md @@ -3,6 +3,7 @@ Title: Block ads using LaTeX Date: 2019-04-23 09:00 Modified: 2019-04-23 14:23 Author: Fabrice +Lang: en Category: tips Tags: LaTeX, inkscape, ads, git Slug: latex-ad-block diff --git a/content/tips/latex-letterhead.md b/content/tips/latex-letterhead.md index a7fca7d..9f4a293 100644 --- a/content/tips/latex-letterhead.md +++ b/content/tips/latex-letterhead.md @@ -3,6 +3,7 @@ Title: Use any letterhead in LaTeX Date: 2019-04-22 20:00 Author: Fabrice Category: tips +Lang: en Tags: LaTeX Slug: latex-letterhead Header_Cover: images/covers/palace.jpg diff --git a/myfooter-fr.html b/myfooter-fr.html new file mode 100644 index 0000000..dd1b197 --- /dev/null +++ b/myfooter-fr.html @@ -0,0 +1,7 @@ + + diff --git a/pelicanconf.py b/pelicanconf.py index d01d053..88c871d 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import os AUTHOR = 'Fabrice Mouhartem' -SITENAME = 'fmouhart\'s blog' +SITENAME = 'fmouhart’s blog' SITEURL = '' # Theme @@ -14,12 +14,15 @@ COLOR_SCHEME_CSS = 'monokai.css' DISPLAY_PAGES_ON_MENU = False DISPLAY_CATEGORIES_ON_MENU = True FAVICON='images/lock.png' -JINJA_ENVIRONMENT = {'trim_blocks': True, 'lstrip_blocks': True, 'extensions' : ('jinja2.ext.loopcontrols',),} +JINJA_ENVIRONMENT = {'trim_blocks': True, 'lstrip_blocks': True, 'extensions' : ('jinja2.ext.loopcontrols','jinja2.ext.i18n',),} ## Footer FOOTER_INCLUDE = 'myfooter.html' IGNORE_FILES = [FOOTER_INCLUDE] THEME_TEMPLATES_OVERRIDES = [os.path.dirname(__file__)] -## Images + +# Plugins +PLUGIN_PATHS = ['./plugins/'] +PLUGINS = ['i18n_subsites'] # Static paths PATH = 'content' @@ -27,14 +30,15 @@ STATIC_PATHS = ['images', 'examples',] TIMEZONE = 'Europe/Paris' +#LANG DEFAULT_LANG = 'en' DEFAULT_DATE_FORMAT = '%Y.%m.%d' - -# Blogroll -LINKS = (('Pelican', 'http://getpelican.com/'), - ('Python.org', 'http://python.org/'), - ('Jinja2', 'http://jinja.pocoo.org/'), - ('You can modify those links in your config file', '#'),) +I18N_SUBSITES = { + 'fr': { + 'SITENAME': 'Le blog de fmouhart', + 'FOOTER_INCLUDE' : 'myfooter-fr.html', + } + } # Social widget SOCIAL = () diff --git a/themes/clean-blog b/themes/clean-blog index d24d07b..4627047 160000 --- a/themes/clean-blog +++ b/themes/clean-blog @@ -1 +1 @@ -Subproject commit d24d07bb072fae828fdc6115d5377a22a51c0906 +Subproject commit 46270470fcb754ddfeb1d5ab97a4e3caf5127f76