This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Avoids obstacles with the infrared sensor. | |
# | |
import time | |
from ev3.lego import LargeMotor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import json | |
import httplib2 | |
from datetime import datetime | |
from apiclient.discovery import build | |
from oauth2client.client import OAuth2WebServerFlow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import sys | |
import csv | |
import urllib2 | |
from contextlib import contextmanager | |
POSTAL_CODES = "https://www.data.gouv.fr/s/resources/base-officielle-des-codes-postaux/20141106-120608/code_postaux_v201410.csv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
servername="Server" | |
for ip in echo `grep -i unban /var/log/fail2ban.log | awk '{print $NF}' | tail -n 10` | |
do | |
for email in `whois $ip | perl -wne'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&\n"}' | sort | uniq` | |
do | |
echo "Sending email to $email..." | |
echo "Hi, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import json | |
import requests | |
# https://github.com/CIRCL/bgpranking-redis-api/tree/master/example/api_web/client | |
from bgpranking_web import api | |
with open("/var/log/fail2ban.log", "r") as f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import pylab | |
import glob | |
from collections import Counter | |
from PIL import Image |
NewerOlder