talosctl gen config talos-kubevirt https://talos-kubevirt.home.arpa:6443 --additional-sans 192.168.1.70,talos-kubevirt --install-disk /dev/vda --output-dir $(pwd)/talos
❯ cat deploy.sh
#kubectl --kubeconfig $HOME/.kube/poweredge delete -f ./kubevirt/
#sleep 12
#kubectl --kubeconfig $HOME/.kube/poweredge apply -f ./kubevirt/
#sleep 120
#!/usr/bin/env bash | |
if [ "$EUID" -ne 0 ];then | |
>&2 echo "This script requires root level access to run" | |
exit 1 | |
fi | |
if [ -z "${WORDPRESS_DB_PASSWORD}" ]; then | |
>&2 echo "WORDPRESS_DB_PASSWORD must be set" | |
>&2 echo "Here is a random one that you can paste:" |
The NGINX Unit control API includes a /status
endpoint for usage statistics. This is a solution for exposing these metrics in Prometheus format.
The application (run by Unit) queries the /status
URI on the control socket and converts the JSON response into Prometheus text format. PHP and Python implementations are available.
These instructions assume an existing Unit installation with a working configuration. We will add a new listener on the default prometheus port (9090) and route it directly to the Prometheus app.
Step 0. Install the preferred Unit language module (unit-php
or unit-python
)
#!/usr/bin/perl | |
# Copyright (c) 2021 Luca Anastasio | |
# anastasio<dot>lu<at>gmail<dot>com | |
# Hookscript to avoid taking PCI passed through devices from running VMs | |
# also attaches them to their placeholders after guests are stopped | |
# You can set this via qm with | |
# qm set 100 --hookscript local:snippets/hookscript.pl | |
use strict; |
add_action('woocommerce_thankyou_bacs', 'wpd_qr_code', 10, 1 ); | |
function wpd_qr_code( $order_id ) { | |
$order = wc_get_order( $order_id ); | |
$bacs_info = get_option( 'woocommerce_bacs_accounts'); | |
echo "<div style='display: grid; grid-template-columns: auto auto auto;'>"; | |
foreach ($bacs_info as $info ) { |
# Installing prerequisites for BTCPayServer development on Ubuntu | |
# Install .NET Core SDK 2.2 | |
# https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/install?initial-os=linux | |
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb | |
sudo dpkg -i packages-microsoft-prod.deb | |
sudo add-apt-repository universe |
/etc/default/alfio | |
---- | |
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre | |
MODE=service | |
#PORT=9001 | |
JAVA_OPTS="-Ddatasource.driver=org.postgresql.Driver -Ddatasource.url=jdbc:postgresql://localhost:5433/alfio -Ddatasource.username=alfio -Ddatasource.password=secret -Ddatasource.dialect=PGSQL -Ddatasource.validationQuery='SELECT 1'" |
#!/bin/bash | |
# Installation: | |
# | |
# 1. vim /etc/ssh/sshd_config | |
# PrintMotd no | |
# | |
# 2. vim /etc/pam.d/login | |
# # session optional pam_motd.so | |
# |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
/* Lets not rely on paths in the database, they can be very wrong when moving between dev/stage/live environments */ | |
/* The following two variables are backward to my thinking, but hey, what ya gonna do? */ | |
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . ''); // This is NOT the 'wordpress admin area' home, but the site's home | |
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/SECRETDIRECTORY'); // This isn't the site's URL but the WordPress admin area URL | |
/* MySQL settings */ | |
switch($_SERVER['SERVER_NAME']){ | |
// Your local machine's settings | |
case 'mysite.local': | |
define('DB_NAME', 'dev_mysite'); |