Skip to content

Instantly share code, notes, and snippets.

View robbat2's full-sized avatar

Robin H. Johnson robbat2

View GitHub Profile
> /var/tmp/portage/sys-libs/glibc-2.37-r10/work/build-x86-x86_64-pc-linux-gnu-nptl/tests.sum
FAIL: elf/constload1
FAIL: elf/dblload
FAIL: elf/dblunload
FAIL: elf/ifuncmain6pie
FAIL: elf/lateglobal
FAIL: elf/loadtest
FAIL: elf/preloadtest
FAIL: elf/reldep6
FAIL: elf/restest1
@robbat2
robbat2 / gist:f37e2ba2fbcd2c56cb8547f93dccae52
Last active January 7, 2024 21:13
gentoo bug stats, creation & resolved, as of 2024/01/07
MariaDB [gentoo-bugs]> select now(); \
select count(distinct bug_id), YEAR(bugs_activity.bug_when) AS yyyy \
FROM bugs_activity \
WHERE fieldid=8 AND added='RESOLVED' GROUP BY yyyy ORDER BY yyyy; \
SELECT COUNT(distinct bug_id), EXTRACT(YEAR FROM creation_ts) AS yyyy \
FROM bugs \
GROUP BY yyyy \
ORDER BY yyyy;
+---------------------+
#!/bin/bash
# Clean up a x509 cert to make it nice to use
# supports multiple certs in the same file!
#
# Copyright 2014-2018 Robin H Johnson <robbat2@gentoo.org>
# Licensed under the BSD-3 license
# http://opensource.org/licenses/BSD-3-Clause
TMP=$(mktemp)
TMPD=$(mktemp -d)
TMPOUT=$(mktemp)
@robbat2
robbat2 / parse_date.jq
Last active November 28, 2023 00:18
performance review helper tooling from GitHub API
# SPDX-License: ???
def parseDate(date): date | capture("(?<no_tz>.*)(?<tz_sgn>[-+])(?<tz_hr>\\d{2}):(?<tz_min>\\d{2})$") | (.no_tz + "Z" | sub("\\.000Z";"Z")| fromdateiso8601) - (.tz_sgn + "60" | tonumber) * ((.tz_hr | tonumber) * 60 + (.tz_min | tonumber));
@robbat2
robbat2 / procmailrc rule for gentoo archives
Created September 19, 2023 15:58
gentoo archives mail hash
FORMAIL=/usr/bin/formail
UUID=`/usr/bin/uuidgen`
# inject the salt into the mail
:0 fhw
* H ?? !^X-Archives-Salt
| $FORMAIL -A "X-Archives-Salt: $UUID"
# hash the mail headers, with the salt
HASH=`$FORMAIL -X Received -X Date -X Message-ID -X From -X Subject -X List-Id -X X-Archives-Salt | md5sum | awk '{print $1}'`
@robbat2
robbat2 / issue ticket
Last active July 13, 2023 20:09
gitlab policy change re SSO-linked accounts
Date: Tue, 11 Jul 2023 12:13:53 -0500 (CDT)
From: GitLab <security@gitlab.com>
Subject: [Action Required] Review GitLab Emails Before Lock
To: (personal email, primary on my GitLab account)
Reply-To: security@gitlab.com
Message-ID: (redacted)
We want to let you know that we recently changed the way Enterprise Users <https://docs.gitlab.com/ee/user/enterprise_user/>
are defined <https://about.gitlab.com/handbook/support/workflows/gitlab-com_overview.html#enterprise-users> to ensure that
members can be managed by valid enterprise admins and bolster security for your organization.
{
"Id": "SourceIP",
"Statement": [
{
"Action": "s3:*",
"Condition": {
"NotIpAddress": {
"aws:SourceIp": [
"10.0.0.0/8",
"172.16.0.0/12",
@robbat2
robbat2 / block-compromised-github-key.sh
Created March 24, 2023 07:36
Mark compromised GitHub.com key as revoked
#!/bin/bash
# You might need to insert this in a slightly different place
cat >>/etc/ssh/ssh_config <<EOF
Host *
RevokedHostKeys /etc/ssh/ssh_revoked_hosts
EOF
cat >>/etc/ssh/ssh_revoked_hosts <<EOF
# https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
>>> Creating Manifest for /code/gentoo/gentoo-git/repo/gentoo/app-crypt/age
* age-1.0.0.tar.gz BLAKE2B SHA512 size ;-) ... [ ok ]
* age-1.0.0-deps-tampered.tar.xz BLAKE2B SHA512 size ;-) ... [ ok ]
>>> Unpacking source...
>>> Unpacking age-1.0.0.tar.gz to /var/tmp/portage-tmpfs/portage/app-crypt/age-1.0.0-r1/work
>>> Unpacking age-1.0.0-deps-tampered.tar.xz to /var/tmp/portage-tmpfs/portage/app-crypt/age-1.0.0-r1/work
go mod verify
all modules verified
>>> Source unpacked in /var/tmp/portage-tmpfs/portage/app-crypt/age-1.0.0-r1/work
>>> Preparing source in /var/tmp/portage-tmpfs/portage/app-crypt/age-1.0.0-r1/work/age-1.0.0 ...
Gentoo Golang deps bundled injection PoC
----------------------------------------
Author: Robin H. Johnson <robbat2@gentoo.org>
Date: 2022/10/21
Go build does not catch the injection of malicious code that might have been
included in a deps tarball.
$WORKDIR/age-1.0.0/go.sum (which is more-trusted, since it came from the age
upstream), contains this entry: