This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before configuration, consumption is ~ 20 Watts | |
Configuration, install the Tlp software: | |
sudo apt instal tlp | |
then create (or edit by addind the line echo line), the /etc/rc.local file: | |
#!/bin/sh -e | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DevoXX Paris 2024 Labs | |
====================== | |
By MATTHIAS HAEUSSLER - https://twitter.com/@maeddes | |
"This lab is made for developers seeking a pragmatic understanding of OpenTelemetry's immediate benefits. | |
Walk away with practical skills that can be implemented right away in your projects, and elevate your | |
observability game in just 180 minutes." | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /sys/class/drm/card0/device/pp_od_clk_voltage | |
cat /sys/kernel/debug/dri/0/amdgpu_pm_info | |
cat /sys/class/drm/card0/device/gpu_busy_percent | |
cat /sys/class/drm/card0/device/pp_dpm_sclk | |
cat /sys/class/drm/card0/device/hwmon/hwmon*/temp1_input | |
cat /sys/class/drm/card0/device/pp_dpm_mclk | |
cat /sys/class/drm/card0/device/mem_info_vram_used | |
cat /sys/class/drm/card0/device/mem_info_vram_total |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Plug your external keyboard and enter the following command line to get the vendor/product id: | |
# lsusb | |
Bus 002 Device 065: ID 05ac:024f Apple, Inc. Aluminium Keyboard (ANSI) | |
For example, my Keychron keyboard is detected as an Apple keyboard with vendorid=05ac and productid=024f | |
Create the following scripts: | |
# sudo vi /etc/udev/rules.d/10-keyboard-plug.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Demonstrate PodmanClient.""" | |
import podman | |
# Provide a URI path for the libpod service. In libpod, the URI can be a unix | |
# domain socket(UDS) or TCP. The TCP connection has not been implemented in this | |
# package yet. | |
uri = "unix:///run/user/1000/podman/podman.sock" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install minikube | |
$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 | |
$ chmod +x minikube | |
$ sudo install minikube /usr/local/bin/ | |
Get the minikube version | |
$ minikube version | |
minikube version: v1.20.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prosody is available as a Docker image (https://github.com/prosody/prosody-docker) | |
Pull it: | |
docker pull prosody/prosody | |
and start it (https://github.com/prosody/prosody-docker): | |
docker run -d -p 5280:5280 -e LOCAL=nicolargo -e DOMAIN=nicolargo.com -e PASSWORD=mdp prosody/prosody:latest | |
44e501c0e6454b6b5c316fe49b1506486b14a1ccd7566363811a7d0c094ec572 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This file is part of Glances. | |
# | |
# SPDX-FileCopyrightText: 2024 Nicolas Hennion <[email protected]> | |
# | |
# SPDX-License-Identifier: LGPL-3.0-only | |
# | |
"""Foo plugin (based on diskIO plugin).""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
POWER_SUPPLY_PATH = "/sys/class/power_supply" | |
_DEFAULT = object() | |
def open_binary(fname, **kwargs): | |
return open(fname, "rb", **kwargs) | |
def cat(fname, fallback=_DEFAULT, binary=True): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
import subprocess | |
import os | |
def foo(c): | |
fnull = open(os.devnull, 'w') | |
d1 = datetime.now() | |
subprocess.check_call(c, stdout=fnull, stderr=fnull, close_fds=True) | |
return (datetime.now() - d1).total_seconds() |
NewerOlder