Skip to content

Instantly share code, notes, and snippets.

View dginhoux's full-sized avatar

Dany GINHOUX dginhoux

View GitHub Profile
echo "GET /" > /dev/tcp/192.168.175.140/80
echo "data" > /dev/udp/192.168.175.10.53
## tcp one port
ip=192.168.175.140 ; port=80 ; timeout 1 bash -c "</dev/tcp/$ip/$port && echo $ip port tcp/$port open || echo $ip port tcp/$port closed" 2>/dev/null || echo $ip port tcp/$port connection timeout 2>/dev/null
## udp range port
ip=192.168.175.140 ; for port in $(seq 1 65535); do timeout 1 bash -c "</dev/tcp/$ip/$port && echo $ip port tcp/$port open || echo $ip port tcp/$port closed" 2>/dev/null || echo $ip port tcp/$port connection timeout 2>/dev/null; done
## 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-
### 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
FROM alpine:3.16.2
MAINTAINER "[email protected]"
LABEL maintainer="[email protected]"
LABEL image="ginhoux.net/powerdns-authorative"
LABEL tag="4.6.3-alpine-3.16.2"
LABEL description=""
FROM alpine:3.16.2
MAINTAINER "[email protected]"
LABEL maintainer="[email protected]"
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 "[email protected]"
LABEL maintainer="[email protected]"
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
# 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.
#!/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
@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