Skip to content

Instantly share code, notes, and snippets.

Luca Zorzi LucaTNT

Block or report user

Report or block LucaTNT

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
@LucaTNT
LucaTNT / apritiSesamo.py
Last active Jul 26, 2017
Script that triggers a relay connected to GPIO 25 on a Raspberry Pi in order to open a garage door
View apritiSesamo.py
#!/usr/bin/env python
from gpiozero import LED, Button
from time import sleep
from flask import Flask
import datetime
portone = LED(25)
app = Flask(__name__)
@LucaTNT
LucaTNT / ForceFinderRefresh.applescript
Created Apr 26, 2017
Script that forces the refresh of the current Finder window
View ForceFinderRefresh.applescript
tell application "Finder"
tell front window to update every item
try
delete (make new file at (front window) with properties {name:".refresh.tmp"})
end try
end tell
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@LucaTNT
LucaTNT / Spotify-now-playing-on-TouchBar.scpt
Last active Sep 27, 2018
This script can be used in conjunction with Better Touch Tool to display the currently playing track in Spotify on the MacBook Pro TouchBar. More info here: https://lucatnt.com/2017/02/display-the-currently-playing-track-in-itunesspotify-on-the-touch-bar
View Spotify-now-playing-on-TouchBar.scpt
-- This script can be used in conjunction with Better Touch Tool to display the currently playing track on the MacBook Pro TouchBar
-- More info here: https://lucatnt.com/2017/02/display-the-currently-playing-track-in-itunesspotify-on-the-touch-bar
if application "Spotify" is running then
tell application "Spotify"
if player state is playing then
return (get artist of current track) & " - " & (get name of current track)
else
return ""
end if
@LucaTNT
LucaTNT / iTunes-now-playing-on-TouchBar.scpt
Last active Sep 27, 2018
his script can be used in conjunction with Better Touch Tool to display the currently playing track in iTunes on the MacBook Pro TouchBar. More info here: https://lucatnt.com/2017/02/display-the-currently-playing-track-in-itunesspotify-on-the-touch-bar
View iTunes-now-playing-on-TouchBar.scpt
-- This script can be used in conjunction with Better Touch Tool to display the currently playing track on the MacBook Pro TouchBar
-- More info here: https://lucatnt.com/2017/02/display-the-currently-playing-track-in-itunesspotify-on-the-touch-bar
if application "iTunes" is running then
tell application "iTunes"
if player state is playing then
return (get artist of current track) & " - " & (get name of current track)
else
return ""
end if
@LucaTNT
LucaTNT / scrapmagnet.py
Last active Jan 5, 2017
Edited scrapmagnet.pys to make it work with the node version of scrapmagnet.js on FreeBSD/FreeNAS
View scrapmagnet.py
###############################################################################
import base64
import common
import platform
import os
import re
import stat
import socket
import subprocess
import time
@LucaTNT
LucaTNT / podpress_admin_functions.php.diff
Created Jun 18, 2016
Patch to podPress that allows serving podcast mp3's over HTTPS. See https://lucatnt.com/2016/06/add-ssl-support-to-podpress/ for details.
View podpress_admin_functions.php.diff
1028c1028
< if ( $aURL['scheme'] != 'http' ) {
---
> if ( $aURL['scheme'] != 'http' && $aURL['scheme'] != 'https' ) {
1617,1618c1617,1618
< // make sure we get the header
< curl_setopt($ch, CURLOPT_HEADER, TRUE);
---
> // make sure we DON'T get the header
> curl_setopt($ch, CURLOPT_HEADER, FALSE);
@LucaTNT
LucaTNT / compare_dns.sh
Created May 1, 2016
An old script I made years ago to compare the response times of two DNS servers
View compare_dns.sh
#!/bin/bash
# Author: Luca Zorzi <luca A_T tuttoeniente D_O_T net>
# License: CC Attribution (http://creativecommons.org/licenses/by/3.0/)
# Release date: 2009-12-13
# A little script to compare 2 DNS servers
if [[ "$#" != "2" ]]
then
echo "USAGE: $0 dns-server-1 dns-server-2"
exit 1
@LucaTNT
LucaTNT / log-speedtest.sh
Created Mar 2, 2016
A script that appends to a CSV file the results of your internet speed test (via speediest-cli)
View log-speedtest.sh
#!/bin/bash
OUTPUT="`speedtest-cli --simple`"
PING=`echo "$OUTPUT" | grep Ping | sed 's/[a-zA-Z:]* \([0-9]*\.[0-9]*\) [a-zA-Z/]*/\1/'`
DOWNLOAD=`echo "$OUTPUT" | grep Download | sed 's/[a-zA-Z:]* \([0-9]*\.[0-9]*\) [a-zA-Z/]*/\1/'`
UPLOAD=`echo "$OUTPUT" | grep Upload | sed 's/[a-zA-Z:]* \([0-9]*\.[0-9]*\) [a-zA-Z/]*/\1/'`
DATE=`date +%Y/%m/%d`
TIME=`date +%H:%M:%S`
View crashplan_remote.sh
#!/bin/bash
# crashplan_remote.sh
# Author: Luca Zorzi (@LucaTNT)
# License: WTFPL (http://www.wtfpl.net)
#
# Connects to CrashPlan running in a FreeNAS jail and launches the Desktop APP, then reverts all the settings back to their defaults
CRASHPLAN_SERVER="192.168.1.78"
CRASHPLAN_USER="luca"
You can’t perform that action at this time.