Skip to content

Instantly share code, notes, and snippets.

View antlas0's full-sized avatar

Antoine4 antlas0

View GitHub Profile
@antlas0
antlas0 / configure_gaulix.sh
Created March 24, 2025 16:14
Gaulix configuration
#!/bin/bash
# This script sets up a meshtastic node fitting to french "Gaulix" network
# https://gaulix.fr
# Requires meshtastic python3 module installed
# delete channels
for i in 1 2 3 4;do
meshtastic --ch-index $i --ch-del
done
@antlas0
antlas0 / meshtastic_gaulix_configure.sh
Last active September 6, 2024 10:39
Programmatically setup a meshtastic node fitting Gaulix network configuration.
#!/bin/bash
# This script sets up a meshtastic node fitting to french "Gaulix" network
# https://wiki.fr-emcom.com/gaulix_reseau_meshtastic_-_france:1:start
# This current config tends to set up a rather "hidden" node
# this script is a starting point, be sure to tune your config accordinlgy
# Requires meshtastic python3 module installed
# delete channels
for i in 1 2 3 4;do
@antlas0
antlas0 / report.py
Created August 27, 2024 08:04
Sending email system report
#!/usr/bin/env python3
# sends server status by email
import os
import re
import subprocess
import smtplib
import datetime
from email.mime.text import MIMEText
@antlas0
antlas0 / Dockerfile
Created August 27, 2024 08:00
Add timestamps to SFTP server
FROM atmoz/sftp:alpine
# Redirect to a file
# Add timestamps
# Please consider performances complexity for large user activity
CMD ["/bin/sh", "-c", "/usr/sbin/sshd -D -e 2>&1 | while read line; do printf '[%s] %s\n' \"$(date '+%Y-%m-%d %H:%M:%S')\" \"$line\" >> /var/log/sftp.log;done"]
@antlas0
antlas0 / count_vulnerabilities.tpl
Created January 25, 2024 08:00
Trivy template files
{{- $critical := 0 }}
{{- $high := 0 }}
{{- $medium := 0 }}
{{- $low := 0 }}
{{- range . }}
{{- range .Vulnerabilities }}
{{- if eq .Severity "CRITICAL" }}{{- $critical = add $critical 1 }}{{- end }}
{{- if eq .Severity "HIGH" }}{{- $high = add $high 1 }}{{- end }}
{{- if eq .Severity "MEDIUM" }}{{- $medium = add $medium 1 }}{{- end }}
@antlas0
antlas0 / prometheus_to_csv.py
Last active March 6, 2024 12:10
Export Prometheus metrics to CSV file.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import sys
import logging
import datetime
import argparse
import configparser
@antlas0
antlas0 / nginx.sample.conf
Created December 19, 2023 15:21
nginx with LDAP auth
[...]
http {
ldap_server ldap_local {
url "ldap://172.17.0.1:389/dc=prod,dc=company,dc=com?uid?sub?(objectClass=posixAccount)";
binddn "cn=readonly,dc=prod,dc=company,dc=com";
binddn_passwd "readonly";
require group "cn=production,dc=prod,dc=company,dc=com";
group_attribute "memberUid";
group_attribute_is_dn off;
@antlas0
antlas0 / tcptraceroute.c
Last active July 25, 2024 08:56
Small script that does a traceroute using TCP
#include <unistd.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <ifaddrs.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <netdb.h>
@antlas0
antlas0 / Dockerfile
Created December 12, 2023 19:25
Dockerfile containing WhatWeb utility https://github.com/urbanadventurer/WhatWeb
FROM debian:11
RUN apt-get update
# tools
RUN apt-get install -y \
git \
make \
gcc
@antlas0
antlas0 / software_endoflife.py
Created December 12, 2023 13:19
Quickly tell if a software is going to be unsupported, using the https://endoflife.date website
#!/usr/bin/env python3
import sys
import logging
import argparse
import requests
import datetime
from typing import Optional, List, Union
from dataclasses import dataclass