Skip to content

Instantly share code, notes, and snippets.

View samerlahoud's full-sized avatar

Samer Lahoud samerlahoud

View GitHub Profile
@samerlahoud
samerlahoud / coalition-graph.py
Created April 29, 2018 19:20
Coalitions in the Lebanese Parliamentary Elections 2018
#!/usr/bin/python
import networkx as nx
import json
coalition_graph=nx.Graph()
with open("./coalitions.txt",'r') as coalition_file:
for line in coalition_file:
party_list = line.rstrip('\n').split(' - ')
for i in range(0,len(party_list)):
@samerlahoud
samerlahoud / anchor-voronoi-cells.py
Created February 11, 2018 09:44
RIPE Atlas Anchors Voronoi
#!/usr/bin/python
from scipy.spatial import Voronoi, voronoi_plot_2d
from ripe.atlas.cousteau import AnchorRequest
import mplleaflet
filters = {"status": 1}
anchors = AnchorRequest(**filters)
xy = []
#!/usr/bin/python
### Samer Lahoud http://samer.lahoud.fr
import json
import os
import matplotlib.pyplot as plt
from scipy.spatial import Voronoi, voronoi_plot_2d
import numpy as np
import mplleaflet
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{"type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coordinates": ["-122.424612993055", "37.8014488257836"]}, "type": "Feature", "id": 0, "properties": {"date": "02/18/2003", "description": "FORGERY, CREDIT CARD", "title": "FRAUD"}}, {"geometry": {"type": "Point", "coordinates": ["-122.420120319211", "37.7877570602182"]}, "type": "Feature", "id": 1, "properties": {"date": "04/17/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.42025048261", "37.7800745746105"]},
@samerlahoud
samerlahoud / gist:4198896
Created December 3, 2012 22:58
mr3020 config
root@mr3020:~# mount_root
root@mr3020:~# firstboot
root@mr3020:~# vi /etc/config/network
config interface 'lan'
option ifname 'eth0'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.66'
@samerlahoud
samerlahoud / gist:4189022
Created December 2, 2012 14:34
Openwrt mr-3020 network and wireless config
vi /etc/config/network
config interface 'lan'
option ifname 'eth0'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.66'
option netmask '255.255.255.0'
option gateway '192.168.1.1'
list dns '192.168.1.1'
vi /etc/config/network
config interface 'lan'
option ifname 'eth0'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.66'
option netmask '255.255.255.0'
option gateway '192.168.1.1'
list dns '192.168.1.1'
list dns '8.8.8.8'