Skip to content

Instantly share code, notes, and snippets.

View AntonFriberg's full-sized avatar
🕹️
Automating database migrations

Anton Friberg AntonFriberg

🕹️
Automating database migrations
  • Axis Communications
  • Lund, Sweden
  • 06:57 (UTC +02:00)
  • LinkedIn in/antonfriberg
View GitHub Profile
@AntonFriberg
AntonFriberg / ssht.fish
Created March 5, 2024 13:04
Fish function for transferring terminfo to remote server over ssh
function ssht
# Set the remote server's address
set remote_server $argv[1]
# Export the terminal info to a temporary file
set tmp_file (mktemp)
infocmp >$tmp_file
# Transfer the terminfo file to the remote server
scp $tmp_file $remote_server:/tmp/
@AntonFriberg
AntonFriberg / create_event_from_email.gs
Created July 14, 2023 15:24
Create Event from Booking Email using Google App Scripts
// What to add to the parsed ISO date to get it in correct timezone
TZ_POSTFIX = 'T00:00:00+02:00';
// Email subjects to look at
SUBJECT_NEW_BOOKING = 'New Booking - Some Service';
// Matches '2023-07-14 00:00 - 2023-07-14 00:00' like strings with groups for each date
DATE_RANGE_PATTERN = new RegExp('(\\d{4}-\\d{2}-\\d{2}) 00:00 - (\\d{4}-\\d{2}-\\d{2}) 00:00');
// Regex patterns to extract other content such as name, apartment, email
NAME_PATTERN = new RegExp('<td>Name:<\\/td>[\\n\\s]+<td>(.*)<\\/td>');
APARTMENT_PATTERN = new RegExp('<td>Apartment:<\\/td>[\\n\\s]+<td>(.*)<\\/td>');
EMAIL_PATTERN = new RegExp('<td>Email:<\\/td>[\\n\\s]+<td>(.*)<\\/td>');
@AntonFriberg
AntonFriberg / README.md
Last active April 3, 2024 03:42
Multiple Python Installations on Linux Using Mise-en-Place (an asdf rust clone)

Multiple Python Installations on Linux Using Mise

Note: Mise was previously called RTX

I have tried a lot different ways of managing multiple Python versions on different Linux systems.

  • pyenv
    • Uses shims which is confusing, especially for new users
  • Compiling from source
@AntonFriberg
AntonFriberg / README.md
Last active January 14, 2022 11:33
Access parquet files from S3 using ClickHouse

Parquet files from s3 using ClickHouse

Accessing the prompt

Start the clickhouse-client and connect it to your ClickHouse Server.

$ clickhouse-client --host=<host> --port=<port> --user=<user> --password=<password>

You should be greated by the ClickHouse prompt

ClickHouse client version 21.12.3.32 (official build).
@AntonFriberg
AntonFriberg / README.md
Created June 9, 2021 15:52
Configuring user class on DHCP client Ubuntu 20.04

Todo: Add background info

@AntonFriberg
AntonFriberg / install-swerty-altgr-working.md
Last active October 17, 2023 15:39
Swerty Keyboard Layout with working Alt-Gr on Linux Debian 10

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 / install.md
Last active April 1, 2021 13:07
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
AntonFriberg / fonts.conf
Created May 28, 2020 17:00
Fix ugly Calibri, Cambria font rendering on Linux
<!-- 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 09:21
Emoji Test String

😀 😃 😄 😁 😆 😅 🤣 😂 🙂 🙃

@AntonFriberg
AntonFriberg / arch-linux-install.md
Last active May 13, 2020 11:22 — 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