Skip to content

Instantly share code, notes, and snippets.

View djamp42's full-sized avatar
🏠
Working from home

djamp42

🏠
Working from home
View GitHub Profile
@djamp42
djamp42 / Graylog 5.1 Config
Created July 1, 2023 03:23
Graylog 5.1 Install on Ubuntu 22.04 LTS
sudo nano /etc/graylog/server/server.conf
echo -n "Enter Password: " && head -1 </dev/stdin | tr -d '\n' | sha256sum | cut -d" " -f1
root_password_sha2 =
< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c${1:-96};echo;
password_secret =
http_bind_address = 0.0.0.0
@djamp42
djamp42 / Galera.cnf
Created June 21, 2021 13:17
Galera.cnf
[mysqld]
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0
# Galera Provider Configuration
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
@djamp42
djamp42 / functions.inc.php
Last active March 31, 2021 16:00
Make some applications display graph over rrdcached
function get_arrays_with_application($device, $app_id, $app_name, $category = null)
{
$entries = [];
$apparray = [];
$separator = '-';
if ($category) {
$pattern = sprintf('%s/%s-%s-%s-%s-*.rrd', Rrd::dirFromHost($device['hostname']), 'app', $app_name, $app_id, $category);
} else {
$pattern = sprintf('%s/%s-%s-%s-*.rrd', Rrd::dirFromHost($device['hostname']), 'app', $app_name, $app_id);
@djamp42
djamp42 / oxidized.service
Created March 8, 2021 03:14
Oxidized SystemD
# Put this file in /etc/systemd/system.
#
# To set OXIDIZED_HOME instead of the default,
# ~oxidized/.config/oxidized, uncomment (and modify as required) the
# "Environment" variable below so systemd sets the correct
# environment.
[Unit]
Description=Oxidized - Network Device Configuration Backup Tool
After=network-online.target multi-user.target
@djamp42
djamp42 / oxidized
Last active October 14, 2022 09:08
Oxidized Config
---
username: username
password: password
model: junos
resolve_dns: false
interval: 3600
use_syslog: false
debug: false
threads: 30
timeout: 20
@djamp42
djamp42 / gist:4cbe526850b1e21fd2dd7e04204c6900
Created February 23, 2021 13:31
LibreNMS systemd Service for Docker Compose
[Unit]
Description=Docker Compose Application Service
Requires=docker.service
After=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/home/librenmsadmin/DockerComposeFile
ExecStart=/usr/local/bin/docker-compose up -d
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
@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