Skip to content

Instantly share code, notes, and snippets.

View vitorio's full-sized avatar

Vitorio Miliano vitorio

View GitHub Profile
@vitorio
vitorio / bongos.py
Last active January 20, 2023 04:16
Stadia gamepad + Bongos as synthetic/composite/hybrid Switch Pro controller for Taiko no Tatsujin
# sudo apt install python3-pip pkg-config libdbus-1-dev libglib2.0-dev
# sudo pip3 install nxbt
# sudo pip3 install jinja2==3.0.3 itsdangerous==2.0.1 Werkzeug==2.0.2 eventlet==0.33.0 dnspython==2.2.1
import pyjoystick.sdl2
import nxbt
import gpiozero
import sys
button3 = gpiozero.Button(24, pull_up=False)
@vitorio
vitorio / sawtoothv1.md
Created August 31, 2021 17:53
Sawtooth Power Mac G4 Raspberry Pi 4 case configuration files v1

Okay, here's where we've landed for v1:

  • Power button
    • Wired to GPIO3, the default for gpio-shutdown
    • When pressed, does a safe shutdown
  • Green power LED
    • Wired to GPIO23
    • Lights up green when the RPi powers on
  • Reset button
    • Wired to RUN using a test point pin
@vitorio
vitorio / archival-transfer-marker
Last active December 30, 2021 07:02
DEPRECATED /.well-known/archival-transfer-marker
# A /.well-known/archival-transfer-marker file is a short-lived,
# well-known location meant to act as a boundary marker for web
# archives. It marks the END of a period of time, and itself SHOULD
# only exist for no more than 24 hours (TTL of 86400 seconds).
#
# The capture of a /.well-known/archival-transfer-marker file
# indicates that any captures of any other pages on that domain AFTER
# THE CAPTURE OF THE MARKER may have different owners, rights,
# robots.txt policies, permissions, etc.
#
@vitorio
vitorio / abogado
Created April 17, 2020 05:06
Palindromains! Palindromic domain names from new gTLDs. Uses the Domainr API through RapidAPI.
abogado
abogado, zuerich; lookup; SKIPPING
abogado, zone; lookup; lookup; abogado.zone / zone.abogado
abogado, zip; lookup; SKIPPING
abogado, zero; lookup; SKIPPING
abogado, yun; lookup; lookup; SKIPPING
abogado, you; lookup; SKIPPING
abogado, yokohama; lookup; lookup; abogado.yokohama / yokohama.abogado
abogado, yoga; lookup; lookup; SKIPPING
abogado, yachts; lookup; lookup; abogado.yachts / yachts.abogado
@vitorio
vitorio / osx-libnfc-latest-homedir.md
Created July 28, 2018 01:42
Compiling libnfc (latest) natively on OS X within your home directory

These instructions compile a native OS X version of libnfc (latest, from source control) that lives in your home directory, and which cannot be moved around, but should always be discoverable by applications.

Assumes OS X with Xcode or Xcode command-line tools, not macports or homebrew

To install Xcode command-line tools in recent versions of OS X, open Terminal, type xcode-select --install and click "Install"

Older versions of OS X may need to manually download disk images of older versions of Xcode and/or the Xcode command-line tools, as various certificates may have expired (e.g. 10.7.4 requires a manual install from the Xcode 4.6.2 command-line tools image)

Download latest pkg-config (tested with 0.29.1) from https://pkg-config.freedesktop.org/releases/?C=M;O=D

@vitorio
vitorio / dump-storify-json.py
Created April 29, 2018 23:40
Given a Storify username, write <username>.json, a <username> folder, and a <username>/<storify-slug>.json for each story
#!/usr/bin/python
try:
import simplejson as json
except:
import json
import requests
import math
import sys
import os
import errno
@vitorio
vitorio / dump-storify-static-urls.py
Last active April 29, 2018 23:19
Given a Storify username, write the static HTML export URLs for each public story to stdout
#!/usr/bin/python
try:
import simplejson as json
except:
import json
import requests
import math
import sys
import os
@vitorio
vitorio / scrape-storify-stories.py
Last active December 28, 2017 22:47 — forked from igorbrigadir/scrape-storify-stories.py
Download all Storify stories for a given user
#!/usr/bin/python
try:
import simplejson as json
except:
import json
import requests
import math
import sys
import argparse as ap
@vitorio
vitorio / osx-rpiboot-homedir.md
Last active January 4, 2023 19:10
Compiling libusb and rpiboot natively on OS X within your home directory

NOTE: rpiboot doesn't actually work on recent OS X versions and/or Macs due to a bug in the RPi0/RPi1 chipset: https://www.raspberrypi.org/forums/viewtopic.php?f=98&t=90825

These instructions compile a native OS X version of rpiboot that lives in your home directory, and which cannot be moved around, but should always be discoverable by applications.

Assumes OS X with Xcode or Xcode command-line tools, not macports or homebrew

To install Xcode command-line tools in recent versions of OS X, open Terminal, type xcode-select --install and click "Install"

Older versions of OS X may need to manually download disk images of older versions of Xcode and/or the Xcode command-line tools, as various certificates may have expired (e.g. 10.7.4 requires a manual install from the Xcode 4.6.2 command-line tools image)

@vitorio
vitorio / pacman.js
Created March 12, 2017 09:04
ES5- and ES6-injecting shims for PhantomJS Emularity test, shims from https://github.com/es-shims/es5-shim and http://stackoverflow.com/a/38471938
//
//
// Script to run against emulator/emularity pages to do screengrabs.
//
var webPage = require('webpage');
var page = webPage.create();
page.onConsoleMessage = function(msg, lineNum, sourceId) {
console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")');