View udptunnel.sh
# Only for remote UDP https://stackpointer.io/network/ssh-port-forwarding-tcp-udp/365/
# Local UDP server to Remote UDP server
ssh -L 9999:127.0.0.1:9999 percro@alientelecom socat tcp4-listen:9999,reuseaddr,fork udp:target:9999
socat -T15 udp4-recvfrom:9999,reuseaddr,fork tcp:localhost:9999
# Remote UDP server to Local UDP server
ssh -R 9999:127.0.0.1:9999 percro@alientelecom socat udp4-recvfrom:9999,reuseaddr,fork tcp:localhost:9999
socat -T15 tcp4-listen:9999,reuseaddr,fork udp:localhost:9999
View ws2udp_bridge.py
# 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
View datawithpayload.cpp
#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
{
View videocapture_cvimageio.py
import cv2
import sys
try:
import imageio
except:
print "missing imageio"
imageio = None
try:
View build
#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
View extract_pdf_annotations_two.py
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'):
View pypdf_sidebyside.py
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())
View pypdf_addblank.py
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)
View onlyimageslink.py
View youtube-dla.sh
#!/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