Skip to content

Instantly share code, notes, and snippets.

View superboum's full-sized avatar
💮
Working for Deuxfleurs

Quentin Dufour superboum

💮
Working for Deuxfleurs
View GitHub Profile
@superboum
superboum / main.cf
Last active August 29, 2015 14:18
Postfix Configuration
message_size_limit = 204800000 # Big attachement file, not safe in prod :p
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
@superboum
superboum / .vimrc
Created June 26, 2015 14:23
My vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
" call vundle#begin('~/some/path/here')
Plugin 'gmarik/Vundle.vim'
@superboum
superboum / package.json
Created June 30, 2015 10:49
Gandi Simple Hosting - NodeJS Scripts - For Gulp + Babel (ES6 Harmony)
{
"name": "package",
"version": "0.0.1",
"description": "package",
"main": "server.js",
"scripts": {
"postinstall": "sh ./scripts/postinstall",
"deploy": "git push gandi develop:master && ssh [email protected] 'deploy default.git'"
},
"engines": {
@superboum
superboum / rapport.tex
Last active September 7, 2015 16:44
Couverture rapport de stage INSA Rennes
% Largement pompé sur http://blog.hikoweb.net/index.php?post/2011/11/06/Exemple-de-rapport-en-LaTeX
\documentclass[a4paper,11pt,final]{article}
% Pour une impression recto verso, utilisez plutôt ce documentclass :
%\documentclass[a4paper,11pt,twoside,final]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{listings}
@superboum
superboum / movie_to_gif.sh
Last active September 24, 2015 08:15
Create an optimized gif from a video with ffmpeg
#!/usr/bin/env bash
ffmpeg -y -ss 0:02 -t 6 -i ./VID_20150816_151940.mp4 \
-vf fps=20,scale=400:-1:flags=lanczos,palettegen palette.png
ffmpeg -ss 0:02 -t 6 -i ./VID_20150816_151940.mp4 -i palette.png -filter_complex \
"fps=20,scale=400:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif
# Other not so good possibilities
#
#ffmpeg -t 4 -ss 2:05 -i ./vid.mp4 output.gif
@superboum
superboum / test-tcp.sh
Last active November 4, 2015 12:58
Test Open Port
#!/bin/bash
PORT=80
printf "\n===\nNEW SCAN\n===\n" >> ./res.txt
while [ $PORT -le 1000 ]
do
curl --max-time 1 http://portquiz.net:$PORT 1>> ./res.txt 2> /dev/null
if [ $? -eq 0 ]; then
printf "x"
@superboum
superboum / main.js
Last active April 2, 2016 21:08
Query mc.quarahtk.org API and parse data to extract nether brick used by selected players
const http = require('http');
/**********************
* L I B R A R Y
**********************/
/**
* Make a request on the API
* @param host hostname of the server, ex: mc.quarahtk.org
@superboum
superboum / 01_Reader.java
Created April 23, 2016 15:39
Regex with Java (named Pattern)
import java.io.*;
import java.util.regex.*;
public class Reader {
public static void main(String[] args) {
try {
String[] cols = {"pion", "x", "y", "joueur", "jouable"};
String filename = "standard.txt";
String line = null;
Pattern p = Pattern.compile("-?\\d+");
@superboum
superboum / git-fatfiles.sh
Last active August 3, 2016 17:15
Git helpers
# Based on:
# http://stackoverflow.com/questions/1029969/why-is-my-git-repository-so-big
git rev-list --all --objects | \
sed -n $(git rev-list --objects --all | \
cut -f1 -d' ' | \
git cat-file --batch-check | \
grep blob | \
sort -n -k 3 | \
tail -n200 | \
@superboum
superboum / nombres.py
Created August 29, 2016 09:54
Les types 'int' et 'str' en python
# On veut opérer un traitement sur le nombre 1234 qui remplacera tous les 1 par des 9, puis multiplie le nouveau nombre par 2.
def traitement(nombre):
# La on devrait avoir un entier
print(type(nombre), nombre, "--> nombre entier 'int' donné par l'utilisateur")
# On va convertir ce nombre en chaine de charactère
# str(x) prend en parametre x un entier et retourne une chaine de charactère
nombre = str(nombre)
# On regarde le type et la valeur de la chaine de charactère