Skip to content

Instantly share code, notes, and snippets.

View RomanDanyk's full-sized avatar

Roman Danyk RomanDanyk

View GitHub Profile
@mvadu
mvadu / grafana custom.ini
Last active November 11, 2023 18:26
nginx config for using grafana, Influxdb via reverse proxy with authentication
# The full public facing url
#root_url = %(protocol)s://%(domain)s:%(http_port)s/
root_url = http://localhost:80/grafana/
@lvazquez
lvazquez / ambari-control.sh
Last active December 17, 2021 06:01
Ambari Control script based in randerzander's control.sh
AMBARI_USER='admin'
AMBARI_PASS='admin'
AMBARI_AUTH='/etc/ambari-server/ambari-control.auth'
AMBARI_PROPS='/etc/ambari-server/conf/ambari.properties'
PROG=`basename $0`
HOST=$(hostname -f)
AMBARI_CLUSTER=""
LIMIT=10
@ageis
ageis / systemd_service_hardening.md
Last active June 20, 2024 02:52
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@AAber
AAber / disk_used_alert2slack
Created June 14, 2017 13:38
Script to monitor disk space and alert via slack when disk usage is > 80% Place the script in /etc/cron.hourly
#!/bin/bash
# Parse df selected output
df -h|egrep -v 'File|tmpfs|docker|udev'| \
while read LINE; do
USED_NUMBER=`echo $LINE |awk '{print $5}'|sed 's/\%//'|sed 's/ //g'`
USED_PERCENT=`echo $LINE |awk '{print $5}'|sed 's/ //g'`
MOUNT_POINT=`echo $LINE |awk '{print $6}'|sed 's/ //g'`
if [ $USED_NUMBER -gt 80 ]; then
# Create message without spaces
@andyvanee
andyvanee / .ssh_config
Last active November 30, 2023 04:19
Fix unix_listener too long for Unix domain socket
Host *
ControlPath ~/.ssh/control/%C
ControlMaster auto
@davidejones
davidejones / handler_fieldstorage.py
Created May 2, 2018 15:24
aws lambda parsing multipart form with python3
from cgi import FieldStorage
from io import BytesIO
def parse_into_field_storage(fp, ctype, clength):
fs = FieldStorage(
fp=fp,
environ={'REQUEST_METHOD': 'POST'},
headers={
'content-type': ctype,
groups:
- name: datetime
rules:
- record: daily_saving_time_belgium
expr: |
(vector(0) and (month() < 3 or month() > 10))
or
(vector(1) and (month() > 3 and month() < 10))
or
(