Skip to content

Instantly share code, notes, and snippets.

View sanfx's full-sized avatar
🎯
Focusing

Sanjeev Kumar sanfx

🎯
Focusing
  • London
  • 23:15 (UTC +01:00)
View GitHub Profile
@ilude
ilude / !prometheus-01.setup.notes.md
Last active January 22, 2024 08:15
Prometheus/Grafana setup using Joyride and Traefik
@dmccuk
dmccuk / Ansible_Assert.txt
Last active July 5, 2023 07:49
Prove ansible did what is said it did!
-- Ansible testing using Assert
When we run Ansible to manage server configurations, we assume (if there is no red errors) that it worked. But if you are developing ansible modules for your systems, and want to take the DevOps approach and work on CICD pipelines, you need to have some tests in there to prove that what you asked ansible to do has actually worked.
One of the best ways to do this within ansible, is to use the Assert module. It asserts that a given expression is true. When you combine this with the output of a command that’s registered to a variable, there is almost no limit to what you can test.
I’m going to use the TDD (Test driven development) method where we create the tests before we start writing any ansible code to manage our systems. I expect the tests to fail. Then we’ll write ansible to pass the tests. That’s it.
This demo will cover the following:
• Create some tests using the command and assert modules.
@djamp42
djamp42 / .env
Created February 6, 2021 04:15
LibreNMS Poller Docker Service
TZ=America/New_York
PUID=1000
PGID=1000
MYSQL_DATABASE=librenms
MYSQL_USER=librenms
MYSQL_PASSWORD=password
@afonari
afonari / firefox_doh_with_dnscrypt-proxy_lets_encrypt_nextdns.md
Last active September 25, 2020 21:30
Firefox DOH with dnscrypt-proxy, Let's Encrypt and nextdns.io

This gist explains how to setup DOH for Firefox using dnscrypt-proxy and nextdns.io.

Get a Linux server with a static IP (DO droplet would work). Download and install dnscrypt-proxy. Edit dnscrypt-proxy.toml (see wiki):

[local_doh]
listen_addresses = ['123.456.789.1:3000']
path = "/dns-query"
cert_file = "fullchain.pem"
cert_key_file = "privkey.pem"
@athlan
athlan / Dockerfile
Last active May 24, 2022 21:59
Docker cron env variables
FROM XXXX
#Install cron
RUN apt-get update; \
apt-get install -y cron; \
apt-get clean; \
touch /var/log/cron.log
COPY crontab.txt /etc/cron.d/crontab
COPY run-cron.sh /usr/local/app/entrypoint/run-cron.sh
@bradtraversy
bradtraversy / docker_wordpress.md
Last active May 4, 2024 09:16
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@GAS85
GAS85 / nextcloud_fail2ban.md
Last active April 8, 2024 20:51
Harden Nextcloud 17+ with Fail2Ban, GUI and WebDAV - Ubuntu 20.04

Fail2ban and Nextcloud

Prerequsits

  • Ubuntu 20.04
  • nextcloud, fail2ban and e.g. iptables are installed

Note

@sudo-bmitch
sudo-bmitch / console-log.md
Created February 22, 2018 14:04
How inodes work in containers when you tail a file

Docker filesystem layers can be tricky to wrap your head around, and even more so how indoes work. Lets take an example and see what happens when you tail a file that exists in the image as part of your container entrypoint:

host$ docker run -d --rm --name test-inode debian tail -f /etc/issue                              
54bbfa8fa1f6751593dcf23103a1cdaec7fde8ffbcb3e31bab466b4f7a3581e7

Now make some changes to the file:

import sys
from PyQt5.QtCore import pyqtSlot, QSortFilterProxyModel, Qt, QUrl, QDir, QAbstractListModel
from PyQt5.QtGui import QGuiApplication
from PyQt5.QtQml import QQmlApplicationEngine
class SortProxyModel(QSortFilterProxyModel):
@pyqtSlot(str, Qt.SortOrder)
def sortData(self, roleName, order):