Skip to content

Instantly share code, notes, and snippets.

@celesteking
celesteking / list.sh
Last active January 31, 2024 16:31
vault list /pki/certs but with more info
# Enumerates vault /pki/certs outputting subject and SAN of certificates.
# openssl must be of latest version
vault list -format json /pki/certs | jq -r .[] | while read serial; do data=$(vault read -format=json pki/cert/$serial); (echo "$data" | jq -er '.data.revocation_time > 0 ' >/dev/null) && echo "******REVOKED*******" || echo "-------- OK --------"; echo $serial; echo "$data" | jq -r '.data.certificate' | openssl x509 -noout -nameopt RFC2253 -subject -enddate -ext subjectAltName 2>/dev/null; echo; done
@celesteking
celesteking / jira_to_gitlab_issues_import.py
Created January 19, 2024 00:15
JIRA to GITLAB issue migration script
# Stolen from some other guy
# Sniffs issues from old JIRA and tries to import them into GITLAB.
# Does comments, too.
#
# You've got to create additional user in gitlab called `defuser`.
# Make sure to make all users of respective gitlab project as owners, otherwise comment/issues time goes bonkers.
# Doesn't work with JIRA user/pass but instead requires a 'personal token'.
import requests
from requests.auth import HTTPBasicAuth
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@celesteking
celesteking / spamassassin.md
Last active May 12, 2020 20:20
spamassassin: what you need to know.

Fucking SA can't get their shitty doc right. Here's the proper doc.

Config

score SYMBOLIC_TEST_NAME n.nn [ n.nn n.nn n.nn ]

Here's what these scores actually mean:

@celesteking
celesteking / pm2-myuser.service
Last active April 29, 2020 19:24
PM2 systemd unit file - under SCL
# put this into /etc/systemd/system/pm2-myuser.service , then `systemctl daemon-reload`
# `myuser` should be replaced with your username and `ExecXXX` params adjusted to relevant paths.
# This systemd unit file will spawn nodejs PM2 process manager.
# It's an adapted version of `pm2 startup` and contains proper things to use with latest systemd.
# This one uses nodejs from SCL (centos/redhat software collections) and allows you to get rid of error:
# systemd[1]: New main PID XXX does not belong to service, and PID file is not owned by root. Refusing.
# If you don't use SCL, just adjust `ExecXXX` params accordingly.
@celesteking
celesteking / expl.md
Last active February 21, 2020 14:47
Can't SSH out of gitlab/docker instance to remote host? "can't open /dev/tty: No such device or address"

Look no further! It's not a problem with you, it's a problem with SSH client. The issue is that your private key file is missing the trailing newline and ssh just can't understand that file thinking that it's been encrypted with a passprhase -- what a dork!

your debug output would be like this:

debug1: read_passphrase: can't open /dev/tty: No such device or address
debug2: no passphrase given, try next key
case override
when Array, String
hierarchy.insert(0, override)
when Hash
hierarchy.insert(override['position'].to_i, override['datasource'])
end
class bacula::config::common {
# run after all packages have been installed
Package <| tag == 'bacula' |>
->
anchor { 'bacula::config::common::begin': }
->
ETC
}
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff3c3ac3d in malloc_consolidate () from /lib64/libc.so.6
(gdb) bt
#0 0x00007ffff3c3ac3d in malloc_consolidate () from /lib64/libc.so.6
#1 0x00007ffff3c3ce69 in _int_malloc () from /lib64/libc.so.6
#2 0x00007ffff3c3f2f9 in malloc () from /lib64/libc.so.6
#3 0x00007ffff5679056 in QByteArray::QByteArray(char const*, int) () from /usr/lib64/qt4/libQtCore.so.4
#4 0x00007ffff567ad92 in QByteArray::mid(int, int) const () from /usr/lib64/qt4/libQtCore.so.4
#5 0x00007ffff7ae0f52 in bt::Torrent::load(QByteArray const&, bool) () from /usr/lib64/libktorrent.so.5
#6 0x00007ffff7ae15ea in bt::Torrent::load(QString const&, bool) () from /usr/lib64/libktorrent.so.5
x86_64-pc-linux-gnu-gcc -m32 ../sysdeps/unix/sysv/linux/execve.c -c -std=gnu99 -fgnu89-inline -O2 -Wall -Winline -Wwrite-strings -fPIC -fmerge-all-constants -fno-strict-aliasing -march=nocona -pipe -Wstrict-prototypes -Wa,-mtune=i686 -U_FORTIFY_SOURCE -U_FORTIFY_SOURCE -U_FORTIFY_SOURCE -I../include -I/tmp/portage/sys-libs/glibc-2.15-r3/work/build-x86-x86_64-pc-linux-gnu-nptl/posix -I/tmp/portage/sys-libs/glibc-2.15-r3/work/build-x86-x86_64-pc-linux-gnu-nptl -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sys