Skip to content

Instantly share code, notes, and snippets.

View NaanProphet's full-sized avatar

Krishna Bhamidipati NaanProphet

View GitHub Profile
@NaanProphet
NaanProphet / DuckDNS shell script for Asus Merlin Routers
Last active January 24, 2024 16:47
DuckDNS shell script for Asus Merlin Routers
Tested on an ASUS RT-AC56U running Merlin firmware 378.55
A helpful script to convert dates generated by IFTTT receipes like those from Maker into the ISO standard (that's used e.g. by MSQL).
@NaanProphet
NaanProphet / compressor.py
Created December 31, 2015 20:30 — forked from andrewbunday/compressor.py
This is how little I trust Compressor's Command Line Interface.
#!/usr/bin/env python
"""
Compressor wrapper script.
"""
import os
import sys
import re
import argparse
import subprocess
import logging
@NaanProphet
NaanProphet / datepojoregex
Created January 4, 2016 22:41
Regex Pojos
Notepad++ Regex for replacing malicious dates in POJOs
note: . matches newline must NOT be checked
Only meant for Notepad++, have to open the files from Explorer and then click Refresh in Eclipse afterwards.
May not be 100% foolproof! Imperative to review the files manually!
Note: before replacing, use the "Mark All" feature in Notepad++ with "Bookmark line" checked. Then after replacing, jump to the next bookmark using F2 (and Shift+F2)
********************
@NaanProphet
NaanProphet / mkvWrapper.sh
Created January 16, 2016 15:28
YouTube mkvWrapper
#!/bin/bash
# mkvWrapper.sh
# helpful for rewrapping valid MOV exports from Compressor 4 into MKVs that can be batched to YouTube for faster processing
# USAGE
# sh mkvWrapper.sh "Compressor Export-MPEG4_HighQ to YT.mov"
# OUTPUT
# Compressor Export-MPEG4_HighQ to YT.mkv
@NaanProphet
NaanProphet / timecode-rewrap.sh
Last active May 12, 2017 14:57
Timecode Enricher
#!/bin/sh
### Timecode generation script for MP4 footage (AVCHD, XAVC-S, etc.)
### Uses ffmpeg for timecode creation; EditReady for container cleanup;
### exiftool for copying over original track dates; and SetFile for setting
### the File Creation Date for FCP X event
### Note: this script currently does not work for files with spaces
# quit on first error (almost always)
@NaanProphet
NaanProphet / App Nap Script.scpt
Created February 3, 2016 13:09
App Nap Script for MBA
-- thanks to: http://osxdaily.com/2014/05/13/disable-app-nap-mac-os-x/
-- disable App Nap
--do shell script "defaults write NSGlobalDomain NSAppSleepDisabled -bool YES"
-- renable App Nap
do shell script "defaults delete NSGlobalDomain NSAppSleepDisabled"
@NaanProphet
NaanProphet / generics.java
Created June 3, 2016 22:05
Java obtain generic type at runtime
// This statement is magic
// If you declare it: Set<String> getMyGeneric; it returns java.lang.String
final Class<?> genericClazz = (Class<?>)((ParameterizedType) getClass().getDeclaredField("getMyGeneric").getGenericType()).getActualTypeArguments()[0];
@NaanProphet
NaanProphet / markdown-table-to-html.py
Last active August 25, 2016 00:44 — forked from bsweger/markdown-table-to-html.py
Convert markdown table rows to html (we converted some markdown tables to html so we could use the "scope" attribute in the header rows for accessibility).
import sys
import re
# input: first argument is a file that contains the piped markdown table rows
with open (sys.argv[1]) as f:
content = f.readlines()
rows = []
pattern = re.compile("^\|[ -][ -]+")
@NaanProphet
NaanProphet / rsync-compile.sh
Created May 12, 2017 15:08
OS X script that compiles rsync binary from source with detect-renamed patch
#!/bin/sh
# rsync 3.1.2 patched with additional options
# detect-renamed
# detect-renamed-lax
# detect-moved options
# special thanks to:
# https://moderncaveman.org/projects/modern/rsync-detect-renamed/patching-rsync-for-renamed.html
# note: the improved 3.0.9 from the above URL is already part of 3.1.x