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 / united_music_playlist.sh
Created Jul 10, 2013
Little project for generating United Music web radios XSPF playlist
View united_music_playlist.sh
#!/bin/bash
#
# Copyright (C) 2013 Francesco Frassinelli (FraFra - http://frafra.eu)
# License: GPLv3
#
# Special thanks to: http://blog.redaelli.eu/2010/03/lista-di-radio-su-unitedradioit.html
filename="unitedradio-it.xspf"
server="http://shoutcast.unitedradio.it"
@frafra
frafra / divide.py
Created Oct 3, 2013
Split every PDF page in 2 or 4 parts
View divide.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Francesco Frassinelli
#
# This program 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.
#
@frafra
frafra / click_timing.sh
Last active Dec 26, 2015
Calculate interval between two clicks
View click_timing.sh
#!/bin/bash
DEV="/dev/input/mouse0"
SEQ="ht nul nul"
function click_event {
stdbuf -oL od -w3 -t a -A n "$DEV" | grep -m1 "$SEQ" > /dev/null
}
click_event
@frafra
frafra / select-default-source.sh
Created Nov 13, 2013
Select default source for PulseAudio
View select-default-source.sh
#!/bin/bash
# select-default-source.sh
# Description: Select default source for PulseAudio
# Author: FraFra (Francesco Frassinelli - frafra.eu)
# License: GPLv3
SOURCES=($(LC_ALL=C pactl list sources | grep -P '^\tName: ' | cut -d ' ' -f 2))
DEFAULT=$(LC_ALL=C pactl info | grep '^Default Source: ' | cut -d ' ' -f 3)
echo "Sources:"
View organize-your-files.sh
#!/bin/bash
# organize-your-files.sh
# Description: Organize your files
# Author: FraFra (Francesco Frassinelli - frafra.eu)
# License: GPLv3
#
# Idea presa da:
# http://magliettabianca.blogspot.it/2013/11/bash-guida-allautomazione-organizzare-i.html
#
# Questa versione migliora alcuni aspetti:
@frafra
frafra / bici-in-città.sh
Created Nov 28, 2013
Mostra lo stato delle stazioni per le biciclette di Savona
View bici-in-città.sh
#!/bin/bash
SAVONA='http://www.bicincitta.com/citta_v3.asp?id=43&pag=2'
NAME="bici-in-città"
temp=$(mktemp --suffix=$NAME)
curl -s $SAVONA -o $temp
code=$(grep 'var sita_n' $temp | cut -d\" -f2,4 --output-delimiter=)
IFS=$'_' places=($code)
@frafra
frafra / select-default-sink.sh
Last active Dec 28, 2016
Select default sink for PulseAudio
View select-default-sink.sh
#!/bin/bash
# select-default-subj.sh
# Description: Select default sink for PulseAudio
# Author: FraFra (Francesco Frassinelli - frafra.eu)
# License: GPLv3
SINKS=($(LC_ALL=C pactl list sinks | grep -P '^\tName: ' | cut -d ' ' -f 2))
DEFAULT=$(LC_ALL=C pactl info | grep '^Default Sink: ' | cut -d ' ' -f 3)
echo "Sinks:"
@frafra
frafra / sms-from-bash.sh
Last active Jan 1, 2016
Send SMS using USB dongle or smartphone
View sms-from-bash.sh
#!/bin/bash
# sms-from-bash.sh
# Description: Send SMS using USB dongle or smartphone
# Author: FraFra (Francesco Frassinelli - frafra.eu)
# License: GPLv3
MODEM=/dev/ttyACM0
T=3
if [ ! -w $MODEM ]
@frafra
frafra / share-connection.sh
Created May 2, 2014
Wifi connection over ethernet (Fedora setup)
View share-connection.sh
### /etc/sysconfig/network-scripts/ifcfg-*
### NM_CONTROLLED=no
cat << EOF > /etc/dnsmasq.conf
# Only listen to routers' LAN NIC. Doing so opens up tcp/udp port 53 to
# localhost and udp port 67 to world:
interface=p255p1
# dnsmasq will open tcp/udp port 53 and udp port 67 to world to help with
# dynamic interfaces (assigning dynamic ips). Dnsmasq will discard world
@frafra
frafra / ydlredirect-bookmarklet.js
Created Aug 29, 2014
(youtube-dl) + web service + bookmarklet = play just the video/no Flash
View ydlredirect-bookmarklet.js
javascript:(function(){window.location='http://localhost:8080?url='+window.btoa(unescape(encodeURIComponent(window.location)));})()
You can’t perform that action at this time.