Skip to content

Instantly share code, notes, and snippets.

@dinkypumpkin
dinkypumpkin / etc.fstab
Created Oct 8, 2017 — forked from vadviktor/etc.fstab
Ubuntu guest VMware shared folders using open-vm-tools package and vmhgfs-fuse
View etc.fstab
.host:/vmshared /mnt/vmshared fuse.vmhgfs-fuse allow_other,uid=1000,gid=1000,auto_unmount,defaults 0 0
@dinkypumpkin
dinkypumpkin / URLQueue.pl
Created Sep 28, 2016 — forked from jberger/URLQueue.pl
Modularization of my answer from SO on URL queuing for non-blocking ua
View URLQueue.pl
#!/usr/bin/env perl
package Mojo::URLQueue;
use Mojo::Base 'Mojo::EventEmitter';
use Mojo::UserAgent;
has queue => sub { [] };
has ua => sub { Mojo::UserAgent->new(max_redirects => 5) };
has concurrency => 4;
@dinkypumpkin
dinkypumpkin / mojo-crawler.pl
Created Jun 2, 2016 — forked from creaktive/mojo-crawler.pl
Simple web crawler/scraper implemented using Mojolicious
View mojo-crawler.pl
#!/usr/bin/env perl
use 5.010;
use open qw(:locale);
use strict;
use utf8;
use warnings qw(all);
use Mojo::UserAgent;
# FIFO queue
@dinkypumpkin
dinkypumpkin / perlio.sh
Created Sep 14, 2015
PerlIO binary open check
View perlio.sh
#!/bin/bash
perl -MPerlIO -e 'open($fh, ">", "/dev/null"); print "default = ", join(", ", PerlIO::get_layers($fh)), "\n";'
perl -MPerlIO -e 'open($fh, ">:raw", "/dev/null"); print ":raw = ", join(", ", PerlIO::get_layers($fh)), "\n";'
perl -MPerlIO -e 'open($fh, ">", "/dev/null"); binmode $fh; print "binmode = ", join(", ", PerlIO::get_layers($fh)), "\n";'
perl -V
View hls.sh
#!/usr/bin/env bash
# An oversimplistic HLS player
# Usage:
# $ hls.sh http://example.com/path/to/list.m3u8
CURLOPTS="--buffer --connect-timeout 2 --retry 3 --retry-max-time 3"
F="/tmp/.hls.$(mcookie).ts"
L="$(tempfile -d /tmp/ -p .hls.)"
LL="$(tempfile -d /tmp/ -p .hls.)"