Skip to content

Instantly share code, notes, and snippets.

Avatar

Anton Friberg AntonFriberg

  • Lund University, Axis Communications
  • Malmö, Sweden
View GitHub Profile
@AntonFriberg
AntonFriberg / Dockerfile
Last active Apr 9, 2021
Simple docker cron sidecar container based on alpine image
View Dockerfile
FROM alpine:3.8
# Alpine comes with built in cron schedules
# min hour day month weekday command
# */15 * * * * run-parts /etc/periodic/15min
# 0 * * * * run-parts /etc/periodic/hourly
# 0 2 * * * run-parts /etc/periodic/daily
# 0 3 * * 6 run-parts /etc/periodic/weekly
# 0 5 1 * * run-parts /etc/periodic/monthly
@AntonFriberg
AntonFriberg / install.md
Last active Apr 1, 2021
Samsung ML-2160 printer install on Arch Linux
View install.md

How to install Samsung ML-2160 in Arch Linux

In order to use a USB connected Sasmung ML-2160 printer in Arch Linux you will need to first install the correct drivers. For this perticular printer the drivers are included in the samsung-unified-printer AUR package.

If you know what you are doing I recommend installing it using a AUR helper such as yay.

@AntonFriberg
AntonFriberg / about:config
Created May 10, 2019
Fix Firefox right-click menu with i3 Window Manager
View about:config
ui.context_menus.after_mouseup=true
@AntonFriberg
AntonFriberg / install-swerty-altgr-working.md
Last active Jan 19, 2021
Swerty Keyboard Layout with working Alt-Gr on Linux Debian 10
View install-swerty-altgr-working.md

Background

The Swerty keyboard layout is created by Johan E. Gustafsson and hosted on http://johanegustafsson.net/projects/swerty/

Swerty is released under the MIT Licence.

Since I spend a lot of time getting the right alt-gr key to work I decided to share back my fixes.

Installation

@AntonFriberg
AntonFriberg / parse_key_value_pairs.py
Last active Dec 26, 2020
Extract key value pairs from string with quotes in Python 3
View parse_key_value_pairs.py
"""Extract key value pairs in Python 3 using shlex and regex."""
import re
import shlex
def regex_kv_pairs(text, item_sep=r"\s", value_sep="="):
"""
Parse key-value pairs from a shell-like text with regex.
This approach is ~ 25 times faster than the shlex approach.
@AntonFriberg
AntonFriberg / fonts.conf
Created May 28, 2020
Fix ugly Calibri, Cambria font rendering on Linux
View fonts.conf
<!-- Add this to your font configuration e.g ~/.config/fontconfig/fonts.conf -->
<!-- Note that this will disable all embedded bitmaps in fonts that use them -->
<!-- disable embedded bitmaps in fonts to fix Calibri, Cambria, etc. -->
<match target="font">
<edit mode="assign" name="embeddedbitmap"><bool>false</bool></edit>
</match>
@AntonFriberg
AntonFriberg / emoji.md
Last active May 22, 2020
Emoji Test String
View emoji.md

😀 😃 😄 😁 😆 😅 🤣 😂 🙂 🙃

@AntonFriberg
AntonFriberg / arch-linux-install.md
Last active May 13, 2020 — forked from kylemanna/arch-linux-install.md
Minimal instructions for installing arch linux on an UEFI NVMe system with full system encryption using dm-crypt and luks
View arch-linux-install.md
@AntonFriberg
AntonFriberg / pyproject.after.toml
Last active Apr 7, 2020
bug report pyproject.toml
View pyproject.after.toml
[tool.poetry]
name = "application"
version = "1.0"
description = "An application."
authors = ["Anton Friberg <anton.friberg@example.com>"]
readme = "README.md"
[tool.poetry.scripts]
# Allow default command line entrypoint https://stackoverflow.com/a/55065934
etl = "etl.__main__:cli"
@AntonFriberg
AntonFriberg / asian_characters.md
Last active Mar 18, 2020
Asian Characters ArchLinux
View asian_characters.md

In order to get Asian Characters to render properly on ArchLinux you need to install a font which supports them. Even if you cannot read any of the characters I find it useful to have them installed to get wikipedia articles on geographical locations to render properly.

In order to cover most of Asia I installed the following fonts:

  • adobe-source-han-serif-cn-fonts
  • adobe-source-han-serif-jp-fonts
  • adobe-source-han-serif-kr-fonts