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
#!/bin/sh | |
# backup pull secret (for safety) | |
oc get secret/pull-secret -n openshift-config -oyaml > global-pull-secret.yaml | |
# disable insights | |
oc set data secret/pull-secret -n openshift-config \ | |
--from-file=.dockerconfigjson=<(oc extract secret/pull-secret -n openshift-config --to=- \ | |
| jq '.auths |= del(.["cloud.openshift.com"])') |
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
#!/bin/sh | |
adb shell pm path com.example.myapp | sed 's/^package://g' | xargs -L1 adb pull |
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
#!/bin/sh | |
docker system df -v --format json | jq -r '.Volumes[] | [.Size,.Name] | @tsv' | sort -h |
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
# GitLab user project export | |
# | |
# Install gitlab module: python3 -m pip install python-gitlab==3.15.0 | |
# | |
# Set environment variables GITLAB_URL and GITLAB_OAUTH_TOKEN (Personal Access Token): | |
# GITLAB_URL=https://gitlab.com GITLAB_OAUTH_TOKEN=changeme python3 gitlab-export.py | |
import gitlab | |
import time | |
import tarfile |
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
blueprint: | |
name: v2 Zigbee2MQTT, SLS - Aqara Wall Wireless Switch Double Key Edition (WXKG02LM_rev2) | |
actions | |
description: 'Define actions your Aqara Wall Wireless Switch Double Key Edition | |
using Zigbee2MQTT or SLS. For your button entity, choose the right sensor with | |
your button name and the entity id which ends with ''_action'', e.g. ''sensor.kitchen.button_action'' | |
' | |
domain: automation | |
input: |
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
blueprint: | |
name: Zigbee2MQTT - IKEA E1524/E1810 Tradfri Remote Control | |
description: Control anything using "IKEA E1524/E1810 Tradfri Remote Control" | |
domain: automation | |
input: | |
action_sensor: | |
name: Remote | |
description: Zigbee2MQTT action sensor | |
selector: | |
entity: |
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/python3 | |
import http.server | |
import socketserver | |
import logging | |
PORT=8000 | |
class ServerHandler(http.server.SimpleHTTPRequestHandler): |
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
# Route Backup | |
# | |
# Creates a script at C:\eth_routes.ps1 (or user Desktop) with `route add` statements to re-apply routing table entries of a specific interface. | |
# | |
# Useful for Windows Container usage like RKE and RKE2 Kubernetes, where HNS configuration wipes parts of the routing table. | |
# Related issue: https://projectcalico.docs.tigera.io/getting-started/windows-calico/troubleshoot#after-initializing-calico-for-windows-aws-metadata-server-is-no-longer-reachable | |
$ifname = "Ethernet" | |
$default_metric = 5 |
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
# Example to use Podman instead of containerd & nerdctl | |
# $ limactl start ./podman.yaml | |
# $ limactl shell podman podman run -it -v $HOME:$HOME --rm docker.io/library/alpine | |
# To run `podman` on the host (assumes podman-remote is installed): | |
# $ export CONTAINER_HOST=$(limactl list podman --format 'unix://{{.Dir}}/sock/podman.sock') | |
# $ podman --remote ... | |
# To run `docker` on the host (assumes docker-cli is installed): | |
# $ export DOCKER_HOST=$(limactl list podman --format 'unix://{{.Dir}}/sock/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
#!/bin/sh | |
NAMESPACE=default | |
SERVICE_ACCOUNT=mysa | |
# kubectl -n $NAMESPACE create sa $SERVICE_ACCOUNT | |
kubectl -n $NAMESPACE get secret `kubectl -n $NAMESPACE get serviceaccount $SERVICE_ACCOUNT -ojsonpath="{.secrets[0].name}"` -ojsonpath="{.data.token}" | base64 -d | |
# BONUS: use kubectl with the service account token: | |
kubectl --token="${TOKEN}" -s https://api.<cluster-domain>:6443 --insecure-skip-tls-verify=true get pod |
NewerOlder