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
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/ |
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:
nmcli con add \ | |
type wifi \ | |
con-name "eduroam" | |
ifname "wlp4s0" \ # Your wifi interface | |
ssid "eduroam" \ | |
wifi-sec.key-mgmt "wpa-eap" \ | |
802-1x.identity "<YOUR-STUDENT-ID>@lu.se" \ # May also use another university identification | |
802-1x.password "<YOUR-PASSWORD" \ | |
802-1x.system-ca-certs "yes" \ | |
802-1x.domain-suffix-match "radius.lu.se" \ |
"""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. |
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.
<!-- 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> |
// 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>'); |
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 |
#!/bin/bash | |
APP1=https://google.com | |
APP1NAME=Google | |
APP2=https://bing.com | |
APP2NAME=Bing | |
# Set correct display to launch the windows over ssh connection | |
export DISPLAY=:0 | |
# Fixes autologin errors under gnome |