- Tested on Raspberry-Pi 4 Model B 2GB RAM
- Docker Version:
19.03.8
- Docker-Compose version:
1.25.5
.
A lot of people land when trying to find out how to calculate CPU usage metric correctly in prometheus, myself included! So I'll post what I eventually ended up using as I think it's still a little difficult trying to tie together all the snippets of info here and elsewhere.
This is specific to k8s and containers that have CPU limits set.
To show CPU usage as a percentage of the limit given to the container, this is the Prometheus query we used to create nice graphs in Grafana:
sum(rate(container_cpu_usage_seconds_total{name!~".*prometheus.*", image!="", container_name!="POD"}[5m])) by (pod_name, container_name) /
############################################################################## | |
# | |
# Author: Miku Laitinen / Avoin.Systems | |
# Copyright 2019 Avoin.Systems | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Affero General Public License as | |
# published by the Free Software Foundation, either version 3 of the | |
# License, or (at your option) any later version. | |
# |
es_host: your_host | |
es_port: your_port | |
name: Sites Down | |
description: Site pings returned down more than once in 15 minutes. | |
type: frequency | |
index: heartbeat-* | |
num_events: 2 | |
timeframe: | |
minutes: 15 | |
filter: |
This file aims to explain how to deploy Portainer inside a compose file with the admin password already set.
For this example, we'll use the password superpassword
.
Use the following command to generate a hash for the password:
Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.
The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from
##### hostapd configuration file ############################################## | |
# Empty lines and lines starting with # are ignored | |
# AP netdevice name (without 'ap' postfix, i.e., wlan0 uses wlan0ap for | |
# management frames with the Host AP driver); wlan0 with many nl80211 drivers | |
interface=wlan0 | |
# In case of atheros and nl80211 driver interfaces, an additional | |
# configuration parameter, bridge, may be used to notify hostapd if the | |
# interface is included in a bridge. This parameter is not used with Host AP |
import socket, struct, os, array | |
from scapy.all import ETH_P_ALL | |
from scapy.all import select | |
from scapy.all import MTU | |
class IPSniff: | |
def __init__(self, interface_name, on_ip_incoming, on_ip_outgoing): | |
self.interface_name = interface_name |
#!/bin/sh | |
# | |
# Pre-commit hook that verifies if all files containing 'vault' in the name | |
# are encrypted. | |
# If not, commit will fail with an error message | |
# | |
# Original author: @ralovely | |
# https://www.reinteractive.net/posts/167-ansible-real-life-good-practices | |
# | |
# File should be .git/hooks/pre-commit and executable |