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 | |
| """nanweb — mini web local para generar imágenes con la API de NaN (flux-2-klein). | |
| Sin dependencias: solo la librería estándar de Python 3. | |
| La API key va en el servidor (este proceso), nunca en el navegador. | |
| Uso: | |
| export NAN_API_KEY=sk-tu-key-aqui | |
| python3 nanweb.py | |
| # abre solo http://localhost:8765 (Ctrl+C para parar) |
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 bash | |
| FILE=/tmp/batenergy.dat | |
| ADP=(/sys/class/power_supply/A*) | |
| BAT=(/sys/class/power_supply/BAT*) | |
| USER="edu" | |
| USERID=$(id -u ${USER}) | |
| [[ -e $BAT ]] || exit |
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
| ioreg -l -d 1 -w 0 | grep "kCGSSessionSecureInputPID" | awk -F'"kCGSSessionSecureInputPID"=' '{split($2,a,","); print a[1]}' | xargs -I {} ps -p {} -o comm= |
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 bash | |
| # Based on | |
| # https://wiki.archlinux.org/title/Hyprland#Keyboard_backlight_notifications | |
| # Save it as ~/.config/hypr/scripts/kbbacklight | |
| # Then used the following bindings | |
| # bindeld = , code:238, Keyboard brightness up, exec, ~/.config/hypr/scripts/kbbacklight --inc | |
| # bindeld = , code:237, Keyboard brightness down, exec, ~/.config/hypr/scripts/kbbacklight --dec | |
| iDIR="$HOME/.config/mako/icons" |
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
| --- | |
| apiVersion: helm.cattle.io/v1 | |
| kind: HelmChart | |
| metadata: | |
| namespace: kube-system | |
| name: longhorn-crd | |
| spec: | |
| targetNamespace: longhorn-system | |
| createNamespace: true | |
| version: 105.1.0+up1.7.2 |
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 | |
| set -euo pipefail | |
| list="rancher-images.txt" | |
| source_registry="" | |
| usage() { | |
| echo "USAGE: $0 [--image-list rancher-images.txt]" | |
| echo " [-s|--source-registry] source registry to pull images from in registry:port format." | |
| echo " [-l|--image-list path] text file with list of images; one image per line." | |
| echo " [-h|--help] Usage message" |
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
| podman run -it --rm registry.opensuse.org/opensuse/leap:latest /bin/bash -c $' | |
| word="example" | |
| script_content=$(cat "/proc/$$/cmdline" | xargs -0) | |
| count=$(echo "$script_content" | grep -ow "$word" -c) | |
| echo "${count}" | |
| ' |
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 | |
| IMAGE="registry.opensuse.org/opensuse/busybox" | |
| OS="linux" | |
| ARCH="amd64" | |
| PLATFORM="${OS}/${ARCH}" | |
| LATEST=$(crane digest ${IMAGE}:latest --platform ${PLATFORM}) |
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
| --- | |
| apiVersion: v1 | |
| kind: Namespace | |
| metadata: | |
| name: metallb-system | |
| spec: {} | |
| --- | |
| apiVersion: v1 | |
| kind: Namespace | |
| metadata: |
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
| getvmip(){ | |
| for vm in $(virsh list --name); do echo "${vm} $(virsh --connect qemu:///system domifaddr ${vm} | awk '/ipv4/ NF>1{print $NF}' | cut -d/ -f1)"; done | |
| } |
NewerOlder