Skip to content

Instantly share code, notes, and snippets.

View eserte's full-sized avatar

Slaven Rezić eserte

  • N 52.507377 E 13.460589
View GitHub Profile
@eserte
eserte / tkpstree
Created March 24, 2023 18:45
Tk based process tree viewer, was created with heavy ChatGPT assistence
#!/usr/bin/env pistachio-perl
# -*- perl -*-
use strict;
use warnings;
use Tk;
use Tk::ROText;
use Proc::ProcessTable;
use List::Util qw(first);
eval 'use Tie::IxHash';
@eserte
eserte / rcs2cvsrepo.pl
Last active April 26, 2019 14:35
rcs2git
#!/usr/bin/perl -w
# -*- perl -*-
#
# $Id: rcs2cvsrepo.pl,v 1.3 2008/12/31 13:52:17 eserte Exp eserte $
# Author: Slaven Rezic
#
# Copyright (C) 2008 Slaven Rezic. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
@eserte
eserte / Hash-NoShareKeys.md
Last active August 16, 2018 13:20
Hash-NoShareKeys

Hash::NoShareKeys

Provide a function Hash::NoShareKeys::apply to disable sharing of hash keys on the specified hash (reference).

See test.pl for a usage example.

Memory consumption on a single hash with one million keys (tested on a Linux Mint 18 system with self-compiled perl 5.28.0, unthreaded):

@eserte
eserte / Devel-PLstrtab.md
Last active August 16, 2018 13:09
Devel-PLstrtab

See test.pl for a usage example.

#!/usr/bin/perl -w
# -*- perl -*-
#
# Author: Slaven Rezic
#
# Copyright (C) 2015-2018 Slaven Rezic. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
## for ctr_good_or_invalid.pl --auto-good-file
##
# may pass with -addthisperlpath -pre Switch
#"fail.a2pdf-1.13.
"fail.ABNF-Grammar-0.08.
"fail.AcePerl-1.92.
"fail.Acme-24-0.04.
"fail.Acme-AjiFry-0.09.
"fail.Acme-AlgebraicToRPN-0.02.
"fail.Acme-Archive-Mbox-0.01.
// ==UserScript==
// @name filter_with_comment
// @namespace www.rezic.de
// @include http://analysis.cpantesters.org/beforemaintrelease*
// @version 1
// @grant none
// ==/UserScript==
var filtered = false;
var t = document.getElementById("beforemaintrelease_main");
if (!t) {
@eserte
eserte / CPANDebianInstaller.pm
Last active May 13, 2016 20:55
CPANDebianInstaller.pm - handle debian package dependencies of CPAN modules
package CPANDebianInstaller;
use strict;
use warnings;
sub new { bless {}, shift }
sub post_get {
my($self, $dist) = @_;
my %packages;
if (0) {
} elsif ($dist->base_id =~ m{^Cairo-\d}) {
Output from '/usr/bin/make test':
Running Mkbootstrap for Git::Raw ()
chmod 644 "Raw.bs"
PERL_DL_NONLAZY=1 "/bbbike/perl-5.20.0t/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-compile.t .............. ok
t/01-repo.t ................. ok
# Failed test at t/02-commit.t line 244.
# got: '
@eserte
eserte / strace-expect.log
Created September 18, 2014 20:28
strace snippet from a failing Expect 1.31 test on a linux system
19152 20:05:49.980597 open("/var/tmp/cpansmoker-1001/1cOTft7OXw/expect_output_file", O_WRONLY|O_CREAT|O_TRUNC, 0666 <unfinished ...>
17757 20:05:49.980629 select(8, [3 5], NULL, NULL, NULL <unfinished ...>
19152 20:05:49.980681 <... open resumed> ) = 4
19152 20:05:49.980709 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffd4b52150) = -1 ENOTTY (Inappropriate ioctl for device)
19152 20:05:49.980752 lseek(4, 0, SEEK_CUR) = 0
19152 20:05:49.980791 fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
19152 20:05:49.980856 fcntl(4, F_SETFD, FD_CLOEXEC) = 0
19152 20:05:49.980933 write(3, "second\n", 7) = 7
19152 20:05:49.981007 time(NULL) = 1411070749
19152 20:05:49.981050 time(NULL) = 1411070749