Skip to content

Instantly share code, notes, and snippets.

@apollo13
apollo13 / traefik.nomad
Last active Jul 28, 2021
Traefik 2.5 with Consul Connect on Nomad
View traefik.nomad
# Simple example to deploy traefik with consul connect enabled.
# For simplicity the job includes traefik as well as the backend service.
# Please note that traefik currently only supports connect for HTTP.
job "traefik-consul-connect-demo" {
datacenters = ["dc1"]
group "edge" {
network {
mode = "bridge"
View gist:458a7515bba9d474e2cc0279912f2946
job "countdash" {
datacenters = ["dc1"]
group "api" {
network {
mode = "bridge"
}
service {
name = "count-api"
View gist:0b949b3a12f36f6d8107a77462c769d0
type=AVC msg=audit(1584721512.261:16623): avc: denied { map } for pid=24196 comm="check_mailq" path="/usr/bin/perl" dev="dm-0" ino=778301 scontext=system_u:system_r:nagios_mail_plugin_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1
type=AVC msg=audit(1584721512.261:16623): avc: denied { execute } for pid=24196 comm="check_mailq" path="/usr/bin/perl" dev="dm-0" ino=778301 scontext=system_u:system_r:nagios_mail_plugin_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1
type=SYSCALL msg=audit(1584721512.261:16623): arch=c000003e syscall=59 success=yes exit=0 a0=2dac4b0 a1=2dac4e0 a2=2dabc90 a3=fffffffffffffa86 items=0 ppid=18028 pid=24196 auid=4294967295 uid=992 gid=989 euid=992 suid=992 fsuid=992 egid=989 sgid=989 fsgid=989 tty=(none) ses=4294967295 comm="check_mailq" exe="/usr/bin/perl" subj=system_u:system_r:nagios_mail_plugin_t:s0 key=(null)ARCH=x86_64 SYSCALL=execve AUID="unset" UID="icinga" GID="icinga" EUID="icinga" SUID="icinga" FSUID="icinga" EGID="icinga" SGID="ici
View gist:2e27c6a73b6a451db283d34786605830
type=AVC msg=audit(1584721374.725:16610): avc: denied { map } for pid=24058 comm="check_mailq" path="/usr/bin/perl" dev="dm-0" ino=778301 scontext=system_u:system_r:nagios_mail_plugin_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1
type=AVC msg=audit(1584721374.725:16610): avc: denied { execute } for pid=24058 comm="check_mailq" path="/usr/bin/perl" dev="dm-0" ino=778301 scontext=system_u:system_r:nagios_mail_plugin_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1
type=SYSCALL msg=audit(1584721374.725:16610): arch=c000003e syscall=59 success=yes exit=0 a0=2dabe50 a1=2dac4e0 a2=2dabc90 a3=fffffffffffffa86 items=0 ppid=18028 pid=24058 auid=4294967295 uid=992 gid=989 euid=992 suid=992 fsuid=992 egid=989 sgid=989 fsgid=989 tty=(none) ses=4294967295 comm="check_mailq" exe="/usr/bin/perl" subj=system_u:system_r:nagios_mail_plugin_t:s0 key=(null)ARCH=x86_64 SYSCALL=execve AUID="unset" UID="icinga" GID="icinga" EUID="icinga" SUID="icinga" FSUID="icinga" EGID="icinga" SGID="ic
View gist:f7befdd8d0a53acb4d4e4f844bc03349
type=AVC msg=audit(1584721279.094:16607): avc: denied { getattr } for pid=23999 comm="mailq" path="pipe:[1306241]" dev="pipefs" ino=1306241 scontext=system_u:system_r:system_mail_t:s0 tcontext=system_u:system_r:icinga2_t:s0 tclass=fifo_file permissive=1
type=SYSCALL msg=audit(1584721279.094:16607): arch=c000003e syscall=5 success=yes exit=0 a0=2 a1=7ffc3df53dd0 a2=7ffc3df53dd0 a3=55763bda4010 items=0 ppid=23998 pid=23999 auid=4294967295 uid=992 gid=989 euid=992 suid=992 fsuid=992 egid=989 sgid=989 fsgid=989 tty=(none) ses=4294967295 comm="mailq" exe="/usr/sbin/sendmail.postfix" subj=system_u:system_r:system_mail_t:s0 key=(null)ARCH=x86_64 SYSCALL=fstat AUID="unset" UID="icinga" GID="icinga" EUID="icinga" SUID="icinga" FSUID="icinga" EGID="icinga" SGID="icinga" FSGID="icinga"
type=PROCTITLE msg=audit(1584721279.094:16607): proctitle="/usr/bin/mailq"
type=AVC msg=audit(1584721279.111:16608): avc: denied { write } for pid=23999 comm="postqueue" path="pipe:[1306241]" dev="pipefs" ino=1306241 scontext=system
View gist:43cbc99aa443226e46fbb7b72d82125e
## The following connection tries every two seconds to connect to the RW host via 6446
## the cluster contains centos1 - centos3 with centos2 being the current primary
2020-03-06 16:41:50 routing DEBUG [7f88a3fff700] [routing:test_rw] fd=13 connection accepted at 0.0.0.0:6446
2020-03-06 16:41:50 routing DEBUG [7f88b05ff700] [routing:test_rw] fd=13 connected 127.0.0.1:49016 -> centos2:3306 as fd=14
2020-03-06 16:41:51 routing DEBUG [7f88b05ff700] [routing:test_rw] fd=13 connection closed (up: 4453b; down: 880b)
2020-03-06 16:41:53 routing DEBUG [7f88a3fff700] [routing:test_rw] fd=13 connection accepted at 0.0.0.0:6446
2020-03-06 16:41:53 routing DEBUG [7f88b05ff700] [routing:test_rw] fd=13 connected 127.0.0.1:49020 -> centos2:3306 as fd=14
2020-03-06 16:41:53 routing DEBUG [7f88b05ff700] [routing:test_rw] fd=13 connection closed (up: 4453b; down: 880b)
2020-03-06 16:41:55 routing DEBUG [7f88a3fff700] [routing:test_rw] fd=13 connection accepted at 0.0.0.0:6446
View gist:f38f75206ad61f66f8c2b4cbcd769d66
error[E0308]: mismatched types
--> client/src/observer/connector.rs:77:9
|
66 | pub fn update_info(&self) -> std::result::Result<UpdateInfo, Box<dyn error::Error>> {
| ------------------------------------------------------ expected `std::result::Result<observer::connector::UpdateInfo, std::boxed::Box<(dyn std::error::Error + 'static)>>` because of return type
...
77 | / decode::<UpdateInfo>(
78 | | &token,
79 | | &DecodingKey::from_secret("secret".as_ref()),
80 | | &Validation::new(Algorithm::HS256),
@apollo13
apollo13 / pyproject.toml
Last active May 26, 2021
OwnCloud/NextCloud emulator
View pyproject.toml
[tool.poetry]
name = "owncloudemulator"
version = "0.1.0"
description = ""
authors = ["Florian Apolloner <florian@apolloner.eu>"]
[tool.poetry.dependencies]
python = "^3.7"
starlette = "^0.13.0"
uvicorn = "^0.10.8"
View keybase.md

Keybase proof

I hereby claim:

  • I am apollo13 on github.
  • I am apollo13 (https://keybase.io/apollo13) on keybase.
  • I have a public key whose fingerprint is 8D32 5B9C 8692 79A8 4ADD E04E 42F3 06A1 CF72 8E71

To claim this, I am signing this object:

@apollo13
apollo13 / apps.ini
Created Aug 25, 2018 — forked from rugginoso/apps.ini
uWSGI Emperor + FastRouter + SubscriptionServer + HTTP + SystemD
View apps.ini
[uwsgi]
# Gemeric app
declare-option = app=master=true;socket=/run/uwsgi/$1.sock;chmod-socket=660;vacuum=true;auto-procname=true;procname-prefix-spaced=$1;cheap=true;idle=60ksm=true
# Django
declare-option = django=venv=$1venv;pythonpath=$1;chdir=$1;module=$2.wsgi
# Fastrouter subscription
declare-option = add-domain=subscribe-to=127.0.0.1:12345:$1