Skip to content

Instantly share code, notes, and snippets.

View javabrett's full-sized avatar

Brett Randall javabrett

View GitHub Profile
@javabrett
javabrett / README.md
Last active November 24, 2023 05:01
Node JS Script to decode and print all certificates in the tls.rootCertificates store

Node JS Script to decode and print all certificates in the tls.rootCertificates store

How to run against a standard Node JS Docker image:

docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app node node-js-print-ca-certs.js

Example output:

@joshuat
joshuat / Slack avatar-less sidebar.md
Last active January 19, 2021 08:25
Remove the avatars from your slack sidebar

Slack has listened to feedback and given us a way to toggle off the sidebar avatars.

(This only seems to be available in the Beta channel at the moment)

Display or hide profile photos

  1. From your desktop, click your profile picture in the top right.
  2. Select Preferences from the menu.
  3. Click Sidebar in the left-side column.
  4. Check or uncheck the boxes next to Show profile photos next to DMs.
@mjambon
mjambon / parallel
Last active March 28, 2024 11:09
bash: Run parallel commands and fail if any of them fails
#! /usr/bin/env bash
#
# Run parallel commands and fail if any of them fails.
#
set -eu
pids=()
for x in 1 2 3; do
@vegasbrianc
vegasbrianc / dashboard.yml
Created March 7, 2018 11:15
Grafana provisioning of Dashboard
apiVersion: 1
providers:
- name: 'Prometheus'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
options:
@valeriyvan
valeriyvan / pickleViewer.py
Created February 13, 2017 13:10 — forked from mcitron/pickleViewer.py
Viewer for arbitrary pickle files
#!/usr/bin/python
import pickle
from collections import defaultdict
from collections import OrderedDict
import sys
def checkDict(inputData):
return (type(inputData) == dict or type(inputData) == defaultdict\
or type(inputData) == OrderedDict)
@gboeing
gboeing / pypi.md
Last active June 17, 2022 16:11
How to organize and distribution a package on pypi

To distribute a package on pypi

Directory structure

/project/
    /package/
        __init__.py
        module.py
 setup.py
object icm {
// Types
type Player = Int
type Chips = Double
type Stacks = Map[Player, Chips]
type Rank = Int
type Money = Double
@mcitron
mcitron / pickleViewer.py
Last active April 30, 2020 14:43
Viewer for arbitrary pickle files
#!/usr/bin/python
import pickle
from collections import defaultdict
from collections import OrderedDict
import sys
def checkDict(inputData):
return (type(inputData) == dict or type(inputData) == defaultdict\
or type(inputData) == OrderedDict)
@ygotthilf
ygotthilf / jwtRS256.sh
Last active September 20, 2024 17:57
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@n0531m
n0531m / list_gcp_iprange.sh
Last active August 19, 2024 13:30
Google Cloud Platform : ip address range
#!/bin/bash
# https://cloud.google.com/compute/docs/faq#find_ip_range
# nslookup -q=TXT _cloud-netblocks.googleusercontent.com 8.8.8.8
myarray=()
for LINE in `dig txt _cloud-netblocks.googleusercontent.com +short | tr " " "\n" | grep include | cut -f 2 -d :`
do
myarray+=($LINE)
for LINE2 in `dig txt $LINE +short | tr " " "\n" | grep include | cut -f 2 -d :`