This file contains hidden or 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
# if you know you know | |
import os, shutil | |
out_folder = "./bundled/" | |
pkg_folder = "./packages/" | |
rap_folder = "./exdata/" | |
rap_files = [] |
This file contains hidden or 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
REM Killall oculus to get rid of the botnets... or if Oculus Link just is stubborn for some reason... | |
REM Killing everything Oculus related, and then opening the Oculus app again usually fixes it | |
REM Run as admin! | |
REM Multiples because theyre stubborn sometimes | |
taskkill /f /im OculusClient.exe | |
taskkill /f /im OVRRedir.exe | |
taskkill /f /im oculus-platform-runtime.exe |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# usage: caption.py image.jpg "The text" | |
# you can use a | to force a newline | |
# settings | |
strokew = 4 # outline width | |
stroke_color = "#101010" # outline color | |
font_color = "#f0f0f0" # ebeb0b=yellow, f0f0f0=white |
This file contains hidden or 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 netatmo, json, sys | |
if len(sys.argv) < 5: | |
# get clientid/secret from here https://dev.netatmo.com/apps/ | |
print("usage: script.py clientid clientsecret username password") | |
sys.exit(1) | |
ws = netatmo.WeatherStation( { | |
'client_id': sys.argv[1], | |
'client_secret': sys.argv[2], |
This file contains hidden or 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
# remove .exe's to make it unix compatible | |
# needs mediainfo and ffmpeg | |
import os, subprocess | |
path = "Z:/Videos" | |
for f in os.listdir(path): | |
mi = subprocess.check_output(["mediainfo.exe", os.path.join(path,f)]) | |
if "MPEG Audio" in str(mi): | |
print(f, "= mp3") |
This file contains hidden or 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 | |
mkdir /tmp/ff | |
cd /tmp/ff | |
wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz | |
tar -xf ffmpeg-git-amd64-static.tar.xz | |
rm ffmpeg-git-amd64-static.tar.xz | |
cd ff* | |
mv ffmpeg /bin/ffmpeg | |
mv ffprobe /bin/ffprobe | |
cd ~ |
This file contains hidden or 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
def resolutionP(string): # returns 720p from test.720p-foo and so on | |
string = string.lower() | |
if "0p" in string: | |
index = string.index("0p") | |
result = "" | |
# go backwards | |
while string[index].isnumeric(): | |
result = result + string[index] | |
index -= 1 | |
result = result[::-1] + "p" # reverse and add p |
This file contains hidden or 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
# usage: python3 foo_dr_renamer.py /path/to/music/folder/ | |
# change ASK_FOR_CONFIRMATION to True if you want to decide manually | |
import os, sys, shutil | |
ASK_FOR_CONFIRMATION = False | |
if len(sys.argv) < 2: | |
print("no path given") | |
sys.exit(1) |
This file contains hidden or 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 os, subprocess, sys | |
# usage: extract_highlights.py <path-to-video> <path-to-timestamps> | |
# timestamps file format: | |
# hh:mm:ss bla bla bla | |
before_secs = 5 # secs to include before clip timestamp | |
after_secs = 25 # -"- after -" ... 5+25 = 30 sec clip | |
safe_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -0123456789." |
This file contains hidden or 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
# add this to to your .zshrc, then you can do `path file` to get the full path to that file, requires python | |
path() { python -c "import os;print(os.path.realpath(\""$1\""))" } |