Skip to content

Instantly share code, notes, and snippets.

View davosian's full-sized avatar

Dennis Staiger davosian

  • Ennovations.net
View GitHub Profile
@davosian
davosian / add_unique_todo.yaml
Created March 21, 2024 21:54 — forked from andrew-codechimp/add_unique_todo.yaml
Home Assistant - Add unique to-do item
alias: Add unique to-do
mode: single
icon: mdi:clipboard-list
sequence:
- service: todo.get_items
target:
entity_id: "{{ list }}"
data:
status: needs_action
response_variable: mylist
@davosian
davosian / migrate-nexus-to-github-packages.md
Created January 5, 2022 13:27 — forked from karlvr/migrate-nexus-to-github-packages.md
A small bash script to migrate Maven packages from Sonatype Nexus to GitHub Packages

Migrate Maven packages from Sonatype Nexus to GitHub Packages

This gist describes the process we've used to migrate our Maven package repository from Sonatype Nexus to GitHub Packages. The same process could be used for migrating any Maven package repo that is in the standard layout.

We created a special repository on GitHub to hold all of our Maven packages. You might decide to migrate packages to different repositories, in which case invoke the script multiple times.

The script uses find to look for all of the folders containing poms and upload them. You specify the folder

@davosian
davosian / cloud-init.yaml
Created January 3, 2022 20:46 — forked from pmbaumgartner/cloud-init.yaml
Multipass & Docker Setup
#cloud-config
package_upgrade: true
ssh_authorized_keys:
- <your key>
packages:
- apt-transport-https
- ca-certificates
- curl
@davosian
davosian / script.sh
Created September 29, 2021 10:59
Delete all evicted pods
kubectl get pods --all-namespaces -o json | jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) | "kubectl delete pods \(.metadata.name) -n \(.metadata.namespace)"' | xargs -n 1 bash -c
@davosian
davosian / export-kubeconfig-from-aks
Created September 20, 2021 07:11 — forked from dcasati/export-kubeconfig-from-aks
Export KUBECONFIG from AKS
az aks get-credentials --resource-group k8s-demo-ss --name k8s-demo-cluster-ss --file kubeconfig-ss
@davosian
davosian / web-servers.md
Created September 14, 2021 13:52 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@davosian
davosian / groceries_bring
Created July 19, 2021 14:57 — forked from ahue/groceries_bring
A slot-program for retrieve German grocery terms for Rhasspy
#!/usr/bin/env bash
set -e
url="https://web.getbring.com/locale/articles.de-DE.json"
echo "GET ${url}" >&2
curl -X GET \
-H 'Content-Type: application/json' \
"${url}" | \
jq --raw-output 'to_entries[] as $e | "\($e.value)"' | \
@davosian
davosian / groceries_wiktionary
Created July 19, 2021 14:57 — forked from ahue/groceries_wiktionary
rhasspy slot program to get german groceries from wiktionary into rhasspy
#! /usr/bin/python3
try:
# For Python 3.0 and later
from urllib.request import urlopen
from urllib.parse import quote
except ImportError:
# Fall back to Python 2's urllib2
from urllib2 import urlopen
from urllib2 import quote
@davosian
davosian / HowTo
Created May 2, 2021 11:35 — forked from s3rj1k/HowTo
Ubuntu 20.04.2 AutoInstall
# Docs:
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/53
# Download ISO Installer:
wget https://ubuntu.volia.net/ubuntu-releases/20.04.2/ubuntu-20.04.2-live-server-amd64.iso
# Create ISO distribution dirrectory:
@davosian
davosian / docker-compose-backup.sh
Created March 2, 2021 07:15 — forked from pirate/docker-compose-backup.sh
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
#!/usr/bin/env bash
### Bash Environment Setup
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# set -o xtrace
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail