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 / chromecast-and-linux.md
Last active Sep 22, 2019
Tricks to use Chromecast on GNU/Linux systems
View chromecast-and-linux.md

No weird or unmaintained softwares or libraries are involved in this guide, just VLC, Avahi and youtube-dl.

VLC + Chromecast

VLC supports Chromecast since version 3.0.0 (2018-02-09). Just go to Playback -> Renderer.

vlc --sout "#chromecast" --sout-chromecast-ip=$IP --demux-filter=demux_chromecast "$input"
@frafra
frafra / ls-contributed-to.sh
Created Jan 21, 2019
Like `ls -1` but marks path modified by a specific author or a company
View ls-contributed-to.sh
#!/bin/bash
#regex="@nina.no$"
regex="$1"
function check {
git log --format="%ae" "$1" | grep -q "$regex"
}
check '.' && echo " * ." || echo " ."
View cheap-vps.md

VPS cheaper than 5 €/month

Hetzner

Starting from 2.50 €/month (CX11).

Pro:

  • Custom operating systems via recovery mode
  • Good reputation
@frafra
frafra / sotm2018-slides-check.sh
Last active Aug 18, 2018
Script for check slides availability for SotM 2018
View sotm2018-slides-check.sh
#!/bin/bash
#
# Run this script inside the openstreetmap/stateofthemap-2018 repository
rm -f slides.csv
(for talk in _posts/schedule/*.md; do
slide=$(basename $talk .md | cut -d'-' -f4-)
echo -n $slide
for field in "time" "room" "authors"; do
echo -n ,$(sed -nr "s/$field: \"(.*)\"/\1/p" $talk | tr -d ',')
@frafra
frafra / ilpost.recipe
Created Jul 13, 2018
Calibre recipe for "Il Post"
View ilpost.recipe
#!/usr/bin/env python2
from calibre.ebooks.BeautifulSoup import BeautifulSoup
from calibre.web.feeds.news import BasicNewsRecipe
class IlPost(BasicNewsRecipe):
title = "Il Post"
language = "it"
tags = "news"
#feeds = ["https://www.ilpost.it/feed/"]
@frafra
frafra / su.openstreetmap.it-recipes.md
Last active Jul 11, 2018
su.openstreetmap.it / onosm.org recipes
View su.openstreetmap.it-recipes.md

su.openstreetmap.it / onosm.org recipes

These recipes are for su.openstreetmap.it, but they can be used for onosm.org (replace the URL where necessary).

Note: jq can be required by some recipes.

Get the first 100 unresolved notes (geojson)

curl 'https://api.openstreetmap.org/api/0.6/notes/search.json?q=su.openstreetmap.it&limit=100&closed=0' -o notes.geojson
@frafra
frafra / iliad.py
Created Jun 28, 2018
iliad.it basic account information parser
View iliad.py
#!/usr/bin/env python3
import bs4 # fades beautifulsoup4
import hug # fades
import humanfriendly # fades
import requests # fades
import datetime
import string
# https://github.com/xolox/python-humanfriendly/issues/29
@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 / 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"
You can’t perform that action at this time.