Skip to content

Instantly share code, notes, and snippets.

View dginhoux's full-sized avatar

Dany GINHOUX dginhoux

View GitHub Profile
@dginhoux
dginhoux / lighttpd_basic_auth
Last active October 29, 2022 11:55 — forked from MinaMikhailcom/lighttpd.conf
Basic authentication configurations for Lighttpd under Ubuntu
apt install apache2-utils
htpasswd -c /etc/lighttpd/.htpasswd <Username> #Replace <Username>, you will be prompted to enter the password.
# Make sure that "mod_auth" is loaded in "server.modules".
nano /etc/lighttpd/lighttpd.conf
#Add the following to lighttpd.conf.
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile= "/etc/lighttpd/.htpasswd"
#!/bin/bash
## https://docs.gluster.org/en/latest/Troubleshooting/gfid-to-path/#references-and-links
gf_brick=/mnt/lv_swarm_prod3
gf_vol=gfs_lv_swarm_prod3
@dginhoux
dginhoux / edgerouter_node_exporter
Created October 29, 2022 11:19
edgerouter_node_exporter
#!/bin/bash
export ne_version=1.4.0
sudo systemctl stop node_exporter
# sudo systemctl status node_exporter
ps -eaf | grep node_exporter
#!/bin/bash
# git rev-list HEAD | while read commitHash; do
# if [ $(git diff-tree --name-status --no-commit-id $commitHash | wc -l) -eq 0 ]; then
# echo $commitHash
# fi;
# done
export FILTER_BRANCH_SQUELCH_WARNING=1
# config file for ansible -- https://ansible.com/
# =======================================================
# Nearly all parameters can be overridden in ansible-playbook
# or with command line flags. Ansible will read ANSIBLE_CONFIG,
# ansible.cfg in the current working directory, .ansible.cfg in
# the home directory, or /etc/ansible/ansible.cfg, whichever it
# finds first
# For a full list of available options, run ansible-config list or see the
# documentation: https://docs.ansible.com/ansible/latest/reference_appendices/config.html.
FROM alpine:3.16.2
MAINTAINER "docker@ginhoux.net"
LABEL maintainer="docker@ginhoux.net"
LABEL image="ginhoux.net/mysqldump-cron"
LABEL tag="v4-alpine3.16.2"
LABEL description=""
RUN apk add --no-cache mysql-client tzdata && \
echo "Europe/Paris" > /etc/timezone
FROM alpine:3.16.2
MAINTAINER "docker@ginhoux.net"
LABEL maintainer="docker@ginhoux.net"
LABEL image="ginhoux.net/pgdump-cron"
LABEL tag="v5-alpine3.16.2"
LABEL description=""
RUN apk add --no-cache postgresql-client tzdata && \
echo "Europe/Paris" > /etc/timezone
FROM alpine:3.16.2
MAINTAINER "docker@ginhoux.net"
LABEL maintainer="docker@ginhoux.net"
LABEL image="ginhoux.net/powerdns-authorative"
LABEL tag="4.6.3-alpine-3.16.2"
LABEL description=""
### bash split
${var#*SubStr} # will drop begin of string up to first occur of `SubStr`
${var##*SubStr} # will drop begin of string up to last occur of `SubStr`
${var%SubStr*} # will drop part of string from last occur of `SubStr` to the end
${var%%SubStr*} # will drop part of string from first occur of `SubStr` to the end
string="}
echo $string | cut -d';' -f1 # output is 1
## splitter un fichier en plusieurs
## creer fichier template
for i in {0..100000000};do echo "}
## 1- par nombre de ligne
split -d -l50000 texte.txt suffix-
## 2- par quantité
split -d -n4 texte.txt suffix-