Skip to content

Instantly share code, notes, and snippets.

View obengwilliam's full-sized avatar
🎯
Focusing

Obeng William obengwilliam

🎯
Focusing
View GitHub Profile
@obengwilliam
obengwilliam / kubectl.md
Last active February 29, 2020 18:01 — forked from so0k/kubectl.md
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@obengwilliam
obengwilliam / Activate Office 2019 for macOS VoL.md
Created February 16, 2020 21:29 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@obengwilliam
obengwilliam / docker.md
Created October 15, 2019 13:28
# docker

Check logs for healthchecks in a dockerfile

docker inspect --format "{{json .State.Health }}" <container name> | jq
@obengwilliam
obengwilliam / raddit.service
Last active September 25, 2019 22:07 — forked from Artemmkin/raddit.service
Raddit unit file
[Unit]
Description=Raddit application
After=network.target
[Service]
Type=simple
User=obeng
WorkingDirectory=/home/obeng/raddit
ExecStart=/bin/bash -lc 'puma'
Restart=always
const R = require('ramda')
const assert = require('assert')
const body = '<h1>body</>'
const subject = '<h1> subject</h1>'
// function populateDefaults (profile) {
// const cloneProfile = R.clone(profile)
// if (!cloneProfile.template || !cloneProfile.template.products) {
// console.log('No template or no products')
@obengwilliam
obengwilliam / auth-authorisation.md
Last active July 3, 2019 00:16 — forked from omidraha/README.md
Authentication and Authorization Concepts for MicroServices

auth with microservices

Authorization and Authentication are hard. when you only have to implement them once (as you do within a monolith) instead of over and over again, it makes the developer happy :-), and maybe leads to less implementation failures.

When you have a bunch of microservices, this is something that has to be considered.

Implement it once or in every microservice, or something in between?

sudo rabbitmqctl add_user {user} {password}
sudo rabbitmqctl set_user_tags {user} administrator
sudo rabbitmqctl set_permissions -p / {user} ".*" ".*" ".*"
@obengwilliam
obengwilliam / README.md
Created February 14, 2019 03:50 — forked from boneskull/README.md
example of how to debug mocha v4 if hanging

Here's an example of how to debug Mocha v4 if it hangs.

Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).

If you run your test, you'll notice it hangs:

$ mocha test.js
@obengwilliam
obengwilliam / pino-wrapper.js
Last active December 18, 2018 04:43
Simple log api
'use strict'
const {logOnRequest} = require('pino-wrapper')
const app = require('express')()
app.use(logOnRequest()) // should attach a log instance to req.log
{
pid: 93535,
hostname: 'your host',
level: 30,
msg: 'my request',
time: '2016-03-07T12:21:48.766Z',
v: 0,
req: {
id: 42,
method: 'GET',