This file contains hidden or 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
#! /bin/bash | |
# A Pacemaker resource agent that runs LXC containers using Ceph as a storage | |
# backend. | |
# Place in /usr/lib/ocf/resource.d/custom to use with your Pacemaker | |
# installation | |
LXC="/var/lib/lxc" | |
# Init OCF |
This file contains hidden or 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
app-id: org.openhantek.OpenHantek | |
runtime: org.kde.Platform | |
runtime-version: "5.15" | |
sdk: org.kde.Sdk | |
command: OpenHantek | |
finish-args: | |
- --socket=wayland | |
- --device=dri | |
rename-desktop-file: OpenHantek.desktop | |
rename-icon: OpenHantek |
This file contains hidden or 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
#! /bin/bash | |
BAT=$(echo /sys/class/power_supply/BAT*) | |
BAT_STATUS="$BAT/status" | |
BAT_CAP="$BAT/capacity" | |
LOW_BAT_PERCENT=20 | |
AC_PROFILE="performance" | |
BAT_PROFILE="balanced" | |
LOW_BAT_PROFILE="power-saver" |
This file contains hidden or 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
[Service] | |
Environment=STARTUP_WAIT=30s | |
ExecStart=/home/kobus/.local/bin/power_monitor.sh | |
[Install] | |
WantedBy=default.target |
This file contains hidden or 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 time | |
from functools import lru_cache, wraps | |
def ttl_cache(ttl=600): | |
def outer(func): | |
@lru_cache | |
def inner(*args, ttl, **kwargs): | |
return func(*args, **kwargs) | |
@wraps(func) |
This file contains hidden or 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 python3 | |
import json | |
import sys | |
import os | |
import mmap | |
from tqdm import tqdm | |
log = sys.argv[1] | |
step = 2 if len(sys.argv) <= 2 else int(sys.argv[2]) |
OlderNewer