Skip to content

Instantly share code, notes, and snippets.

View kayjtea's full-sized avatar

kim kayjtea

  • 06:29 (UTC -04:00)
View GitHub Profile
openssl s_client -showcerts -verify 5 -connect wikipedia.org:443 < /dev/null |
awk '/BEGIN CERTIFICATE/,/END CERTIFICATE/{ if(/BEGIN CERTIFICATE/){a++}; out="cert"a".pem"; print >out}'
for cert in *.pem; do
newname=$(openssl x509 -noout -subject -in $cert | sed -nE 's/.*CN ?= ?(.*)/\1/; s/[ ,.*]/_/g; s/__/_/g; s/_-_/-/; s/^_//g;p' | tr '[:upper:]' '[:lower:]').pem
echo "${newname}"; mv "${cert}" "${newname}"
done
unbuntu 22.04 has open ssl3, incomptabile with dotnet restore and outdated servers
create manually, with 40gb hard drive; default of 12 is much too small
20.04 works much better
npm set cafile...
use firefox to extract certs
extract certs in CRT single cert format (not chain), rename to .crt, copy to /usr/local/share/ca-certificates, update-ca-certificates
apt install i3
apt install xfce4-terminal
enhanced session is /etc/xrdp/startunbuntu.sh -- export TERMINAL=xfce4-terminal, exec /usr/bin/i3
@kayjtea
kayjtea / klogsw
Last active July 31, 2019 15:18
Watch for kubernetes pod completion and display log; useful for watching output of cronjobs
#!/bin/bash
#
# Watch for Kubernetes pod completion and display log; useful for watching output of cronjobs
#
# Usage: klogsw <pod-prefix|cronjob-name>
#
kubectl get pods -w |
grep --line-buffered "$1.*Completed" |
@kayjtea
kayjtea / main.ts
Last active March 12, 2021 21:23
Azure Service Bus Topic/Subscription: continuously receive messages with typescript/nodejs.
//
// Needs ES6 promise/async
//
// usage:
// env AZURE_SERVICEBUS_CONNECTION_STRING='...' node main.js
//
import * as azure from "azure";
const TOPIC = 'the topic';
@kayjtea
kayjtea / computed-property.ts
Created August 20, 2016 05:22
TypeScript & computed property
import * as bunyan from "bunyan";
let levelMap:{[key: number]: number} = {
[bunyan.TRACE]: 0,
[bunyan.DEBUG]: 0,
[bunyan.INFO]: 1,
[bunyan.WARN]: 2,
[bunyan.ERROR]: 3,
[bunyan.FATAL]: 4
};
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var glob = require('glob');
var webpack = require('webpack');
var PROD = (process.env.NODE_ENV === 'production')
module.exports = {
devtool: PROD ? 'cheap-module-source-map' : 'source-map',
context: path.resolve(__dirname, 'src'),
-- Update a foreign key column with an inserted identity column from another table, without using cursors.
-- The example scenario: update an existing set of orders with newly created tracking numbers.
drop table #order
drop table #tracking_number
drop table #output