Skip to content

Instantly share code, notes, and snippets.

View JackDesBwa's full-sized avatar

JackDesBwa JackDesBwa

  • France
  • 08:56 (UTC +02:00)
View GitHub Profile
@JackDesBwa
JackDesBwa / midi2c.py
Created March 13, 2016 14:10
Script to convert midi files into C structure exploitable by (e.g.) microcontrollers
#!/usr/bin/env python2
# This script uses mido <https://pypi.python.org/pypi/mido/1.1.3> to
# transform a midi file into a C structure to be played by a
# microcontroller firmware for example
from mido import MidiFile
import sys
if len(sys.argv) != 2:
@JackDesBwa
JackDesBwa / masquerade.sh
Last active May 31, 2016 18:40
Script to configure simple masquerade
#!/bin/sh
if [ _$1 == _ ]
then
echo "Usage: $0 <output_if>"
exit 1
fi
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o $1 -j MASQUERADE
;;;
;;; COLOGRAM.SCM -*-scheme-*- This File is written by Friedemann Wolpert 2010
;;; You can contact the Author using the following eMail: Friedemann@MedienKunstOnline.De
;;; Project Entry for "Mach Flott den Schrott 2", Heise Magazin
;
; Found on MedienKunstOnline.De thanks to the Wayback Machine :
; https://web.archive.org/web/20150502123253/http://medienkunstonline.de:80/Cologram_Uk.scm
(define (script-fu-cologram image layer rows-per-sec dpi-setting img-resize want-sharpen want-grid want-adjframe frameforecolor framerearcolor adjframedist adjframewidth want-cutframe cutframedist cutframewidth
;anchor-top anchor-down anchor-left anchor-right format
@JackDesBwa
JackDesBwa / get_yt_infos.py
Last active October 15, 2019 18:44
Quick and dirty script to get information about youtube videos and their URL (valid in october 2019)
!/usr/bin/env python3
# Libraries
import re
import sys
import json
import urllib.request
from urllib.parse import parse_qs
# Get video id from command line
@JackDesBwa
JackDesBwa / a2sbs.py
Last active July 10, 2023 15:27
Anaglyph to SBS toy converter
#!/usr/bin/env python3
#################################
# Anaglyph to SBS toy converter #
#################################
import cv2
import numpy as np
import argparse
@JackDesBwa
JackDesBwa / mpo2sbs.py
Created January 31, 2020 04:16
Transform MPO stereoscopic images into SBS parallel
#!/usr/bin/env python3
import sys
from PIL import Image
for p in sys.argv[1:]:
path_in = p
path_out = path_in.replace('.mpo', '.sbs.jpg')
imr = Image.open(path_in)
@JackDesBwa
JackDesBwa / oculus_live.sh
Created December 26, 2020 21:35
Stream Oculus Quest to sView via adb (start with USB and setup TCP)
#!/bin/sh
if [ "$1" == "" ]
then
# Check devices to avoid error in next commands
NB_DEVICES=$(adb devices -l | grep model:Quest_2 | wc -l)
if [ $NB_DEVICES == 0 ]
then
echo "Device not found"
exit
@JackDesBwa
JackDesBwa / stereocard_find_edges.py
Created March 24, 2021 11:27
This script tries to find edges of a stereocard based on the algorithm proposed by Martin Schub at https://photo-3d.groups.io/g/main/message/125478
#!/usr/bin/env python3
# This script tries to find edges of a stereocard based on the algorithm
# proposed by Martin Schub at https://photo-3d.groups.io/g/main/message/125478
import sys
import numpy as np
from scipy.signal import argrelmax
from PIL import Image
import matplotlib.pyplot as plt
@JackDesBwa
JackDesBwa / sbs2qoocamego.py
Last active June 10, 2022 14:06
Script to convert (parallel) SBS or MPO image into a SBS image displayable by QooCam EGO device
#!/usr/bin/env python3
# Script to convert (parallel) SBS or MPO image into a SBS image displayable by QooCam EGO device
# TODO: Add a thumbnail that could be displayed by the device
import argparse
import os
import sys
parser = argparse.ArgumentParser(description='SBS to QoocCam EGO')
@JackDesBwa
JackDesBwa / qoocamego__readme.rst
Last active December 8, 2022 02:13
Scripts for remote access to the QooCam EGO

QooCam EGO remote scripts

This is a collection of independant scripts to show how to communicate with the QooCam EGO remotely.

They were tested with firmware 2.1.29 in the camera.

They are quite minimal so that you can inpire yourself to create your own awesome utility.

You can also use them directly as is.