Skip to content

Instantly share code, notes, and snippets.

@then4p
then4p / yoga_pro_setup.md
Last active April 20, 2024 09:42
Setup steps for Linux on Lenovo 82Y8 Yoga Pro 7 14APH8

Moved here: https://github.com/then4p/yoga-pro-7-14APH8-linux

Linux on the Lenovo 82Y8 Yoga Pro 7 14APH8 (Gen8) with Ryzen 7 7840HS and Nvidia GTX 4050

Finding a distro

Manjaro was the first distro that worked out of the box with the GPU and prime. Tried KDE Neon and EndeavourOS before but both had issues with GPU/Prime. I installed Manjaro with the proprietary GPU drivers and can run applications with prime-run x now.

Additional setup steps on Manjaro

@then4p
then4p / setup.md
Created May 21, 2023 18:02
lightweight python setup

Installing Poetry globally to use like npm in different repos on Linux

  1. Install Pyenv
  2. Install Poetry in system python version (might break if this version changes, just reinstall)
  3. before running poetry in a repo with a pyproject.toml, make sure you selected a fitting python version. Either run pyenv shell <python version> or pyenv local <python version> with a pyenv python version that fits your repo's requirements
  4. If you don't want to select a fitting python version manually, enable the shims for each version to be found globally by running pyenv global <python version>
@then4p
then4p / open_github_action_run.sh
Created April 5, 2023 13:12
Open the newest github action run for the current repo
function gh_action() {
repo=$(basename `git rev-parse --show-toplevel`)
run_id=$(gh api /repos/otto-ec/turing_$repo/actions/runs | jq -r '.workflow_runs[0].id')
gh run view $run_id -w
exit 0
}
@then4p
then4p / EurKey qwertz
Created April 5, 2023 09:37
EurKey layout by Steffen Bruentjen but for US qwertz keyboards
// Based on <http://eurkey.steffen.bruentjen.eu/>
// Copyright 2012 Steffen Bruentjen (eurkey (at) steffen dot bruentjen dot de)
default partial alphanumeric_keys modifier_keys
xkb_symbols "basic" {
name[Group1] = "EurKEY (US)";
key <TLDE> { [ grave, asciitilde, dead_grave, dead_tilde ] };
key <AE01> { [ 1, exclam, exclamdown, onesuperior ] };
[tool.poetry]
name = "src"
version = "0.0.1"
description = ""
authors = ["Your Name <you@example.com>"]
[tool.poetry.dependencies]
python = "~3.9"
numpy = "*"
pandas="*"
# add root to beginning of file
sed '1 i <root>' -i head.xml
# add /root to end of file
sed -i -e "\$a</root>" head.xml
# TODO try lxml
import xml.etree.ElementTree as ET
with open("head.xml", "rb") as f: