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/bash | |
service="_seren._udp" | |
# Select a random host | |
host=$(avahi-browse -d local $service -tpr | grep ";$service;" | grep -e '^=;' | sort -R | head -n1) | |
avahi-publish -s "Seren for $(hostname)" $service 8110 & | |
pid=$! | |
if [ -z "$service" ] |
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
/* | |
* Copyright (c) 2015, Marco Motta. | |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
* | |
* This code is free software; you can redistribute it and/or modify it | |
* under the terms of the GNU General Public License version 2 only, as | |
* published by the Free Software Foundation. | |
* | |
* This code is distributed in the hope that it will be useful, but WITHOUT | |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
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/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" |
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/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. | |
# |
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/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 |
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/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:" |
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/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: |
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/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) |
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/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 ] |
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/python3 | |
# https://fedoraproject.org/wiki/Packaging:Guidelines#File_and_Directory_Ownership | |
# Made by Frafra | |
import collections | |
import rpm | |
def depchain_check(pkg, pkgs): | |
ts = rpm.TransactionSet() | |
ts.addErase(pkg) |