Skip to content

Instantly share code, notes, and snippets.

View julian-klode's full-sized avatar

Julian Andres Klode julian-klode

View GitHub Profile
Origin: Ubuntu
Label: Ubuntu
Suite: hirsute
Version: 21.04
Codename: hirsute
Date: Thu, 04 Feb 2021 9:47:45 UTC
Architectures: amd64 arm64 armhf i386 ppc64el riscv64 s390x
Components: main restricted universe multiverse
Description: Ubuntu Hirsute 21.04
MD5Sum:
@julian-klode
julian-klode / liberal-pinning.md
Last active March 19, 2021 13:52
APT solver questions

Given packages a and b with versions 1,2,3 (higher is more preferred), and a dependency A|B giving preference to A, how would you expect a dependency a|b to expand?

  1. A over B within each preference level:
    a (= 3) | b (= 3) | a (= 2) | b (= 2) | a (= 1) | b (= 1)
    
  2. any A over any B:
    a (= 3) | a (= 2) | a (= 1) | b (= 3) | b (= 2) | b (= 1)
    
#!/usr/bin/python3
#
# Copyright (C) 2020-2021 Julian Andres Klode <[email protected]>
#
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at
# https://mozilla.org/MPL/2.0/.
#
"""HR plotting script.
#!/usr/bin/python3
#
# Copyright (C) 2020-2021 Julian Andres Klode <[email protected]>
#
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at
# https://mozilla.org/MPL/2.0/.
#
"""HR plotting script.
#!/usr/bin/python3
#
# Copyright (C) 2020-2021 Julian Andres Klode <[email protected]>
#
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at
# https://mozilla.org/MPL/2.0/.
#
"""HR plotting script.
#!/usr/bin/python3
#
# Copyright (C) 2020-2021 Julian Andres Klode <[email protected]>
#
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at
# https://mozilla.org/MPL/2.0/.
#
"""HR plotting script.
Dpkg::Post-Invoke:: "grep -q Vaapi /opt/google/chrome/google-chrome || sed -i 's#^exec.*HERE.*/chrome.*#\0 --enable-features=VaapiVideoDecoder#' /opt/google/chrome/google-chrome";
#!/bin/sh
. /etc/os-release
case "$DISTRO" in
*:*)
ID=$(echo $DISTRO | cut -f1 -d:)
VERSION_CODENAME=$(echo $DISTRO | cut -f2 -d:)
;;
@julian-klode
julian-klode / a.hs
Last active September 9, 2021 07:08
import Control.Monad
main = do topic <- getLine
payload <- getLine
let msg = Message (Topic topic) payload
mapM_ (runAction topic payload) rules
where
runAction topic payload (Action (Topic t) cb)
= when (t == topic) $ cb payload
/*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* Copyright (C) 2021 Julian Andres Klode <[email protected]>
*
* Some portions included below are taken from the dummy apt solver, and hence
* share its copyright owners.
*
*/