Skip to content

Instantly share code, notes, and snippets.

@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
@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.
// 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 / 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
@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