Skip to content

Instantly share code, notes, and snippets.

View Dewep's full-sized avatar

Maigret Aurélien Dewep

View GitHub Profile
@Dewep
Dewep / aes-128-cbc
Last active March 30, 2017 19:56
aes-128-cbc
root@toto:~# echo -n 0000000000000000 | xxd -g 0
0000000: 30303030303030303030303030303030 0000000000000000
root@toto:~# echo -n 1234567890 | openssl aes-128-cbc -e -K 30303030303030303030303030303030 -iv 00000000000000000000000000000000 | md5sum
aa8301604be724a92e1f223e14caea68 -
root@toto:~# python2 -c 'import sys, Crypto.Cipher.AES as A; sys.stdout.write(A.new("0"*16, A.MODE_CBC, "\0"*16).encrypt("1234567890\6\6\6\6\6\6"))' | md5sum
aa8301604be724a92e1f223e14caea68 -
@Dewep
Dewep / Hangout-emoticon-shortcuts.json
Last active August 29, 2015 14:24
Hangout emoticon shortcuts
Toa = {
"(=^..^=)": 128568,
"(=^.^=)": 128568,
"(N)": 128078,
"(Y)": 128077,
"(]:{": 128115,
"(n)": 128078,
"(y)": 128077,
"-<@%": 128029,
"-_-": 128529,
@Dewep
Dewep / readme.md
Created July 28, 2015 09:26
Number of messages of a messenger conversation

Go on Graph API Explorer.

Select the FQL Query option, and write this type of request:

SELECT message_count FROM thread WHERE thread_id = 729596603755180
{
 "data": [
@Dewep
Dewep / readme.md
Created July 28, 2015 13:06
Test preload image Google
#> python send_email.py
#> python server.py
Serving HTTP on 0.0.0.0 port 8000 ...
*************
Host: my-server.com:8000
Connection: Keep-alive
@Dewep
Dewep / epitechDefense-to-Doodle.js
Last active August 25, 2015 22:31
Epitech defense to Doodle
(function(){
EpitechDoodle = EpitechDoodle || {};
$.ajax({
"url": window.location.origin + window.location.pathname + "?format=json",
dataType: "json"
}).success(function(data){
var fields = {
"type": "date",
"levels": 3,
"title": data.title,
@Dewep
Dewep / pi.py
Last active October 9, 2015 18:47
ApproximationOfPI
from random import uniform
from math import fabs
from sys import argv
interface = len(argv) > 1
if interface:
import turtle
N = 100000000
ran = 1.5
@Dewep
Dewep / task.py
Last active October 29, 2015 18:12
Natural computation assessment #1
#!/usr/bin/env python3
__author__ = "Maigret Aurelien"
"""
$> python3 task.py
| pos x y | north | east | south | west | nomove | proba | stddev | probabilities
| --------- | ------- | ------ | ------- | ------ | -------- | ------- | -------- | ---------------
| 7 (0,0) | 0 | 1/4 | 1/6 | 0 | 7/12 | 0.090 | 0.003 | 0.090 0.087 0.094 0.085 0.088 0.090 0.091 0.093
| 8 (0,1) | 0 | 1/4 | 1/6 | 1/4 | 1/3 | 0.046 | 0.002 | 0.047 0.047 0.043 0.047 0.044 0.047 0.050 0.047
@Dewep
Dewep / logstash-nginx-error.conf
Created November 21, 2015 14:47
LogStash Grok - Match Nginx error - With multiline errors
input {
stdin {
}
}
filter {
mutate {
replace => {
"type" => "nginx-error"
}
@Dewep
Dewep / auto-rescroll.html
Last active October 5, 2016 16:03
Timeout child scrollable
<!DOCTYPE>
<html>
<head>
<title>Test</title>
<style>
body { width: 200px; margin: 0 auto; }
.hide { display: none; }
#parent { height: 400px; overflow: auto; border: 1px solid #eee; margin-top: 30px; text-align: center; }
</style>
</head>
@Dewep
Dewep / csv.html
Created October 25, 2016 16:03
JavaScript CSV Download
<!DOCTYPE>
<html>
<head>
<title>CSV</title>
</head>
<body>
<script type="text/javascript">
(function(){
function objectToCSV(content, separator) {
var str = ''