Skip to content

Instantly share code, notes, and snippets.

View freegeoip.py
# Fetch latitude and longitude from freegeoip
import urllib2
import json
def geo(ip=''):
g = urllib2.urlopen('http://freegeoip.net/json/%s' % ip)
geo = json.loads(''.join(g))
return geo['latitude'], geo['longitude']
geo()
@defeo
defeo / clic-2014.geojson
Last active Aug 29, 2015 — forked from anonymous/map.geojson
Geotags for CLIC 2014 conference
View clic-2014.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@defeo
defeo / apt.sh
Last active Aug 29, 2015
Install gitk and git-gui on CN
View apt.sh
sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ saucy main universe multiverse"
sudo apt-get update
sudo apt-get -y install git-gui git-svn gitk
@defeo
defeo / ss-graphs
Created Feb 28, 2015
Problems on supersingular graphs and crypto
View ss-graphs
Let $p≠2,3$ be a prime, and $\mathbb{F}_p$ the finite field with $p$ elements. We will use the following notation:
- $ℓ,ℓ_0,ℓ_1$ are primes bounded by $\DeclareMathOperator{\poly}{poly}\poly(\log p)$.
- $m,n$ are $\poly(\log p)$-smooth integers bounded by $\poly(p)$, with $m∧n=1$.
- $E, E_0, E_1, \dots$ are supersingular elliptic curves defined over $\mathbb{F}_{p^2}$.
- $j(E)$ is the $j$-invariant of $E$.
- $\DeclareMathOperator{\End}{End}\End(E)$ is the endomorphism ring of $E$.
- $B_{p,∞}$ is the quaternion algebra ramified at $p$ and infinity.
- $\newcommand{\O}{\mathcal{O}}\O, \O_0, \O_1, \dots$ are maximal orders of $B_{p,∞}$.
- $I, I_0, I_1, \dots$ are left ideals of some maximal order $\O$.
@defeo
defeo / reflector.js
Last active Aug 29, 2015
Reflector, tutorial for Applications Web & Sécurité (http://defeo.lu/aws)
View reflector.js
var express = require('express');
var bodyP = require('body-parser');
var cookieP = require('cookie-parser');
var app = express();
// Configuration des middlewares
app
.use(bodyP.urlencoded( { extended: false } ))
.use(cookieP());
@defeo
defeo / app.js
Last active Aug 29, 2015
Templates, données, état
View app.js
var express = require('express'),
bodyP = require('body-parser'),
twig = require('twig');
var app = express();
app.set('views', '.');
app.use(bodyP.urlencoded({ extended : false }))
.use('/s', express.static('.'));
View app.js
var express = require('express'),
bodyP = require('body-parser'),
twig = require('twig'),
mysql = require('mysql');
var app = express();
app.set('views', '.');
app.use(bodyP.urlencoded({ extended : false }));
@defeo
defeo / apt.sh
Created Apr 9, 2015
Install ipython and pandas
View apt.sh
sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ saucy main universe multiverse"
sudo apt-get update
sudo apt-get -y install ipython-notebook python-pandas
View apt.sh
sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ saucy main universe multiverse"
sudo apt-get update
sudo apt-get -y install ipython-notebook python-nxt python-usb
View favicon.html
<link rel="shortcut icon" href="//bits.wikimedia.org/favicon/wikipedia.ico" />
<!--
Cette page HTML utilise le favicon de Wikipedia. Visitez
https://cdn.rawgit.com/defeo/7fa828e7155145b6005a/raw/favicon.html
-->