Skip to content

Instantly share code, notes, and snippets.

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 / log-speedtest.sh
Created March 2, 2016 18:50
A script that appends to a CSV file the results of your internet speed test (via speediest-cli)
#!/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`
@LucaTNT
LucaTNT / scrapmagnet.py
Last active January 5, 2017 08:49
Edited scrapmagnet.pys to make it work with the node version of scrapmagnet.js on FreeBSD/FreeNAS
###############################################################################
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 June 18, 2016 15:10
Patch to podPress that allows serving podcast mp3's over HTTPS. See https://lucatnt.com/2016/06/add-ssl-support-to-podpress/ for details.
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 10:57
An old script I made years ago to compare the response times of two DNS servers
#!/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
#!/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"
@LucaTNT
LucaTNT / prettyDateDifference.php
Created June 17, 2013 20:49
Make a pretty date difference from the current time
<?php
/*
Make a pretty date difference from the current time
Author: Luca Zorzi (@LucaTNT)
License: BSD
*/
function parseDate($timestamp)
{
// Current timestamp
@LucaTNT
LucaTNT / SalvaICS.applescript
Last active December 18, 2015 01:09
Salva il file ICS allegato alle mail di conferma di acquisto di Trenitalia Saves the ICS file attached to Trenitalia purchase confirmation emails.
-- Edited by @LucaTNT, originally from Nigel Garvey (http://macscripter.net/viewtopic.php?id=29010)
property theAttachmentPath : (path to downloads folder) as Unicode text
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "Mail"
repeat with This_Message in theMessages
repeat with ma in mail attachments of This_Message
set n to name of ma
if n ends with ".ics" then
@LucaTNT
LucaTNT / Vibrazioni
Last active December 17, 2015 12:09
% Programma per verificare che la mia chiusura del problema sia buona
% Link al testo: http://cl.ly/P3ia
% Immagine risultante: http://cl.ly/P4Zz
clear; close all; clc;
R = 10;
L = 15;
x_cir = @(x) R*sin(x);
y_cir = @(x) R*cos(x);
@LucaTNT
LucaTNT / gist:5540119
Created May 8, 2013 12:28
Custom XBMC keyboard.xml to be used with chinese USB infrared remote control that emulates a keyboard. Here it is: http://dx.com/p/multimedia-ir-remote-controller-with-usb-receiver-for-pc-1-cr2025-26368
<keymap>
<global>
<keyboard>
<!-- reload Keymap, n on the actual keyboard -->
<n>XBMC.Action(reloadkeymaps)</n>
<!-- Orange movie button brings to Movie list -->
<b mod="ctrl,alt">ActivateWindow(Videos,MovieTitles)</b>
<!-- Yellow TV button brings to TV Show list -->