Skip to content

Instantly share code, notes, and snippets.

View tomredsky's full-sized avatar

Dermot Paikkos tomredsky

  • Science Photo Library
View GitHub Profile
#!/opt/perl5/bin/perl
use Linux::Inotify2;
use Path::Tiny;
use lib 'lib';
use SPL::AppConfig 'conf';
my $config = conf()->{'Model::DSS'};
my $path = $config->{args}->{spool_dir} . '/mediasets';
configure:4824: result: GNU
configure:4895: checking for gcc
configure:4911: found /usr/bin/gcc
configure:4922: result: gcc
configure:5151: checking for C compiler version
configure:5160: gcc --version >&5
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
perl -nle 'print "$1" if ($_=~/spl_number="(K\d{3}\/\d{4})"\s/gm)' mediaset-20180417_63637.xml
======= mediaset-20180417_63637.xml ========
<?xml version="1.0" standalone="yes"?><updates><lightbox juno_mediaset_id="94769" title="cm error" user_id="187" created="2018-04-17" media_type="M"><lightbox_media><media spl_number="K003/5690" position="1"/><media spl_number="K003/5734" position="2"/><media spl_number="K003/5542" position="3"/><media spl_number="K003/5541" position="4"/><media spl_number="K003/5832" position="5"/><media spl_number="K003/7675" position="6"/><media spl_number="K003/9221" position="7"/><media spl_number="K003/9225" position="8"/><media spl_number="K004/0072" position="9"/><media spl_number="K004/0347" position="10"/><media spl_number="K004/1052" position="11"/><media spl_number="K003/9127" position="12"/><media spl_number="K004/3417" position="13"/><media spl_number="K004/3688" position="14"/><media spl_number="K004/4193" position="15"/><media spl_number="K004/4631" position="16"/><med
ffmpeg -i /var/media/footage/k0/07/62/73/k0076273-hd.mov -v error -y -strict -2 -vcodec h264 -profile:v main -pix_fmt yuvj420p -crf 16 -movflags +faststart -b-pyramid none -weightp none -mixed-refs 0 -8x8dct 0 -trellis 0 -vf scale=384:-1 [scaled]; movie=/etc/perl/share/384x384wm_o36.png [logo]; [scaled][logo] overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2:rgb=1 [out] /tmp/k0076273-preview-wm.mp4
@tomredsky
tomredsky / cm-ics-check.t
Created June 14, 2018 08:48
Nightly check on state of CM.iCS column
#!perl
use v5.22;
use warnings;
use Test::More;
use FindBin;
use lib "$FindBin::Bin/../xt/lib";
use JunoTest::Database;
package SPL::Form::User::UpdateEmail;
use HTML::FormHandler::Moose;
extends 'SPL::Form';
use Types::Standard 'InstanceOf';
use namespace::autoclean;
use HTML::FormHandler::Types qw/:all/;
has 'is_html5' => ( is => 'ro', default => 1, );
#!/opt/perl5/bin/perl
use v5.22;
use warnings;
use SPL::AppConfig qw( schema_connect );
use lib 't/lib';
use SPL::Test::Form::ForgotPassword;
use Test::More;
#!/bin/bash
PSQL="/usr/bin/psql"
PGUSER="dpaikkos"
DBNAME="for_import"
DUMP="www-latest.pg"
REMOTE="proxima"
echo "Fetch $DUMP from $REMOTE"
rm -f $DUMP
#!/opt/perl5/bin/perl
use v5.22;
use warnings;
use Type::Tiny;
use Types::Standard qw(Maybe ArrayRef Int);
my $Type = "Type::Tiny"->new(
name => 'OrderBy',
@tomredsky
tomredsky / monthly_range.sql
Created October 24, 2018 13:02
Create series on invoice totals by month
-- Collect min and max date range
WITH range_values AS (
SELECT date_trunc('month', min(dat)) as minval,
date_trunc('month', max(dat)) as maxval
from IV),
-- Generate date range in monthly intervals
months as (
SELECT generate_series(minval, maxval, '1 month'::interval) as month
from range_values