Skip to content

Instantly share code, notes, and snippets.


Anton Friberg AntonFriberg

  • Lund University, Axis Communications
  • Malmö, Sweden
View GitHub Profile
AntonFriberg /
Last active Jan 19, 2021
Swerty Keyboard Layout with working Alt-Gr on Linux Debian 10


The Swerty keyboard layout is created by Johan E. Gustafsson and hosted on

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.


AntonFriberg /
Last active Apr 1, 2021
Samsung ML-2160 printer install on Arch Linux

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 / 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>
AntonFriberg /
Last active May 22, 2020
Emoji Test String

😀 😃 😄 😁 😆 😅 🤣 😂 🙂 🙃

AntonFriberg /
Last active May 13, 2020 — forked from kylemanna/
Minimal instructions for installing arch linux on an UEFI NVMe system with full system encryption using dm-crypt and luks
AntonFriberg / pyproject.after.toml
Last active Apr 7, 2020
bug report pyproject.toml
View pyproject.after.toml
name = "application"
version = "1.0"
description = "An application."
authors = ["Anton Friberg <>"]
readme = ""
# Allow default command line entrypoint
etl = "etl.__main__:cli"
AntonFriberg /
Created Mar 11, 2020 — forked from JonasAlfredsson/
Make Cinnamon/Gnome respect the /etc/X11/xorg.conf file instead of ~/.config/displays.xml

Make Cinnamon/Gnome/Mate Respect xorg.conf

By default the Cinnamon/Gnome/Mate desktop environment loads its own display configuration from the file ~/.config/monitors.xml instead of using the settings defined in /etc/X11/xorg.conf. This can be a little bit annoying if you are using the nvidia-settings program to configure your displays (which will use xorg.conf), since anything entered there will be overridden by monitors.xml every reboot.

By doing the following changes we will disable the "Display Manager" in

AntonFriberg /
Created Dec 4, 2019
S3 partition extraction in Python
import re
regex = r"(year|month|day|hour)=(\d+)"
test_str = "s3://bucket/datalake/year=2019/month=12/day=02/hour=06"
matches = re.finditer(regex, test_str)
partition = { int( for match in matches}
# {'year': 2019, 'month': 12, 'day': 2, 'hour': 6}
AntonFriberg /
Last active Dec 26, 2020
Extract key value pairs from string with quotes in Python 3
"""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 / about:config
Created May 10, 2019
Fix Firefox right-click menu with i3 Window Manager
View about:config