diff --git a/.gitignore b/.gitignore index 2ec5a83..be4c981 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,363 @@ -__pycache__ -.idea -output +output/ + +# Created by https://www.toptal.com/developers/gitignore/api/linux,windows,macos,direnv,vim,python,pycharm+all +# Edit at https://www.toptal.com/developers/gitignore?templates=linux,windows,macos,direnv,vim,python,pycharm+all + +### direnv ### +.direnv +.envrc + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### PyCharm+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### PyCharm+all Patch ### +# Ignore everything but code style settings and run configurations +# that are supposed to be shared within teams. + +.idea/* + +!.idea/codeStyles +!.idea/runConfigurations + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +### Python Patch ### +# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration +poetry.toml + +# ruff +.ruff_cache/ + +# LSP config files +pyrightconfig.json + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/linux,windows,macos,direnv,vim,python,pycharm+all diff --git a/Makefile b/Makefile index 95c2f8e..24293cf 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PY?=python3 +PY?= PELICAN?=pelican PELICANOPTS= @@ -8,6 +8,11 @@ OUTPUTDIR=$(BASEDIR)/output CONFFILE=$(BASEDIR)/pelicanconf.py PUBLISHCONF=$(BASEDIR)/publishconf.py +SSH_HOST=kaede +SSH_PORT=10022 +SSH_USER=xengi +SSH_TARGET_DIR=/srv/www/www.xengi.de + DEBUG ?= 0 ifeq ($(DEBUG), 1) @@ -39,6 +44,9 @@ help: @echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 ' @echo ' make devserver [PORT=8000] serve and regenerate together ' @echo ' make devserver-global regenerate and serve on 0.0.0.0 ' + @echo ' make ssh_upload upload the web site via SSH ' + @echo ' make sftp_upload upload the web site via SFTP ' + @echo ' make rsync_upload upload the web site via rsync+ssh ' @echo ' ' @echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html ' @echo 'Set the RELATIVE variable to 1 to enable relative urls ' @@ -63,10 +71,19 @@ devserver: "$(PELICAN)" -lr "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) devserver-global: - $(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -b 0.0.0.0 + "$(PELICAN)" -lr "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) -b 0.0.0.0 publish: "$(PELICAN)" "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(PUBLISHCONF)" $(PELICANOPTS) +ssh_upload: publish + scp -P $(SSH_PORT) -r "$(OUTPUTDIR)"/* "$(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)" -.PHONY: html help clean regenerate serve serve-global devserver publish +sftp_upload: publish + printf 'put -r $(OUTPUTDIR)/*' | sftp $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) + +rsync_upload: publish + rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --include tags --cvs-exclude --delete "$(OUTPUTDIR)"/ "$(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)" + + +.PHONY: html help clean regenerate serve serve-global devserver devserver-global publish ssh_upload sftp_upload rsync_upload diff --git a/content/images/avatar.png b/content/images/avatar.png deleted file mode 100644 index a41a5de..0000000 Binary files a/content/images/avatar.png and /dev/null differ diff --git a/content/images/profile.png b/content/images/profile.png new file mode 100644 index 0000000..9b78cce Binary files /dev/null and b/content/images/profile.png differ diff --git a/content/linux/pokeshell.md b/content/linux/pokeshell.md index 9959191..269c1bd 100644 --- a/content/linux/pokeshell.md +++ b/content/linux/pokeshell.md @@ -1,7 +1,7 @@ title: Pokéshell date: 2016-01-01 23:30 category: linux -tags: pokemon, shell, bash, fish, imagemagick +tags: pokemon, shell, bash, fish, imagemagick, aur slug: pokeshell A friend of me had the idea of a shell displaying a random pokémon on launch. I liked the idea and couldn't resist to implement it over christmas. @@ -10,7 +10,7 @@ A friend of me had the idea of a shell displaying a random pokémon on launch. I What the package does is, it downloads all pokémon images in a defined range which is 1-151 by default (I'm old these are the ones I know) and converts the images to escape sequences. These are saved in `/usr/share/pokeshell`. -Now when you ipopen a new shell you could display one of them randomly by putting this code in your `~/.bashrc`: +Now when you open a new shell you could display one of them randomly by putting this code in your `~/.bashrc`: ```sh cat /usr/share/pokeshell/\$((\$RANDOM % 151 + 1)).pokemon @@ -27,7 +27,7 @@ end The images are downloaded using the [Pokéapi][pokeapi]. For the conversation I use Imagemagick and a tool called [img2xterm][img2xterm]. -You can find the package in the [AUR][aur-pokeshell]. +You can find a package for all of this in the [AUR][aur-pokeshell]. [pokeapi]: http://pokeapi.co diff --git a/pelicanconf.py b/pelicanconf.py index a71d851..8b0397a 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -1,140 +1,111 @@ -from datetime import datetime - AUTHOR = 'XenGi' -SITEURL = '' SITENAME = 'XenGis blog' -SITETITLE = 'XenGi' -SITESUBTITLE = '' -SITEDESCRIPTION = 'A typical way to world domination' -SITELOGO = SITEURL + '/images/avatar.png' -FAVICON = SITEURL + '/images/favicon.ico' -BROWSER_COLOR = '#333' -ROBOTS = 'index, follow' -CC_LICENSE = { - 'name': 'Creative Commons Attribution-ShareAlike', - 'version': '4.0', - 'slug': 'by-sa', - 'icon': True, - 'language': 'en_US', -} -COPYRIGHT_NAME = AUTHOR -COPYRIGHT_YEAR = datetime.now().year -STATIC_PATHS = [ - 'extra/custom.css' -] -EXTRA_PATH_METADATA = { - 'extra/custom.css': {'path': 'static/custom.css'}, -} -CUSTOM_CSS = 'static/custom.css' -MAIN_MENU = True -PLUGINS = [ - 'post_stats', -] -PLUGIN_PATHS = [ - 'plugins/' -] -JINJA_ENVIRONMENT = {} -I18N_TEMPLATES_LANG = 'en' -DEFAULT_LANG = 'en' -OG_LOCALE = 'en_US' -LOCALE = 'en_US' -THEME = 'flex' -OUTPUT_PATH = 'output/' -PATH = 'content/' +SITEURL = "" +PATH = "content" TIMEZONE = 'Europe/Berlin' +DEFAULT_LANG = 'en' + # 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 -USE_FOLDER_AS_CATEGORY = False + +# Blogroll +LINKS = ( + ("Noisy Cricket", "https://gitlab.com/noisy_cricket"), + ("mkbd65", "https://gitlab.com/mkbd65"), +) + # Social widget -MENUITEMS = [] -SOCIAL = [ - ('Email', 'mailto:blog@xengi.de'), -] -MENUITEMS = [ - ('Archives', '/archives.html'), - ('Categories', '/categories.html'), - ('Tags', '/tags.html'), -] -STATIC_PATHS = [ - 'images', -] -DEFAULT_PAGINATION = False -USE_GOOGLE_FONTS = True +SOCIAL = ( + ("gitlab", "https://gitlab.com/XenGi"), + ("github", "https://github.com/XenGi"), + ("mastodon", "https://chaos.social/@xengi"), + ("matrix", "https://matrix.to/#/@xengi:xengi.de"), +) + +DEFAULT_PAGINATION = 10 # Uncomment following line if you want document-relative URLs when developing -#RELATIVE_URLS = True +# RELATIVE_URLS = True -DEFAULT_CATEGORY = 'misc' +THEME = "flex" +PYGMENTS_STYLE = "monokai" + +DEFAULT_CATEGORY = "misc" DISPLAY_PAGES_ON_MENU = True DISPLAY_CATEGORIES_ON_MENU = True + MARKDOWN = { - 'extension_configs': { - 'markdown.extensions.codehilite': {'css_class': 'highlight'}, - 'markdown.extensions.extra': {}, - 'markdown.extensions.meta': {}, - 'markdown.extensions.nl2br': {}, - 'markdown.extensions.smarty': {}, - 'markdown.extensions.sane_lists': {}, + "extension_configs": { + "markdown.extensions.codehilite": {"css_class": "highlight"}, + "markdown.extensions.extra": {}, + "markdown.extensions.meta": {}, + "markdown.extensions.nl2br": {}, + "markdown.extensions.smarty": {}, + "markdown.extensions.sane_lists": {}, }, - 'output_format': 'xhtml5', + "output_format": "html5", } PAGE_PATHS = ['pages'] STATIC_PATHS = ['images'] TYPOGRIFY = True -ARTICLE_URL = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/' -ARTICLE_SAVE_AS = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/index.html' -PAGE_URL = 'pages/{slug}/' -PAGE_SAVE_AS = 'pages/{slug}/index.html' -AUTHOR_URL = 'author/{slug}.html' -AUTHOR_SAVE_AS = 'author/{slug}.html' -CATEGORY_URL = 'category/{slug}.html' -CATEGORY_SAVE_AS = 'category/{slug}.html' -TAG_URL = 'tag/{slug}.html' -TAG_SAVE_AS = 'tag/{slug}.html' -# Flex settings - -USE_LESS = True - -## dark mode +# Flex theme +## metadata for
+SITEDESCRIPTION = "XenGis blog" THEME_COLOR = 'dark' THEME_COLOR_AUTO_DETECT_BROWSER_PREFERENCE = True THEME_COLOR_ENABLE_USER_OVERRIDE = True ## code highlight - PYGMENTS_STYLE = 'emacs' PYGMENTS_STYLE_DARK = 'monokai' -#PYGMENTS_STYLE = 'solarized-light' -#PYGMENTS_STYLE_DARK = 'solarized-dark' -# Plugin settings +## top menu +MENUITEMS = ( + # Home + ("Archives", "/archives.html"), + ("Categories", "/categories.html"), + ("Tags", "/tags.html"), +) -## related posts +SITETITLE = "XenGis blog" +SITESUBTITLE = "☠️ Hacker™️ | 🏍️ Petrol head | 🚀 Tech fondler" +SITELOGO = SITEURL + "/images/profile.png" +FAVICON = SITEURL + "/images/favicon.ico" -RELATED_POSTS_MAX = 10 +BROWSER_COLOR = "#333" +ROBOTS = "index, follow" -## sitemap - -SITEMAP = { - 'format': 'xml', - 'priorities': { - 'articles': 0.5, - 'indexes': 0.5, - 'pages': 0.5 - }, - 'changefreqs': { - 'articles': 'monthly', - 'indexes': 'daily', - 'pages': 'monthly' - } +CC_LICENSE = { + "name": "Creative Commons Attribution-NonCommercial 4.0 International", + "version": "4.0", + "slug": "by-nc", + "icon": True, + "language": "en_US" } +from datetime import datetime +COPYRIGHT_YEAR = datetime.now().year +#blog by XenGi is licensed under CC BY-NC 4.0