Skip to content

Instantly share code, notes, and snippets.

View uhlhosting's full-sized avatar
🏠
Working from home

Viorel-Cosmin Miron uhlhosting

🏠
Working from home
View GitHub Profile
@uhlhosting
uhlhosting / ubuntu_install.sh
Created July 26, 2024 20:45 — forked from nginx-gists/ubuntu_install.sh
Automating Installation of WordPress with NGINX Unit on Ubuntu
#!/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:"
@uhlhosting
uhlhosting / README.md
Created July 25, 2024 20:11 — forked from lcrilly/README.md
Prometheus exporter for NGINX Unit metrics

Prometheus exporter for NGINX Unit metrics

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)

@uhlhosting
uhlhosting / hookscript.pl
Created August 11, 2023 22:17 — forked from lucanastasio/hookscript.pl
Proxmox passthrough saver hook script
#!/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 ) {
@uhlhosting
uhlhosting / index.html
Created January 17, 2022 09:32
WordPress Vue axios
<div id="keywords">
<h2> Disclaimer : Demo data from CeleGabar.com </h2>
<ul>
<li class="hoge" v-for="post in filteredposts">
<a :href="post.link">{{post.title.rendered ? post.title.rendered : 'Hover'}}</a> <br/> {{post.date}} <hr/>
</li>
</ul>
</div>
@uhlhosting
uhlhosting / index.html
Created January 17, 2022 08:41
srcset for Wordpress post thumbnails
<?php
function srcset_post_thumbnail($defaultSize = 'medium')
{
// those are the default thumbnail sizes for wordpress.
// we can -and should- define our own sizes according to our breakpoints
$thumbnailSizes = [
'thumbnail',
'medium',
@uhlhosting
uhlhosting / index.html
Created January 17, 2022 08:23
Responsive Team Section Using HTML , CSS , Bootstrap
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Responsive Team Section Using HTML5 , CSS3 , Bootstrap 4</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/fontawesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/css/bootstrap.css">
<link href="https://fonts.googleapis.com/css?family=Poppins:500,700&display=swap" rel="stylesheet">
@uhlhosting
uhlhosting / index.html
Created January 17, 2022 07:15
WordPress Snippet Template
<h1>Title/explanation of Snippet here</h1>
<pre class="line-numbers"><code class="language-php">
</code></pre>
@uhlhosting
uhlhosting / index.html
Created January 17, 2022 07:07
Mask animation with GSAP & SVG
<div id="home-animation-wrapper" style="opacity: 0">
<div class="slides">
<div class="slide" count="0" data-1="WE ARE" data-2="thinkers" data-3="+Doers"></div>
<div class="slide" count="1" data-1="WE ARE" data-2="optimists" data-3="+realists"></div>
<div class="slide" count="2" data-1="WE ARE" data-2="willing" data-3="+able"></div>
</div>
<svg version="1.1" id="home-animation" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="2371.2px" height="841.1px" viewBox="0 0 2371.2 841.1" xml:space="preserve">
<!-- <defs>
@uhlhosting
uhlhosting / index.html
Created January 17, 2022 07:04
Pickle-Rick Sliced 404
<div class="svgcontainer">
<div class="subcont">
<div class="topconvo">
<span>!@#$</span><br />your portal gun must be busted...
</div>
<svg version="1.1" id="fourohfour" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 265.5 114" style="enable-background:new 0 0 265.5 114;" xml:space="preserve">
<g id="bottoms">
<g id="leftfourbottom">