Skip to content

Instantly share code, notes, and snippets.

View rbairwell's full-sized avatar

Richard Bairwell rbairwell

View GitHub Profile
@rbairwell
rbairwell / in-script-output-logger.sh
Created July 22, 2022 10:12
Bash snippet to log all output (stderr and stdout) to both the console and a log file without any other script changes needed.
#!/bin/bash
# Aby thing that is outputted to either stdout or stderr is then sent to _OUTPUT_LOG_FILE from that point on (along with going to console).
# Problem - when the script ends, "tee" seems to wait for input before continuing.
declare _OUTPUT_LOG_FILE="~/logoutput.txt"
# use base4.1+ timestamping %([%F %T])T
# shellcheck disable=SC2312
if ! exec > >(while read -r line; do printf '%([%F %T])T %s\n' -1 "${line}" | tee -ap --output-error=exit "${_OUTPUT_LOG_FILE}"; done) 2>&1; then
printf "Error %s encountered when trying to startup log file (no error available)\n" "$?"
@rbairwell
rbairwell / Authentic email (with headers)
Created December 11, 2020 10:51
Subway Mailing Data Breach
Delivered-To: #MASKED-LOCAL#@#MASKED-REMOTE#
Received: by 2002:a50:628d:0:0:0:0:0 with SMTP id s13csp4165404ecf;
Wed, 9 Dec 2020 04:32:11 -0800 (PST)
X-Google-Smtp-Source: ABdhPJw4uJEmbSJ1BRRnmL7ibM+yEQWFzWGKlhjaE2EqiGPs+2not5HEgbSBVhXY1q48WT5cr321
X-Received: by 2002:a17:902:6b8c:b029:d6:d32e:4a8c with SMTP id p12-20020a1709026b8cb02900d6d32e4a8cmr1960148plk.28.1607517131558;
Wed, 09 Dec 2020 04:32:11 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1607517131; cv=none;
d=google.com; s=arc-20160816;
b=OzCBpkX6STzga8TYdZF6Qp+zjvS1pxClFawd1Tqmfx8Ly+8Bu9uKDtkjGLTr5JLQM0
K7JZ/5HdBGK/RxcrjCsq4hpvO/YEhFp+W966e55i4biQ8pObOgW4x9AI580TQoGNsgam
Runs in <1s:
SELECT UserEntity.*
FROM (
SELECT UserCoverageEntity.user_id
FROM UserCoverageEntity
WHERE UserCoverageEntity.id=UNHEX('11e9e4e9c970a3f4857698fa9b0d2efc')
UNION
SELECT UserSchemeEntity.user_id
FROM UserSchemeEntity
<?php
$in='Hello, my honey 123 !! ઓ 率 ';
$out=preg_replace('/[^\pL|\pM|\pN|\pP|\pS|\pZ]/u','',$in);
print $out;

Keybase proof

I hereby claim:

  • I am rbairwell on github.
  • I am rbairwell (https://keybase.io/rbairwell) on keybase.
  • I have a public key whose fingerprint is AC68 5E02 49EF 4336 CE26 DF2A DBD2 B347 C069 57E5

To claim this, I am signing this object: