Skip to content

Instantly share code, notes, and snippets.

Francesco Frassinelli frafra

Block or report user

Report or block frafra

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@frafra
frafra / osmstats.py
Last active Jun 28, 2018
OpenStreetMap "Top 500" from neis-one.org
View osmstats.py
#!/usr/bin/env python3
import hug # fades
import enum
import html.parser
import json
import urllib.request
class Table(enum.Enum):
STATISTICS = enum.auto()
@frafra
frafra / fake-usb-tester.py
Last active May 11, 2018
Detect fake USB drives
View fake-usb-tester.py
#!/usr/bin/env python3
#
# WARNING: This program will OVERWRITE the entire device and
# you may LOSE DATA. Use it carefully.
# How to create a test block device:
# $ dd if=/dev/zero of=fake bs=1M count=100
# # mknod fake b 7 200
# # losetup /dev/fake fake
@frafra
frafra / gpap-notes2geojson.sql
Last active Apr 6, 2018
From GeoPaparazzi notes to OpenStreetMap through GeoJSON
View gpap-notes2geojson.sql
/*
Description:
This query allows to convert notes from GeoPaparazzi into a GeoJSON
file that can be imported into JOSM.
Usage:
$ sqlite3 geopaparazzi.gpap < gpap-notes2geojson.sql > geopaparazzi.geojson
Made by:
Francesco Frassinelli - https://frafra.eu
*/
with osm as (
@frafra
frafra / gpap-notes2osm.sql
Last active Apr 6, 2018
From GeoPaparazzi notes to OpenStreetMap XML
View gpap-notes2osm.sql
/*
Description:
This query allows to convert notes from GeoPaparazzi into a OSM XML
file that can be imported into JOSM.
Usage:
$ sqlite3 geopaparazzi.gpap < gpap-notes2osm.sql > geopaparazzi.osm
Made by:
Francesco Frassinelli - https://frafra.eu
*/
with body as (
@frafra
frafra / tags.json
Created Apr 6, 2018
addr:street/addr:housenumber simple preset for GeoPaparazzi
View tags.json
[{
"sectionname": "addresses",
"sectiondescription": "addresses",
"forms": [{
"formname": "address",
"formitems": [{
"key": "addr:street",
"value": "",
"type": "string",
"mandatory": "no"
@frafra
frafra / 05-batman
Last active Apr 4, 2018
NetworkManager integration with batman-adv
View 05-batman
#!/bin/sh
#
# /etc/NetworkManager/dispatcher.d/05-batman
ESSID="Igloo mesh"
IFACE="wlp2s0"
ADDR="01:23:45:67:89:AB"
function current {
nmcli -t -f GENERAL.CONNECTION d show $IFACE | cut -d\: -f2
@frafra
frafra / osm-node-history.py
Last active Feb 23, 2018
OSM node history (just a test)
View osm-node-history.py
#!/usr/bin/env python3
#
# OSM node history to SQLite
import osmium
import sqlite3
import sys
SCHEMA_NODES = """
CREATE TABLE nodes
View keybase.md

Keybase proof

I hereby claim:

  • I am frafra on github.
  • I am frafra (https://keybase.io/frafra) on keybase.
  • I have a public key ASD1qB8afeWaO_4u5Wd4Ug5EIYYyt17plvfPIfK3BMeo9go

To claim this, I am signing this object:

@frafra
frafra / schiena-dritta.py
Last active Jan 17, 2018
Simple adaptive notification system
View schiena-dritta.py
#!/usr/bin/env python3
#
# License: GPLv3
# Author: Francesco Frassinelli (fraph24@gmail.com)
# Copyright: Francesco Frassinelli 2018
import gi
gi.require_version('Notify', '0.7')
from gi.repository import GLib, Notify
@frafra
frafra / pylife.py
Created Aug 29, 2017
Bruteforce Conway's "Game of Life"
View pylife.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Francesco Frassinelli <fraph24@gmail.com>
#
# pylife is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
You can’t perform that action at this time.