Skip to content

Instantly share code, notes, and snippets.

View lclibardi's full-sized avatar

Lucas Libardi lclibardi

  • San Francisco - CA
View GitHub Profile
@lclibardi
lclibardi / gist:69af028fafa3b7ae286bb3a6b5f9c838
Created November 12, 2023 17:10
Extract Chrome Tabs from Android Smartphone
adb forward tcp:9222 localabstract:chrome_devtools_remote
wget -O tabs.json http://localhost:9222/json/list
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
@lclibardi
lclibardi / fit_rigid_3d_transform.py
Created June 25, 2020 11:51
Autodesk Maya tool with user interface to fit a rigid transform to a set of locators.
import numpy as np
from math import sqrt
import maya.cmds as cmds
from maya.api import OpenMaya
def str_to_dagnode(name):
'''
Returns a Maya dagNode from an input string.
:param name: name of the object in Maya
@lclibardi
lclibardi / get_dateencoded_exif.py
Last active April 8, 2023 11:30
Get Quicktime Media DateEncoded Exif data
'''
These are 5 different methods that attempt to retrieve the Quicktime property metadata "Media DateEncoded" from an 'mp4' file.
'''
import os
import re
import struct
import subprocess as sub
from datetime import datetime
from hachoir.parser import createParser
@lclibardi
lclibardi / maya_audio_anim.py
Created August 20, 2018 18:38
Animate objects in Maya using sound from the microphone
#!/usr/bin/python
# This script opens an ALSA pcm for sound capture, and keyframes the
# object's 'radius' attribute while looping through the sound input.
import sys
import time
import maya.cmds as cmds
# If not installed, install alsa audio by running `pip install pyalsaaudio`
sys.path.append('/usr/local/lib/python2.7/dist-packages')
@lclibardi
lclibardi / connect_mx_anywhere_mouse.txt
Created June 13, 2018 00:18
Bash commands to manually connect your Anywhere MX Mouse to Ubuntu
# This is how you manually connect your Anywhere MX Mouse to Ubuntu
bluetoothctl
[bluetooth]# power off
[bluetooth]# power on
[bluetooth]# scan on
[bluetooth]# connect XX:XX:XX:XX:XX:XX
[Arc Touch Mouse SE]# trust
[Arc Touch Mouse SE]# connect XX:XX:XX:XX:XX:XX
[Arc Touch Mouse SE]# pair
[Arc Touch Mouse SE]# unblock
@lclibardi
lclibardi / cygwin_install.bat
Last active May 9, 2020 00:03
Cygwin Windows Installation
@echo off
set curdir=%~dp0
if not exist "%curdir%\setup-x86_64.exe" (
wget "https://cygwin.com/setup-x86_64.exe"
)
set packages="bash,bash-completion,bind-utils,bzip2,ca-certificates,curl,cygwin-devel,git,git-svn,iso-codes,libOpenCL1,libatomic1,libbz2_1,libcurl4,libncursesw10,libopencv3.4,libopenssl100,libssh-common,libssh2_1,libssh4,libssl1.1,libzip,libzip2,lynx,nano,ncurses,opencv,openssh,openssl,python-pip-wheel,python-setuptools-wheel,python3,python3-appdirs,python3-bcrypt,python3-cffi,python3-chardet,python3-cv2,python3-imaging,python3-packaging,python3-paramiko,python3-ply,python3-pycparser,python3-pygments,python3-pyparsing,python3-setuptools,python3-six,python3-tkinter,python37,python37-asn1crypto,python37-bs4,python37-cffi,python37-cryptography,python37-html5lib,python37-imaging,python37-ipaddress,python37-lxml,python37-numpy,python37-openssl,python37-ply,python37-pycparser,python37-pyparsing,python37-requests,python37-setuptools,python37-six,python37-tkinter,python37-urllib3,rsync,ssh,subversion
@lclibardi
lclibardi / stringify_dictionary.py
Created March 26, 2018 19:40
Converts all keys and values of a dictionary to ASCII strings
import unicodedata
def stringify_dictionary(dic):
"""
Converts all keys and values of a dictionary to ascii strings
"""
tmp = {}
for k, v in dic.iteritems():
# First transform all characters to unicode
@lclibardi
lclibardi / importAllRefs.mel
Created March 21, 2018 19:02
Recursively import all nested references in a Maya scene.
// IMPORT ONLY TOP LEVEL REFERENCES
string $references[] = `ls -type "reference"`;
for ( $r in $references)
{
string $ref = `referenceQuery -filename $r`;
file -importReference $ref;
}
// RECURSIVELY IMPORT ALL REFERENCES
{
@lclibardi
lclibardi / resetRotoFeather.py
Last active March 21, 2018 00:51
A quick way to reset the feather curves in Nuke's Roto node
# Current frame on the timeline
frm = nuke.frame()
# Iterate over all Roto nodes
for rotoNode in nuke.allNodes('Roto'):
# Access the curves knob, then the root layer
curves = rotoNode['curves']
rootLayer = curves.rootLayer
for spline in rootLayer: