Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env perl
use 5.014;
use strict;
use warnings;
use utf8;
use File::Find;
use Cwd;
my $location=getcwd;
my $count = 0;
#!/bin/bash
# qemu-img create -f qcow2 mac_hdd_ng.img 128G
#
# echo 1 > /sys/module/kvm/parameters/ignore_msrs (this is required)
############################################################################
# NOTE: Tweak the "MY_OPTIONS" line in case you are having booting problems!
############################################################################
#!/usr/bin/env perl
use File::Basename;
use Cwd 'abs_path';
use 5.014;
use strict;
use warnings;
use utf8;
my $TARGET_WIDTH="1920";
my $TARGET_EXT=".mov";
#!/bin/bash
# This program finds (recursively) all ".wav" files in the current
# directory, converts them to ".flac" and deletes original ".wav" files.
# Requires "sox" to be installed. (sudo apt install sox)
SOURCE_EXT="wav"
TARGET_EXT="flac"
# https://unix.stackexchange.com/questions/9496/looping-through-files-with-spaces-in-the-names
find . -type f -name "*.$SOURCE_EXT" -print0 | while IFS= read -r -d '' file
#!/usr/bin/env perl
use File::Basename;
use Cwd 'abs_path';
use 5.014;
use strict;
use warnings;
use utf8;
my $TARGET_WIDTH="640";
my $TARGET_EXT=".mov";
#!/usr/bin/env perl
use File::Basename;
use Cwd 'abs_path';
use 5.014;
use strict;
use warnings;
use utf8;
my $TARGET_WIDTH="1280";
my $TARGET_EXT=".mov";
#!/usr/bin/env perl
use File::Basename;
use Cwd 'abs_path';
use 5.014;
use strict;
use warnings;
use utf8;
my $TARGET_WIDTH="1280";
my $TARGET_EXT=".mov";
#!/usr/bin/env perl
use File::Basename;
use Cwd 'abs_path';
use 5.014;
use strict;
use warnings;
use utf8;
my $TARGET_WIDTH="1280";
my $TARGET_EXT=".mov";
#!/usr/bin/env perl
use File::Basename;
use Cwd 'abs_path';
use 5.014;
use strict;
use warnings;
use utf8;
my $TARGET_WIDTH_HQ="1280";
my $TARGET_WIDTH_PROXY="1280";
#!/bin/bash
# This script generates Pornhub-style video previews,
# composed of a series of meaningful
# scenes distributed equally across entire video.
WIDTH_VAL=320 #default thumbnail width. Can be overwritten by using third CLI argument
OUTPUT_CRF=30 #output quality. 30 is fairly low and results in small file sizes
SNIPPET_SAMPLE_F=10 #for 1 second of the video, extract this number of frames
SNIPPET_FPS="$SNIPPET_SAMPLE_F/1"