commit 4f8531d6343ace6463b8830af1a7f47dc89db85d Author: Fabrice Mouhartem Date: Mon Apr 22 17:05:20 2019 +0530 First commit: draft of the blog diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..923ae3f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +output +__pycache__ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..627fdb0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "themes/clean-blog"] + path = themes/clean-blog + url = git@github.com:gilsondev/pelican-clean-blog.git diff --git a/content/chs-git.md b/content/chs-git.md new file mode 100644 index 0000000..153e399 --- /dev/null +++ b/content/chs-git.md @@ -0,0 +1,16 @@ +--- +title: Some git tricks +date: 2019-04-22 +category: Cheat Sheets +--- + +Some git tricks I use from time to time and that I forgot everytime… + +Reset `master` to `origin/master`: +```sh +git co origin/master -B master +``` + +Another useful trick is `git commit -v`, it allows reviewing your changes before committing. + +![Example](/examples/git-cv.svg) diff --git a/content/examples/git-cv.svg b/content/examples/git-cv.svg new file mode 100644 index 0000000..2682015 --- /dev/null +++ b/content/examples/git-cv.svg @@ -0,0 +1,44 @@ + + + + + + + + + + $ $ g $ gi $ git $ git $ git c $ git co $ git com $ git comm $ git commi $ git commit $ git commit $ git commit - $ git commit -v [fmouhart@Pasiphae test] $ git commit -v suggestion : en attente de la fermeture du fichier par votre éditeur de texte… 1 1 23 +This is my new project!.git/COMMIT_EDITMSG 1,0-1 Tout 22 + 23 +This is my new project!.git/COMMIT_EDITMSG 23,1 Toutk 21 +# New project 22 +.git/COMMIT_EDITMSG 22,1 Tout 21 +# New project 20 @@ -0,0 +1,3 @@.git/COMMIT_EDITMSG 21,1 Toutk 20 @@ -0,0 +1,3 @@.git/COMMIT_EDITMSG 20,1 Toutj V-- VISUEL LIGNE --1-- VISUEL LIGNE --G-- VISUEL LIGNE --3-- VISUEL LIGNE --^[ k 19 +++ b/readme.md 19 +++ b/readme.md 18 --- /dev/null.git/COMMIT_EDITMSG 19,1 Tout 18 --- /dev/null g .git/COMMIT_EDITMSG 18,1 Tout gg i .git/COMMIT_EDITMSG 1,1 Tout 1 T 1 T .git/COMMIT_EDITMSG [+] 1,2 Tout 1 Th .git/COMMIT_EDITMSG [+] 1,3 Tout 1 Thi .git/COMMIT_EDITMSG [+] 1,4 Tout 1 This .git/COMMIT_EDITMSG [+] 1,5 Tout 1 This .git/COMMIT_EDITMSG [+] 1,6 Tout 1 This i .git/COMMIT_EDITMSG [+] 1,7 Tout 1 This is .git/COMMIT_EDITMSG [+] 1,8 Tout 1 This is .git/COMMIT_EDITMSG [+] 1,9 Tout 1 This is m .git/COMMIT_EDITMSG [+] 1,10 Tout 1 This is my .git/COMMIT_EDITMSG [+] 1,11 Tout 1 This is my .git/COMMIT_EDITMSG [+] 1,12 Tout 1 This is my f .git/COMMIT_EDITMSG [+] 1,13 Tout 1 This is my f .git/COMMIT_EDITMSG [+] 1,13 Tout 1 This is my fi .git/COMMIT_EDITMSG [+] 1,14 Tout 1 This is my fir .git/COMMIT_EDITMSG [+] 1,15 Tout 1 This is my firs .git/COMMIT_EDITMSG [+] 1,16 Tout 1 This is my first .git/COMMIT_EDITMSG [+] 1,17 Tout 1 This is my first .git/COMMIT_EDITMSG [+] 1,18 Tout 1 This is my first c .git/COMMIT_EDITMSG [+] 1,19 Tout 1 This is my first co .git/COMMIT_EDITMSG [+] 1,20 Tout 1 This is my first com .git/COMMIT_EDITMSG [+] 1,21 Tout 1 This is my first comm .git/COMMIT_EDITMSG [+] 1,22 Tout 1 This is my first comm .git/COMMIT_EDITMSG [+] 1,22 Tout 1 This is my first commi .git/COMMIT_EDITMSG [+] 1,23 Tout 1 This is my first commi 1 This is my first commit .git/COMMIT_EDITMSG [+] 1,24 Tout-- INSERTION -- 1 This is my first commit! .git/COMMIT_EDITMSG [+] 1,25 Tout Z 1 This is my first commit! ZZ".git/COMMIT_EDITMSG"23L, 608C écrit(s) ".git/COMMIT_EDITMSG"23L, 608C écrit(s) 2 # Veuillez saisir le message de validation pour vos modifications. Les lignes 3 # commençant par '#' seront ignorées, et un message vide abandonne la validation. 4 # 5 # Sur la branche master 6 # 7 # Validation initiale 8 # 9 # Modifications qui seront validées : 10 # nouveau fichier : readme.md 11 # 12 # ------------------------ >8 ------------------------ 13 # Ne touchez pas à la ligne ci-dessus. 14 # Tout ce qui suit sera éliminé. 15 diff --git a/readme.md b/readme.md 16 new file mode 100644 17 index 0000000..d4fa514~ 1 This is my first commit! [master (commit racine) 173514d] This is my first commit! 1 file changed, 3 insertions(+) create mode 100644 readme.md$ + \ No newline at end of file diff --git a/content/images/cover_home.jpg b/content/images/cover_home.jpg new file mode 100644 index 0000000..8ffa518 Binary files /dev/null and b/content/images/cover_home.jpg differ diff --git a/content/pages/index.md b/content/pages/index.md new file mode 100644 index 0000000..bf414de --- /dev/null +++ b/content/pages/index.md @@ -0,0 +1,9 @@ +--- +title: Welcome +date: 2019-04-22 +author: Fabrice Mouhartem +URL: +save_as: index.html +--- + +Welcome to this _blog_, which aims at relieving my brain from the hard task of remembering all sort of weird stuff. I hope it'll help some of you as well. diff --git a/develop_server.sh b/develop_server.sh new file mode 100755 index 0000000..4721d64 --- /dev/null +++ b/develop_server.sh @@ -0,0 +1,103 @@ +#!/usr/bin/env bash +## +# This section should match your Makefile +## +PY=${PY:-python3} +PELICAN=${PELICAN:-pelican} +PELICANOPTS= + +BASEDIR=$(pwd) +INPUTDIR=$BASEDIR/content +OUTPUTDIR=$BASEDIR/output +CONFFILE=$BASEDIR/pelicanconf.py + +### +# Don't change stuff below here unless you are sure +### + +SRV_PID=$BASEDIR/srv.pid +PELICAN_PID=$BASEDIR/pelican.pid + +function usage(){ + echo "usage: $0 (stop) (start) (restart) [port]" + echo "This starts Pelican in debug and reload mode and then launches" + echo "an HTTP server to help site development. It doesn't read" + echo "your Pelican settings, so if you edit any paths in your Makefile" + echo "you will need to edit your settings as well." + exit 3 +} + +function alive() { + kill -0 $1 >/dev/null 2>&1 +} + +function shut_down(){ + PID=$(cat $SRV_PID) + if [[ $? -eq 0 ]]; then + if alive $PID; then + echo "Stopping HTTP server" + kill $PID + else + echo "Stale PID, deleting" + fi + rm $SRV_PID + else + echo "HTTP server PIDFile not found" + fi + + PID=$(cat $PELICAN_PID) + if [[ $? -eq 0 ]]; then + if alive $PID; then + echo "Killing Pelican" + kill $PID + else + echo "Stale PID, deleting" + fi + rm $PELICAN_PID + else + echo "Pelican PIDFile not found" + fi +} + +function start_up(){ + local port=$1 + echo "Starting up Pelican and HTTP server" + shift + $PELICAN --debug --autoreload -r $INPUTDIR -o $OUTPUTDIR -s $CONFFILE $PELICANOPTS & + pelican_pid=$! + echo $pelican_pid > $PELICAN_PID + mkdir -p $OUTPUTDIR && cd $OUTPUTDIR + $PY -m pelican.server $port & + srv_pid=$! + echo $srv_pid > $SRV_PID + cd $BASEDIR + sleep 1 + if ! alive $pelican_pid ; then + echo "Pelican didn't start. Is the Pelican package installed?" + return 1 + elif ! alive $srv_pid ; then + echo "The HTTP server didn't start. Is there another service using port" $port "?" + return 1 + fi + echo 'Pelican and HTTP server processes now running in background.' +} + +### +# MAIN +### +[[ ($# -eq 0) || ($# -gt 2) ]] && usage +port='' +[[ $# -eq 2 ]] && port=$2 + +if [[ $1 == "stop" ]]; then + shut_down +elif [[ $1 == "restart" ]]; then + shut_down + start_up $port +elif [[ $1 == "start" ]]; then + if ! start_up $port; then + shut_down + fi +else + usage +fi diff --git a/pelicanconf.py b/pelicanconf.py new file mode 100644 index 0000000..2736113 --- /dev/null +++ b/pelicanconf.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- # +from __future__ import unicode_literals + +AUTHOR = 'Fabrice Mouhartem' +SITENAME = 'Fabrice Mouhartem' +SITEURL = '' + +# Theme +THEME = "themes/clean-blog" +HEADER_COVER='images/cover_home.jpg' +HEADER_COLOR='black' +COLOR_SCHEME_CSS = 'monokai.css' +DISPLAY_PAGES_ON_MENU = False +DISPLAY_CATEGORIES_ON_MENU = True + +PATH = 'content' +STATIC_PATHS = ['images', 'examples'] + +TIMEZONE = 'Europe/Paris' + +DEFAULT_LANG = 'en' +DEFAULT_DATE_FORMAT = '%Y.%m.%d' + +# Feed generation is usually not desired when developing +FEED_ALL_ATOM = None +CATEGORY_FEED_ATOM = None +TRANSLATION_FEED_ATOM = None +AUTHOR_FEED_ATOM = None +AUTHOR_FEED_RSS = None + +# 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', '#'),) + +# Social widget +SOCIAL = () + +DEFAULT_PAGINATION = 10 + +# Uncomment following line if you want document-relative URLs when developing +#RELATIVE_URLS = True diff --git a/publishconf.py b/publishconf.py new file mode 100644 index 0000000..379788d --- /dev/null +++ b/publishconf.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- # +from __future__ import unicode_literals + +# This file is only used if you use `make publish` or +# explicitly specify it as your config file. + +import os +import sys +sys.path.append(os.curdir) +from pelicanconf import * + +SITEURL = 'https://blog.epheme.re' +RELATIVE_URLS = False + +FEED_ALL_ATOM = 'feeds/all.atom.xml' +CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml' + +DELETE_OUTPUT_DIRECTORY = True + +# Following items are often useful when publishing + +#DISQUS_SITENAME = "" +#GOOGLE_ANALYTICS = "" diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..9f29f5c --- /dev/null +++ b/readme.md @@ -0,0 +1 @@ + diff --git a/themes/clean-blog b/themes/clean-blog new file mode 160000 index 0000000..70d2f30 --- /dev/null +++ b/themes/clean-blog @@ -0,0 +1 @@ +Subproject commit 70d2f308c04d5017ac2326b0ae4d4180419eeb4e