Skip to content

Instantly share code, notes, and snippets.

View nickknissen's full-sized avatar

Nick nickknissen

  • Uptime Development
  • Denmark
View GitHub Profile
@nickknissen
nickknissen / php-pools.md
Created August 20, 2024 12:58 — forked from holmberd/php-pools.md
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@nickknissen
nickknissen / Friends of Hue 2 wippen MQTT.yaml
Created November 23, 2023 08:30
Friends of Hue 2 wippen MQTT
blueprint:
name: Friends of Hue 2 wippen MQTT
domain: automation
description: Zigbee Green Power switches
input:
# Trigger settings
device:
name: Wippen
selector:
@nickknissen
nickknissen / script.yaml
Created November 23, 2023 06:11 — forked from KeviinCosmos/script.yaml
Controller - EnOcean PTM 215Z (Friends of Hue) switch double press
blueprint:
name: Controller - EnOcean PTM 215Z (Friends of Hue) switch double press
description: 'Controller automation for executing press/double-press/hold/release actions triggered by
EnOcean PTM 215Z (Friends of Hue) switch.'
domain: automation
input:
controller_entity:
name: (Zigbee2MQTT) Controller Entity
description: The action sensor of the controller to use for the automation.
@nickknissen
nickknissen / heatpump-energy.yaml
Created April 22, 2023 06:32
Carlo Gavazzi EM340 pulse out monitor
substitutions:
energy_name: Heatpump
esphome:
name: heatpump-energy
esp32:
board: esp32dev
framework:
type: esp-idf
@nickknissen
nickknissen / kvartalsel.yaml
Created October 10, 2022 12:25
kvartalsel fra ewii
template:
- sensor:
- name: "Energy Total Price pr. kWh"
unit_of_measurement: "kr./kWh"
device_class: monetary
state: "{{ (float(states('sensor.current_energy_price')) + float(states('sensor.current_energy_subscription_price')) | float(0)) | round(2) }}"
sensor:
- platform: command_line
name: current_energy_price
@nickknissen
nickknissen / EnOcean PTM 215Z (Friends of Hue) switch.yaml
Created December 9, 2021 07:31
EnOcean PTM 215Z (Friends of Hue) switch
blueprint:
name: Controller - EnOcean PTM 215Z (Friends of Hue) switch
description: 'Controller automation for executing press/hold/release actions triggered by
EnOcean PTM 215Z (Friends of Hue) switch.'
domain: automation
input:
controller_entity:
name: (Zigbee2MQTT) Controller Entity
description: The action sensor of the controller to use for the automation.
@nickknissen
nickknissen / Turn on and Connect Octoprint.json
Last active June 16, 2020 21:06
Turn on and Connect Octoprint node-red
[
{
"id": "afa241e.094c7c",
"type": "subflow",
"name": "Turn on and Connect Octoprint",
"info": "",
"category": "",
"in": [
{
"x": 80,
@nickknissen
nickknissen / my_menu.cfg
Created January 7, 2020 14:01
Klipper ender 5
# This file serves as default menu structure.
# See the "example-menu.cfg" file for description of common config parameters.
### DEFAULT MENU ###
### menu main ###
[menu __main]
type: list
name: Main Menu
items:
Import-Module Get-ChildItemColor
Import-Module PSReadLine
Set-Alias l Get-ChildItemColor -option AllScope
Set-Alias ls Get-ChildItemColorFormatWide -option AllScope
Set-Alias dir Get-ChildItemColor -option AllScope -Force
Set-Alias dc docker-compose
function DockerCompose-Exec() {
docker-compose exec $args
#c::Center() ;Windows + c
#1::Center(0.95) ;Windows + 1
#2::Center(0.85) ;Windows + 2
#3::Center(0.75) ;Windows + 3
#4::Center(0.65) ;Windows + 4
#5::Center(0.55) ;Windows + 4
SC29::$ ; map ½ to $
Center(scaleRatio = 1)