Skip to content

Instantly share code, notes, and snippets.

@eiro
eiro / guifa.p6
Created Oct 1, 2019
thank you #perl6
View guifa.p6
my %files{Buf} =
classify {.slurp: :bin},
grep {.f && .r},
dir 'videos';
@eiro
eiro / fat.zsh
Created Oct 1, 2019
detect the fat of your pdf
View fat.zsh
count_fat () awk -vmd5=1 -vfile=2 '
{ ++used[$md5] ; name[$md5]=$file }
END {
# is fat only if used more than 1 time
for (n in name)
if (--used[n])
print name[n],used[n]
}
'
@eiro
eiro / viml-debugger-anymone.txt
Last active Sep 21, 2019
a viml debugger? (bd adding extra "ghost" lines in my registers)
View viml-debugger-anymone.txt
ehllo people,
using vim 8.1.1401 (provided by debian), i wanted to write
a plugin to highlight the covered and uncovered parts
of a golang code.
this is a sample of the cover.out file:
mode: set
github.com/libretro/ludo/input/input.go:53.43,54.34 1 0
View perl
sub { @{shift->{TrafficChecker}{Proxy}}{qw(Protocol Host Port)} = qw(https hello.com 1212) }
sub {
map { @$_{qw(Protocol Host Port)} = qw(https hello.com 1212) };
shift>{TrafficChecker}{Proxy}
}
sub ($self) {
map { @$_{qw(Protocol Host Port)} = qw(https hello.com 1212) };
$self->{TrafficChecker}{Proxy}
@eiro
eiro / gist:2da9cd61b3b4f65dd5a33d35b4ee765f
Created Jan 12, 2018
error while starting sympa (from buster, apt install sympa)
View gist:2da9cd61b3b4f65dd5a33d35b4ee765f
Created symlink /etc/systemd/system/multi-user.target.wants/sympa.service → /lib/systemd/system/sympa.service.
sympa-archived.service is a disabled or a static unit, not starting it.
sympa-bounced.service is a disabled or a static unit, not starting it.
sympa-bulk.service is a disabled or a static unit, not starting it.
sympa-task_manager.service is a disabled or a static unit, not starting it.
W: APT had planned for dpkg to do more than it reported back (0 vs 4).
Affected packages: sympa:amd64
@eiro
eiro / outch.ksh
Created May 12, 2017
weird mksh local array ?
View outch.ksh
# i use MIRBSD KSH R54 2016/11/11
# i don't understand why if i uncomment this line
# set -u
# i get this message
# outch.ksh[21]: _m4a[@]: parameter not set
# as it seems _m4 works
_mma () {
@eiro
eiro / hello.pl
Created May 4, 2015
my first attempt to log
View hello.pl
use vars qw($VERSION %IRSSI);
use Irssi;
use Eirotic;
use re '/x';
Irssi::signal_add "message public" , sub {
my ( $srv, $msg, $nick, $address, $target ) = @_;
state $fh = do {
open my $w, '>>','/tmp/logmetender';
@eiro
eiro / gist:5299751
Created Apr 3, 2013
ASN to MIR and ISO2709
View gist:5299751
#! /usr/bin/perl
use Modern::Perl;
use YAML;
use Perlude;
use MARC::MIR;
sub tokenize {
my @t;
push @t,{%+} while m{
\G\s*
View gist:5237064
sub parse_path (_) {
my %data;
@data{qw< name path file ext >} = map {
$_
, [split m(/)]
, m{
( # file
[^/]*?
( # ext
[^.]*?)) $ }x
@eiro
eiro / p5_ls_packlist.pl
Created Jan 27, 2013
remove cpan packlist and content
View p5_ls_packlist.pl
#! /usr/bin/perl
# usage: perl p5_ls_packlist.pl Perlude MARC::MIR | xargs rm
use Modern::Perl;
use File::Find::Rule;
use File::Slurp;
my $matches = do {
s,::,/,g for my @path = @ARGV;
my $pattern = sprintf '/(?:%s)/.packlist$', join '|', @path;
You can’t perform that action at this time.