Skip to content

Instantly share code, notes, and snippets.


Federico Maggi phretor

View GitHub Profile
phretor /
Created May 4, 2020
A simple Wallabag -> Pocket conversion script
import time
import io
import csv
import sys
from datetime import datetime
print("""<!DOCTYPE html>
phretor /
Last active Jan 4, 2021
Periodic off-site replication with FreeBSD, duplicacy and B2

Periodic off-site replication with FreeBSD, duplicacy and B2

I've recently discovered duplicacy, and I've decided to use it with an B2 backend to keep a mirrored offsite replication of the main directories of my home NAS.

I use the periodic system, which offers a nice abstraction over crontab for periodic tasks, and duplicacy to perform the actual backup. To setup duplicacy, I've followed the guide. In simple words, for each directory that I want to replicate, I setup duplicacy in it, which in turns means that you'll have to have a .duplicacy subdirectory in it.

FreeBSD's Periodic

First off, I've added the following to /etc/defaults/periodic.conf. The prefix, 666, is on purpose.

phretor / What we know (technically) about
Last active Jan 12, 2017
What we know (technically) about EyePyramid
View What we know (technically) about
phretor /
Created Nov 30, 2016
Python pathlib2-based recursive directory iterator with depth limits
def _dig(p, max_depth, depth=1):
for sp in p.iterdir():
if sp.is_file():
yield sp
elif sp.is_dir() and depth <= max_depth:
depth += 1
for ssp in _dig(sp, max_depth, depth):
yield ssp
phretor / gist:879ac99e45d6d83497d8febf88c238d8
Last active Oct 17, 2016
My Son's First Typed Strings (17 months)
View gist:879ac99e45d6d83497d8febf88c238d8
/m nm nmbbvvc ,cxcc
rnf vc .cx.x /x/ /,,,,,?/////////////////////////////////////////////////////////////////////////////////////

Keybase proof

I hereby claim:

  • I am phretor on github.
  • I am phretor ( on keybase.
  • I have a public key ASAv54h27oSEKgN5zwbiNjbuSGIqQM1FYsSYYvLAm7wCgQo

To claim this, I am signing this object:

# Download and build OS X Mavericks XNU Source
if [ ! -d "dtrace-118" ]; then
curl -O
tar zxf dtrace-118.tar.gz
rm dtrace-118.tar.gz
if [ ! -d "AvailabilityVersions-6" ]; then
curl -O
tar zxf AvailabilityVersions-6.tar.gz
View pdffontembed
#! /usr/bin/env python
import sys
import argparse
import subprocess
import shlex
def main():
parser = argparse.ArgumentParser(
description='Takes a PDF and attempts to embed the fonts.')
phretor /
Created Oct 20, 2011
Visualization of the migration screen of BURN
package DetailsPanel.MigrationChart
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
import flash.display.Sprite;
public class MigrationEdge extends Sprite
phretor / reflector.c
Created Oct 19, 2011
Packet reflector that reflects packets back to the attacker
View reflector.c
* Copyright (c) 2008
* Federico Maggi <>, Politecnico di Milano. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright