Skip to content

Instantly share code, notes, and snippets.

@dreiggy
dreiggy / docker-systemd.md
Created September 30, 2021 07:34 — forked from OnkelDom/docker-systemd.md
My Setup to manage docker containers with systemd services

Setup Docker Systemd on Ubuntu 20.04

This is my docker systemd setup. I stored no configs or environment vars in this gist.

Install Docker

# Install Dependencies
$ sudo apt-get update
$ sudo apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
@dreiggy
dreiggy / package_updates_check.py
Created July 21, 2020 11:46 — forked from yumminhuang/package_updates_check.py
Python script to check apt-get updates
#!/usr/bin/env python
#coding=utf-8
import apt
import apt_pkg
from time import strftime
import os
import subprocess
import sys
@dreiggy
dreiggy / system-updates-playbook.yml
Created July 15, 2020 12:28 — forked from ZeroDeth/system-updates-playbook.yml
Ansible Playbook Installing System Updates for YUM and APT
---
- hosts: all
become: yes
tasks:
- name: Install system updates for centos systems
yum:
name: '*'
state: latest
@dreiggy
dreiggy / snmp.yml
Created July 15, 2020 10:26 — forked from h3po/snmp.yml
Config for prometheus-snmp-exporter polling the most important metrics (mtu, bandwith, packet/byte counters, plug status) from a cisco switch stack, with static port properties (index, descr, type, mac, name, alias) as labels
#http://www.oidview.com/mibs/0/IF-MIB.html
#http://www.net-snmp.org/docs/mibs/interfaces.html
cisco_custom:
version: 2
auth:
community: public
walk:
- 1.3.6.1.2.1.2.2.1
- 1.3.6.1.2.1.31.1.1.1
metrics:
@dreiggy
dreiggy / slapd
Created March 10, 2020 13:13 — forked from tuxfight3r/slapd
openldap proxy to AD with TLS
#file /etc/sysconfig/slapd
# OpenLDAP server configuration
# see 'man slapd' for additional information
# Where the server will run (-h option)
# - ldapi:/// is required for on-the-fly configuration using client tools
# (use SASL with EXTERNAL mechanism for authentication)
# - default: ldapi:/// ldap:///
# - example: ldapi:/// ldap://127.0.0.1/ ldap://10.0.0.1:1389/ ldaps:///
SLAPD_URLS="ldap:/// ldaps:///"
@dreiggy
dreiggy / mirror_remote_directory_to_local_directory
Created October 10, 2019 07:23 — forked from pixeline/mirror_remote_directory_to_local_directory
Bash script using lftp to mirror remote directory to local directory, thus keeping the local directory synchronized with the remote one.
#!/bin/sh
# @author: Alexandre Plennevaux
# @description: MIRROR DISTANT FOLDER TO LOCAL FOLDER VIA FTP
#
# FTP LOGIN
HOST='sftp://ftp.domain.com'
USER='ftpusername'
PASSWORD='ftppassword'
# DISTANT DIRECTORY
@dreiggy
dreiggy / prometheus.md
Created October 2, 2019 05:54 — forked from petarnikolovski/prometheus.md
Prometheus 2.x installation on Ubuntu 16.04 server.

Installing Prometheus on Ubuntu 16.04

This gist is a compilation of two tutorials. You can find the original tutorials here and here. What should you know before using this? Everything can be executed from the home folder. For easier cleanup at the end you can make directory where you'll download everything, and then just use rm -rf .. Although, you should be careful. If some strange bugs arise unexpectedly somewhere sometimes, just keep in mind that some user names have underscores in them (this is probably nothing to worry about).

Create Users

sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Prometheus Monitoring User" prometheus
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Node Exporter User" node_exporter
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Alertm
@dreiggy
dreiggy / rspamd-lists.md
Created March 31, 2019 17:12 — forked from kvaps/rspamd-lists.md
Howto create local whitelists and blacklists for Rspamd

Local whitelists and blacklists for Rspamd

  • cd /etc/rspamd
  • create rspamd.conf.local
  • create lists:
touch local_bl_from.map.inc local_bl_ip.map.inc local_bl_rcpt.map.inc \
local_wl_from.map.inc local_wl_ip.map.inc local_wl_rcpt.map.inc
  • change permissions:
@dreiggy
dreiggy / xfce-shortcuts-screenshot.md
Created November 21, 2018 21:43 — forked from dianjuar/xfce-shortcuts-screenshot.md
My xfce shortcuts to take screenshots
Command Shortcut
xfce4-screenshooter --fullscreen --clipboard Ctrl + PrtScrn
xfce4-screenshooter --fullscreen --save /home/dianjuar/Pictures PrtScrn
xfce4-screenshooter --region --clipboard Ctrl + Shift + PrtScrn
xfce4-screenshooter --region --save /home/dianjuar/Pictures Shift + PrtScrn
xfce4-screenshooter --window --clipboard Ctrl + Super + PrtScrn
xfce4-screenshooter --window --save /home/dianjuar/Pictures Super + PrtScrn
@dreiggy
dreiggy / strace-fpm.sh
Created October 9, 2018 11:40 — forked from ajbonner/strace-fpm.sh
Strace all running php-fpm processes to file with timestamps and pid
sudo strace -f -tt -o /tmp/php.trace -s1024 -p `pgrep -f php-fpm | tr '\n' ','`