Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / retirer_www.sh
Created December 31, 2015 15:57
Pour enlever le [ www.Cpasbien.io]
ls | while read i; do mv "$i" "`echo $i | sed "s/\[www\..*\]\(\)/\1/" | tr -d " "`"; done
@maelvls
maelvls / Makefile
Last active September 27, 2017 09:13
Pour utiliser : ./game --console
OCAMLC = ocamlc -thread -g
OCAMLYACC = ocamlyacc
OCAMLLEX = ocamllex
SOURCES = \
common.ml \
quad.ml \
vm.ml \
karel.ml \
wparser.mly \
@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 / touist.rb
Last active October 19, 2017 09:06
class Touist < Formula
desc "The solver for the TouIST language"
homepage "https://www.irit.fr/touist"
url "https://github.com/touist/touist/archive/v3.4.0.tar.gz"
sha256 "6872383092a00d762188a972b203939df892baa7d3218aa94c54b2d0f6e59b08"
revision 1
head "https://github.com/touist/touist.git", :shallow => false
# We use the git history for `git describe --tags`, so no shallow clone
bottle do
@maelvls
maelvls / AMC-Homebrew-formula.md
Last active January 4, 2018 13:38
A formula for auto-multiple-choice (documentation is optionally built)
@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 :