Pelican Blog Quickstart with Docker

Prerequisites We need to have at least Docker installed. Creating the Blog First we’re creating a new directory for our blog and generate the blog structure using William Jackon’s docker-pelican: mkdir my-site cd my-site docker container run -it --rm --entrypoint pelican-quickstart -v ${PWD}:/pelican-site ghcr.io/williamjacksn/pelican Welcome to pelican-quickstart v4.9.1. This script will help you create a new Pelican-based website. Please answer the following questions so this script can generate the files 1 Title: My First Review needed by Pelican. > Where do you want to create your new web site? [.] > What will be the title of this web site? Micha's Tech Notes > Who will be the author of this web site? Micha Kops > What will be the default language of this web site? [C] > Do you want to specify a URL prefix? e.g., https://example.com (Y/n) Y > What is your URL prefix? (see above example; no trailing slash) https > Do you want to enable article pagination? (Y/n) n > What is your time zone? [Europe/Rome] > Do you want to generate a tasks.py/Makefile to automate generation and publishing? (Y/n) > Do you want to upload your website using FTP? (y/N) > Do you want to upload your website using SSH? (y/N) > Do you want to upload your website using Dropbox? (y/N) > Do you want to upload your website using S3? (y/N) > Do you want to upload your website using Rackspace Cloud Files? (y/N) > Do you want to upload your website using GitHub Pages? (y/N) Done. Your new project is available at /pelican-site ...

September 10, 2024 · 3 min · 529 words · Micha Kops

Python Data Science Snippets

This article needs update! Jupyter Installation pip in venv mkdir newdir && cd newdir python -m venv .venv (1) source .venv/bin/activate (2) pip install jupyter numpy pandas sqlalchemy (3) pip freeze > requirements.txt (4) python -m jupyter lab (5) deactivate (6) 1 create a new virtual environment 2 activate the environment 3 install several libraries into the activated environment 4 create a list with all dependencies install for sharing or reinstallation later 5 start jupyter 6 having finished we might want to exit the virtual environment ...

July 8, 2020 · 2 min · 244 words · Micha Kops

Creating Pre-Commit-Hooks in Git and Mercurial: Prefix Commit Messages for Feature/Story Branches

Managing my projects’ source code I am using Git also as Mercurial. Therefore I often encounter the situation where I am creating a special branch to implement a specific user story or feature request. Now when working on such a story branch I often enter the issue-key or a short title as a prefix for each commit message. Doing this by manually is a waste of time and error-prone and luckily for us, each of both DVCS offers us an easy API to add custom hooks to the different life-cycle events. ...

December 16, 2012 · 4 min · 784 words · Micha Kops

Python Snippets

Virtual Environments Create and activate a venv python -m venv /path/to/new-env (1) source /path/to/new-env/bin/activate (2) 1 Creates a new virtual environment 2 Activate the new virtual environment Deactivate venv deactivate Save used dependencies to a file pip freeze > dependencies.txt Install dependencies from file pip install -r dependencies.txt Storing and fetching Credentials from the System Keyring I am using jaraco/keyring here: pip install keyring import keyring keyring.set_password("system", "db.sample.password", "xoxo") print(keyring.get_password("system", "db.sample.password")) ...

March 1, 2010 · 1 min · 100 words · Micha Kops