Skip to content

Instantly share code, notes, and snippets.

Marc Chantreux eiro

Block or report user

Report or block eiro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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;
@eiro
eiro / gist:2987642
Created Jun 25, 2012
debut de validateur MARC::MIR
View gist:2987642
#! /usr/bin/perl
use Modern::Perl;
use JSON;
use Plack::Request;
use MARC::MIR;
use Test::Builder;
sub run_test {
my ( $mir ) = @_;
my $tb = Test::Builder->create;
@eiro
eiro / gist:1322199
Created Oct 28, 2011
inotify based autoreload for perl dancer
View gist:1322199
#! /usr/bin/env zsh
dancer_pid=
dancer () {
perl bin/dancer &
dancer_pid=$!
}
kill_dancer () { kill $dancer_pid }
restart_dancer () { kill_dancer && dancer }
changes_in_source_tree () {inotifywait -r -e modify --exclude ".*swp" . }
@eiro
eiro / gist:1277764
Created Oct 11, 2011
compojure + hiccup "hello world"
View gist:1277764
; vim sw=4
(ns compas.core
(:use compojure.core)
(:use hiccup.core)
(:require
[compojure.route :as route]
[compojure.handler :as handler]
)
)
You can’t perform that action at this time.