Skip to content

Instantly share code, notes, and snippets.

View maelvls's full-sized avatar

Maël Valais maelvls

View GitHub Profile
@maelvls
maelvls / connect.sh
Last active April 13, 2018 17:17
Petit script pour tous les gens se connectant en filaire (et même en wifi) aux réseaux du CROUS à Toulouse. Gaffe à votre mot de passe, car là il est en clair !
#!/bin/sh
# connect.sh
#
# Petit script pour se connecter aux servs du CROUS à la cité U Rangueil
# Auteur: mael.valais@univ-tlse3.fr
# Mis à jour le 9.2.2013
# Version 0.2
# Attention :
@maelvls
maelvls / logIp.sh
Created February 24, 2013 00:00
Pour garder un log des adresses IP sur une interface en particulier Je l'utilise pour étudier les attributions DHCP et comparer les débits liés
#! /bin/sh
# Cree par Mael Valais le 29 janvier 2013
#
# Traque les changements d'adresse IP sur une interface donnée
#
# Je m'en sers pour étudier les patterns d'ip du CROUS
# et mieux connaitre le plan du réseau
#
@maelvls
maelvls / .vimrc
Last active September 27, 2017 16:32
Mon .vimrc (attention ! il est nul)
" Mes raccourcis :
" ctrl+b pour nerdtree
" ctrl+l pour tabbar
" ctrl + p pour débugguer
" ctrl + w + fleches pour changer de fenetre
" cmd + b pour make
" ctrl + b pour nerd-tree
" :A pour switcher header/implementation (A-VIM)
" u pour annuler
" /recherche pour les regex
@maelvls
maelvls / c.snippets
Last active December 14, 2015 04:08
Some snippets I added to my "c.snippets". For snipMate (VIM)
## Brackets
# Because I wanted a convenient way to reproduce the Xcode behaviour when {-returning
snippet {
{
${1}
}
## Comments
# to make it easier to comment my work
snippet /*
/* ${1} */
@maelvls
maelvls / dot_to_gif.sh
Last active August 22, 2021 15:19
A script for creating a GIF using a set of DOT files representing successive versions of a tree.
#! /usr/bin/env bash
#
# (MIT license)
# Copyright 2013 Mael Valais <mael.valais@gmail.fr>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@maelvls
maelvls / arduino.ino
Last active July 8, 2022 10:47
Micro-programme de l'Arduino pour le contrôle des relais de la monture équatoriale par l'ordinateur de contrôle.
/*
* arduino.ino
*
* Description :
* Ce fichier permet de programmer l'Arduino One tel qu'il réponde aux
* commandes envoyées par l'ordinateur connecté par son port USB.
* Arduino enverra alors les commandes aux relais de la monture équatoriale
* à travers les DIGITAL PINS (les pins de 2 à 12).
*
* NOTE : les pins 0 et 1 sont déjà utilisés par défaut pour la com. série
@maelvls
maelvls / .bashrc
Last active August 29, 2015 14:01
.bashrc
PS1=$'\\[\\033[1;33m\\]\\u\\[\\033[1;37m\\]@\\[\\033[1;32m\\]\\h\\[\\033[1;37m\\]:\\[\\033[1;31m\\]\\w \\[\\033[1;36m\\]\\$ \\[\\033[0m\\]'
PS2=$'> '
PS4=$'+ '
alias ls='ls -G'
@maelvls
maelvls / Makefile
Last active January 23, 2023 12:02
Exemple de Makefile où j'ai noté tout ce que j'avais appris sur Makefile/make
#
# ANCIEN MAKEFILE Inutile maintenant ; on utilisera ./configure; make
#
# makefile
# Mael Valais, 2014-04-07 15:23
#
# Makefile permettant la compilation du projet climso-auto
# NOTE: les # */ sont là à cause de Xcode
#
# A faire :
@maelvls
maelvls / gist:97bb79a15d3eb5587379
Created March 15, 2015 13:26
How I installed win32-ocaml with x8on mac os 10.9

I installed the i686-w64-mingw32 and x86_64-w64-mingw32 versions of gcc. This was the hardest thing to do because of many errors. I used this script: https://gist.github.com/Drakulix/9881160

Then, I did opam install win32-ocaml. It was returning the famous clang: error: unknown argument: '-fno-defer-pop' error. I saw that the log.out showed that the -cc gcc -m32 option was used. So I chose to select another gcc (gcc-4.9 that I had previously installed) to avoid the clang issue.

So I went into ~/.opam/4.01.0+clang-fix/build/win32-ocaml.4.01.0 and I fixed the ./configure call:

./configure -prefix /Users/maelv/.opam/4.01.0+clang-fix/i686-w64-mingw32 -bindir /Users/maelv/.opam/4.01.0+clang-fix/i686-w64-mingw32/bin         -mandir /Users/maelv/.opam/4.01.0+clang-fix/build/win32-ocaml.4.01.0/no-man -cc "gcc-4.9 -m32" -as "gcc -m32" -aspp "gcc-4.9 -m32 -c" -no-pthread -no-camlp4

And make and that's it!

@maelvls
maelvls / dimacs_to_dot.py
Last active April 27, 2019 01:33
DIMACS Maximum Flow to .dot (GraphViz) converts from DIMACS to DOT format. I did this script to visualize the results from the `pseudo-flow` algorithm written by Hochbaum (http://lpsolve.sourceforge.net/5.5/DIMACS_maxf.htm). Short link: https://git.io/vdhsz
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright 2015 Mael Valais <mael.valais@univ-tlse3.fr>
#
# Distributed under terms of the MIT license.
#
__descr__ = """
This script is a parser from DIMACS to DOT that helps you transform