Skip to content

Instantly share code, notes, and snippets.

View avar's full-sized avatar

Ævar Arnfjörð Bjarmason avar

View GitHub Profile
@avar
avar / nmap.txt
Last active September 9, 2022 16:50
KLM WiFi probing
$ sudo nmap -sS 172.19.131.2
Starting Nmap 7.92 ( https://nmap.org ) at 2022-09-09 18:23 CEST
Nmap scan report for 172.19.131.2
Host is up (0.0019s latency).
Not shown: 996 filtered tcp ports (no-response)
PORT STATE SERVICE
80/tcp open http
1000/tcp open cadlock
1443/tcp open ies-lm
3128/tcp open squid-http
diff --git a/src/include/utils/sortsupport.h b/src/include/utils/sortsupport.h
index 8c36cf8d82..e1d209cb66 100644
--- a/src/include/utils/sortsupport.h
+++ b/src/include/utils/sortsupport.h
@@ -193,15 +193,11 @@ typedef struct SortSupportData
/*
- * Apply a sort comparator function and return a 3-way comparison result.
- * This takes care of handling reverse-sort and NULLs-ordering properly.
@avar
avar / coord.c
Created December 6, 2018 21:35
Shows that (in practice, not standard) structs are just a fancy linear container of their types (assuming alignment works out) in memory
#include <stdio.h>
#include <stdlib.h>
struct coord {
int x;
int y;
int z;
};
int main(void)
@avar
avar / pipe_buf_test.pl
Last active August 14, 2018 07:46
PIPE_BUF test
#!/usr/bin/env perl
use v5.10.1;
use strict;
use warnings;
use Fcntl ':DEFAULT';
# Usage:
# >/tmp/append; perl pipe_buf_test.pl /tmp/append A $((2**12)) 4
# Will write 4 lines of 4095 "A"s and \n to /tmp/append
my ($file, $byte, $length, $times) = @ARGV;
@avar
avar / 19505ad6d4750773b2765f769e2783b572683bda.txt
Created May 2, 2018 17:59
19505ad6d4750773b2765f769e2783b572683bda
19505ad6d4750773b2765f769e2783b572683bda
sub meth {
return unless my $self = instance();
return unless my $can = $self->yes_I_can;
return unless my $worker = $self->get_worker($can);
return $worker->work;
}
sub meth {
my $self = instance() or return;
$ nc maildirector.example.com 143
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
0 LOGIN gitlab@example.com "PASSWORD"
0 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE NOTIFY] Logged in
1 EXAMINE "INBOX"
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS ()] Read-only mailbox.
* 0 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1512810065] UIDs valid
@avar
avar / .block
Created October 23, 2017 19:56 — forked from JohannDK/.block
Dreifing frambjóðenda á pólitíska rófinu
license: mit
height: 550
border: no
scrolling: no
@avar
avar / .block
Created October 23, 2017 17:17 — forked from borgar/.block
Dreifing frambjóðenda á pólitíska rófinu
license: mit
height: 550
border: no
scrolling: no
From: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason <avarab@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Tor Arntsen <tor@spacetec.no>, Randal L. Schwartz <merlyn@stonehenge.com>, Jakub Narebski <jnareb@gmail.com>, Tom G. Christensen <tgc@statsbiblioteket.dk>
Subject: Dropping support for older perl (was: curl)
References: <20170809120024.7phdjzjv54uv5dpz@sigill.intra.peff.net>
User-agent: Debian GNU/Linux 8.9 (jessie); Emacs 25.1.1; mu4e 0.9.19
In-reply-to: <20170809120024.7phdjzjv54uv5dpz@sigill.intra.peff.net>
Date: Wed, 09 Aug 2017 21:26:53 +0200
Message-ID: <87bmno5ypu.fsf@gmail.com>
MIME-Version: 1.0