This file contains 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
# Download the xmarks "View Bookmarks Revision" from their webpage for all revisions, then run this to audit changes. | |
import glob, re | |
class BookmarkSeparator(object): | |
name = '<<SEPARATOR>>' | |
add_date = 0 | |
last_modified = 0 | |
description = '<<SEPARATOR>>' |
This file contains 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
#!/usr/bin/env python | |
import json, sys | |
from pprint import pprint | |
def escape(html): | |
return html.replace('&', '&').replace('<', '<').replace('>', '>').replace('"', '"') | |
sessionstore = json.load(open(sys.argv[1],'r')) | |
sessionstore_windowtabs = map(lambda x: x['tabs'], sessionstore['windows']) |
This file contains 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
# Image output: | |
# -r: framerate of output | |
ffmpeg -i inputfile.mp4 -r 1 -f image2 image-%3d.jpeg # one per second | |
ffmpeg -i inputfile.mp4 -frames:v 1 thumb.png # one | |
# crop=w:h:xoffset:yoffset | |
-vf "crop=610:475:835:385" | |
# scale to w:h. -1 is 'preserve aspect ratio in this dimension' -2 is 'preserve aspect ratio but keep the dimension a multiple of 2' | |
-vf 'scale=-1:min(iw\,480)' |
This file contains 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
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
open(PALIST, '-|', 'pacmd list-sink-inputs'); | |
my $index = undef; | |
my $set_mute_to = undef; | |
while (<PALIST>) { | |
if (/^\s*index: ([0-9]+)$/) { | |
$index = $1; |
This file contains 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
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
my $REGEX = shift @ARGV; | |
my $SourceFile = shift @ARGV; | |
my $OutputFormat = shift @ARGV; | |
my $FileI = 0; | |
open(SRC, '<', $SourceFile) or die "Unable to open $SourceFile: $!"; |
This file contains 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
youtube-dl --restrict-filenames --auto-number https://www.youtube.com/playlist?list=$PLAYLIST # --playlist-start 1 | |
for I in *.mp4; do | |
nice -n20 \ | |
mplayer $I -vf framestep=30,decimate=100000000:512:256:0.1 -nosound -speed 100 -vo jpeg:outdir="${I%.mp4}" | |
done | |
# Key point is 'decimate', which tosses similar frames. See manpage. | |
# Consider the effects of decimate combined with frameskip, for notable tuning. | |
# And, obviously, experiment! | |
# |