Skip to content

Instantly share code, notes, and snippets.

View lodi-g's full-sized avatar

Grégoire Lodi lodi-g

  • Stockholm
View GitHub Profile
@lodi-g
lodi-g / HOWTO.md
Created March 14, 2021 14:19
How to setup a send-only mail server with TLS and SMTP credentials (postfix, submission, CyrusSASL)

Prepare server

  • sudo hostnamectl set-hostname example.com
  • sudo apt install mailutils postfix
    • Choose "internet site", and type your domain (example.com)

Test postfix

  • mail your-test@yopmail.com -s "Subject"
  • You should receive a mail from debian@example.com
// ==UserScript==
// @name Show grades
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Show grades. Reload page if the button does not appear.
// @author You
// @match https://intra.epitech.eu/module/*/note/
// @grant none
// @run-at document-start
// ==/UserScript==
@lodi-g
lodi-g / howto.txt
Last active November 8, 2021 17:33
How to post code on Discord?
Use `my one line block` to post a one line block.
Use
```c
#include <stdio.h>
int main(void) {
printf("Hello, World!\n");
}
```
to post a multi-line block, where 'c' is the coding language (c, cpp, java, js, rust, etc)
@lodi-g
lodi-g / dump.h
Last active July 30, 2022 01:58
Dump a variable content regardless of its type. Using the C11 _Generic keyword to emulate PHP's var_dump function.
#pragma once
/*
** Using printf, strlen and isprint
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
/*
@lodi-g
lodi-g / speedTestPlot.js
Last active May 26, 2017 10:37
Just a script to plot your download speed. Useful when you want to call your ISP and shit on them. Oh, and data is always sorted by timestamp.
#!/usr/bin/env node
/*
* How to:
* Have a working UNIX environment
* Download speedtest-cli
* -- in bash
* for i in {0..100}; do speedtest --no-upload --json >> dlspeed.json; done
* ./speedTestPlot.js dlspeed.json
* -- comments
@lodi-g
lodi-g / phprun.sh
Last active April 11, 2017 15:27
Use phpvm easily
#!/usr/bin/bash
scriptname=`basename $0`
usage() {
echo "Usage: `basename $scriptname` file [version]*."
echo "Version will be ${versions[0]} by default."
exit 0
}
@lodi-g
lodi-g / hex_to_bg.user.js
Last active April 9, 2017 23:18
Change hex codes by setting its associated color as background color
// ==UserScript==
// @name hex to bg color
// @namespace lodi-g
// @version 0.1
// @description Change hex codes by setting its associated color as background color
// @author lodi-g
// @match *://*/*
// @require https://raw.githubusercontent.com/padolsey/findAndReplaceDOMText/master/src/findAndReplaceDOMText.js
// @grant none
// ==/UserScript==
@lodi-g
lodi-g / provence_alpes_cote_azur.user.js
Created March 12, 2017 20:23
Userscript for EPITECH's intranet. Probably the best userscript you could ever find.
// ==UserScript==
// @name PROVENCE ALPES COTES D'AZUR
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://intra.epitech.eu/user/claude-andrea.packa@epitech.eu/
// @grant none
// ==/UserScript==
@lodi-g
lodi-g / install_qcm_ci.sh
Created March 3, 2017 18:12
Install script for a private repository
#!/bin/bash
QCM_CI_FOLDER="/mnt/home/exam/QCM-CI/"
function error {
echo
echo "Failed. Exiting."
if [ -z $1 ]; then
echo "Umounting /mnt."
sudo umount /mnt
@lodi-g
lodi-g / yammer2intra.user.js
Last active March 4, 2017 16:52
Just adds a link to EPITECH intranet from the Yammer social networking website.
// ==UserScript==
// @name Yammer2Intra
// @namespace lodi_g
// @include https://www.yammer.com/epitech.eu/*
// @version 0.1
// @grant none
// ==/UserScript==
const debuggingEnabled = false;
const imageUrl = "https://intra.epitech.eu/favicon.ico";