Skip to content

Instantly share code, notes, and snippets.

View iamleot's full-sized avatar

Leonardo Taccari iamleot

  • Pollenza, Macerata, Italy
View GitHub Profile
@iamleot
iamleot / test-outside-test-package-fixer.awk
Created September 15, 2023 19:10
Mechanically try to solve test-outside-test-package Regal violation for conftest policies
#!/usr/bin/awk -f
#
# Mechanically rewrite OPA policy in order to satisfy requirements of Regal
# test-outside-test-package check. Limited to conftest by only checking and
# adjusting `deny', `warning', `violation' rules.
#
# <https://docs.styra.com/regal/rules/testing/test-outside-test-package>
#
@iamleot
iamleot / patch-rsstail-guid
Created August 18, 2015 15:28
Add guid support to rsstail
--- r2t.c.orig 2015-08-18 14:09:00.000000000 +0000
+++ r2t.c
@@ -139,6 +139,7 @@ void usage(void)
printf("-p show publication date\n");
printf("-a show author\n");
printf("-c show comments\n");
+ printf("-g show guid\n");
printf("-N do not show headings\n");
printf("-b x limit description/comments to x bytes\n");
printf("-z continue even if there are XML parser errors in the RSS feed\n");
@iamleot
iamleot / patch-rsstail-nullencoding
Created July 19, 2015 16:11
rsstail: handle possible NULL *encoding
dtff --git a/r2t.c b/r2t.c
index ec94369..f444b6c 100644
--- a/r2t.c
+++ b/r2t.c
@@ -439,6 +439,10 @@ int main(int argc, char *argv[])
return 2;
}
+ if (data_cur[cur_url]->encoding == NULL) {
+ data_cur[cur_url]->encoding = "utf-8";
@iamleot
iamleot / patch-sane-backends-1.0.24
Created July 1, 2015 12:40
Update print/sane-backends to 1.0.24
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/graphics/sane-backends/Makefile,v
retrieving revision 1.61
diff -u -r1.61 Makefile
--- Makefile 9 Jan 2015 16:34:19 -0000 1.61
+++ Makefile 14 Jun 2015 14:12:08 -0000
@@ -63,7 +63,8 @@
.include "options.mk"
@iamleot
iamleot / patch-xfe
Created June 29, 2015 15:05
xfe-1.40: also checks older freetype2 versions (pkg/49878)
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/xfe/Makefile,v
retrieving revision 1.48
diff -u -r1.48 Makefile
--- Makefile 25 Apr 2015 14:24:56 -0000 1.48
+++ Makefile 6 May 2015 18:12:03 -0000
@@ -1,13 +1,14 @@
# $NetBSD: Makefile,v 1.48 2015/04/25 14:24:56 tnn Exp $
@iamleot
iamleot / patch-audio_chmap.c
Created May 21, 2015 18:03
mpv-0.9.2: avoid conflicts with NetBSD popcount(3)
$NetBSD$
Avoid conflicts with NetBSD popcount(3).
--- audio/chmap.c.orig 2015-05-19 02:19:25.000000000 +0000
+++ audio/chmap.c
@@ -395,7 +395,7 @@ void mp_chmap_get_reorder(int src[MP_NUM
assert(src[n] < 0 || (to->speaker[n] == from->speaker[src[n]]));
}
@iamleot
iamleot / grub.cfg
Created May 15, 2015 15:37
Configuration file for grub to boot NetBSD
set timeout=2
set default=0
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
menuentry "NetBSD" {
knetbsd (hd0,gpt5)/netbsd -r dk4
@iamleot
iamleot / sedcloud
Created April 27, 2014 13:26
sed(1) regular expression to parse http://soundcloud.com/*/tracks pages
sed -nE '/window.SC.bufferTracks.push/ s/.*"title":"([^"]*)".*"streamUrl":"([^"]*)".*/ftp -o "\1.mp3" "\2"/p'