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
# WS Server - UDP Server | |
# Taken online, refactored | |
# | |
# Emanuele Ruffaldi 2017 | |
import time, sys, os, pkg_resources | |
import SocketServer | |
from twisted.python import log | |
from twisted.internet import reactor |
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
#include <stdint.h> | |
#include <boost/interprocess/sync/interprocess_mutex.hpp> | |
#include <boost/interprocess/sync/interprocess_condition.hpp> | |
#include <vector> | |
#include <iostream> | |
#include <tuple> | |
// header | |
struct ImageHeader | |
{ |
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
import cv2 | |
import sys | |
try: | |
import imageio | |
except: | |
print "missing imageio" | |
imageio = None | |
try: |
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
#updated from https://gist.github.com/kilfu0701/47b74a17a70b43549985 | |
brew install qt5 | |
brew install pyqt5 # for python 3.6 | |
## download SIP source code | |
wget http://sourceforge.net/projects/pyqt/files/sip/sip-4.19.3/sip-4.19.3.tar.gz | |
tar zxf sip-4.19.3.tar.gz | |
cd sip-4.19.3 | |
python configure.py | |
make |
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
from pdfminer.pdfparser import PDFParser | |
from pdfminer.pdfdocument import PDFDocument | |
from pdfminer.pdftypes import PDFObjectNotFound | |
import sys | |
def extract(objid, obj,pages,anno,marked): | |
if isinstance(obj, dict): | |
# 'Type' is PDFObjRef type | |
if obj.has_key('Type') and obj['Type'].name == 'Page': | |
pages.append(objid) | |
elif obj.has_key('C'): |
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
from PyPDF2 import PdfFileWriter, PdfFileReader | |
import sys | |
in1,in2,out = sys.argv[1:] | |
output = PdfFileWriter() | |
input1 = PdfFileReader(file(in1, "rb")) | |
input2 = PdfFileReader(file(in2, "rb")) | |
m = min(input1.getNumPages(),input2.getNumPages()) |
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
from PyPDF2 import PdfFileWriter, PdfFileReader | |
import sys | |
in1,out = sys.argv[1:] | |
output = PdfFileWriter() | |
input1 = PdfFileReader(file(in1, "rb")) | |
for i in range(0,input1.getNumPages()): | |
p1 = input1.getPage(i) |
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/env python | |
# | |
# Emanuele Ruffaldi 2017 | |
# | |
# Original Passthrough without links: https://github.com/skorokithakis/python-fuse-sample | |
# Alternative to that Passthrough is Loopback in the distribution https://github.com/terencehonles/fusepy/blob/master/examples/loopback.py | |
# | |
# TODO: Refresh | |
from __future__ import with_statement |
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 | |
# get filename from youtube-dl then replace it with mp4 | |
# then download, convert to mp4 and put metadata | |
filename=$(youtube-dl --get-filename "$1") | |
filename=${filename%.*}.mp4 | |
youtube-dl "$1" --recode-video mp4 --add-metadata | |
exiftool $filename -XMP:source=$1 | |
exiftool $filename |
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
import argparse | |
import csv | |
import os | |
import uuid,json,subprocess | |
import zipfile | |
import time | |
# TODO crossplatform | |
# TODO given path extract volume then label+uuid+diskformat | |
# | |
# OSX: add path => volume using mount output |