Skip to content

Instantly share code, notes, and snippets.

View remyj38's full-sized avatar

Rémy Jacquin remyj38

View GitHub Profile
@remyj38
remyj38 / gist:904daff5fa1e11939303688ec7ce3827
Created January 5, 2022 18:26
Suppression popup cookies lemonde.fr
// ==UserScript==
// @name Supprimer bannier abonnement + popup
// @version 0.5
// @match https://www.lemonde.fr/*
// @icon https://www.google.com/s2/favicons?domain=lemonde.fr
// @grant none
// ==/UserScript==
(function() {
'use strict';
@remyj38
remyj38 / backup_gitlab.py
Last active July 8, 2018 12:23
GitLab repositories backup
#!/usr/bin/python3
# -*- coding: utf-8 -*-
'''
Clone and update all gitlab repositories, based on defined filters (current are your own private repsitories)
Repositories are cloned using SSH and SSH_KEY (automaticaly generated if not exists).
The SSH key will be automaticaly added as deployement key on each project
Requires :
- gitpython
@remyj38
remyj38 / raid_report.sh
Last active June 1, 2018 17:20
RAID Status email report
#!/bin/bash
mdadm="/sbin/mdadm"
logfile="/tmp/raid_report.tmp"
email="your_email@your_domain.com"
subject="RAID Status Report for `hostname -f`"
drives="md0 md1"
### Set email body ###
echo "<h2>$subject</h2>" > $logfile
@remyj38
remyj38 / smart_report.sh
Last active June 1, 2018 17:17 — forked from cfazendin/emailStatusReport.sh
Email reporting for disk health (SMART)
#!/bin/sh
### Parameters ###
smartctl="/usr/sbin/smartctl"
logfile="/tmp/smart_report.tmp"
email="your_email@your_domain.com"
subject="SMART Status Report for `hostname -f`"
drives="sda sdb"
tempWarn=40
tempCrit=45
@remyj38
remyj38 / drop_tables.sh
Created April 14, 2018 14:26
Drop all tables in MySQL database
#!/bin/bash
MUSER="$1"
MPASS="$2"
MDB="$3"
# Detect paths
MYSQL=$(which mysql)
AWK=$(which awk)
GREP=$(which grep)
@remyj38
remyj38 / raspberry-init.sh
Last active May 28, 2018 09:03
Raspberry init script (needs Wireless)
#!/bin/bash
if [ $# -eq 1 ] && [ $1 = "usage" ]; then
echo "Usage: $0 FQDN NEW_USERNAME USER_PASSWORD SSID PASSPHRASE COUNTRY KEYBOARD_LAYOUT TIMEZONE"
echo "Example: $0 rasbperry.home.local remy remy My-Wifi My-WiFiPassPhra5s3 FR fr \"Europe/Paris\""
exit 0
fi
if [ $# -ne 8 ]; then
# Configuring keyboard
@remyj38
remyj38 / install.sh
Last active April 14, 2018 14:33
[ABANDONNED] [WIP] Icinga installation from sources on raspberry pi zero
# Build Requirements
apt install -y libsystemd-dev cmake make build-essential pkg-config libssl-dev libboost-all-dev bison flex default-libmysqlclient-dev libyajl-dev libedit-dev nagios-plugins
# User and groups
groupadd icinga
groupadd icingacmd
useradd -c "icinga" -s /sbin/nologin -G icingacmd -g icinga icinga
usermod -a -G icingacmd www-data
# Download sources
@remyj38
remyj38 / ssl.conf
Created January 6, 2018 19:55
nginx ssl snippet
# Only include ssl_certificate, ssl_certificate_key and ssl_trusted_certificate in your server configuration
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_dhparam /etc/nginx/dhparam.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;