Skip to content

Instantly share code, notes, and snippets.

View stctheproducer's full-sized avatar
👨‍💻
Coding from home

Chanda Mulenga stctheproducer

👨‍💻
Coding from home
View GitHub Profile
@stctheproducer
stctheproducer / AuthController.js
Last active July 6, 2020 19:07
I am getting an error in which my auth session is saved in redis but doesn't seem to be propagated to rest of the application. I am using FusionAuth as my authentication server. Below are my files including their configurations.
async authorize({ request, response }) {
const { response_type } = request.get()
try {
// Check if OAuth flow is Authorization Code Grant Request
if (response_type !== Env.get('OAUTH2_FLOW_TYPE')) {
response.badRequest()
}
// Redirect to FusionAuth
@stctheproducer
stctheproducer / asynForEach.js
Last active December 17, 2020 16:33
A JavaScript asyncronous forEach function to use when working with asynchronous functions and arrays
export const async function asyncForEach(array, callback) {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
@stctheproducer
stctheproducer / dnsmasq.conf
Last active January 6, 2021 05:08
Working DNS Masq conf
# Configuration file for dnsmasq.
#
# Format is one option per line, legal options are the same
# as the long options legal on the command line. See
# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
# Listen on this specific port instead of the standard DNS port
# (53). Setting this to zero completely disables DNS function,
# leaving only DHCP and/or TFTP.
# port=5353
@stctheproducer
stctheproducer / pre-commit
Created January 9, 2021 00:04
A pre-commit hook that bumps the version of the project
#!/bin/sh
# Go to git root
path=`git rev-parse --show-toplevel`
cd "$path"
version=`docker run --rm -v "$(pwd):/repo" gittools/gitversion:5.6.3-alpine.3.12-x64-5.0 /repo /showvariable SemVer`
echo $version > VERSION
@stctheproducer
stctheproducer / GitVersion.yml
Last active January 9, 2021 21:02
Git hook that bumps project version using gitversion
branches:
master:
regex: ^master$|^main$
mode: ContinuousDelivery
tag: ""
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
tracks-release-branches: false
is-release-branch: false
@stctheproducer
stctheproducer / nuxt.config.js
Last active July 16, 2022 21:48
Nuxt Custom Configurations
import crypto from 'crypto'
export default {
publicRuntimeConfig: {
appName: process.env.APP_NAME,
baseUrl: process.env.BASE_URL,
apiUrl: process.env.API_URL,
authUrl: process.env.AUTH_URL,
oauthClientId: process.env.FUSIONAUTH_CLIENT_ID,
oauthTenantId: process.env.FUSIONAUTH_TENANT_ID,
@stctheproducer
stctheproducer / stylelint.config.js
Last active November 4, 2023 06:55
Stylelint config for Tailwind CSS
module.exports = {
extends: ['stylelint-config-recommended'],
// add your custom config here
// https://stylelint.io/user-guide/configuration
rules: {
'at-rule-no-unknown': [
true,
{
ignoreAtRules: [
'apply',

Keybase proof

I hereby claim:

  • I am stctheproducer on github.
  • I am stctheproducer (https://keybase.io/stctheproducer) on keybase.
  • I have a public key ASCXHszwZW9tNrpfUEMPefoMxPGvAiHooEM6QBRrSoy0lAo

To claim this, I am signing this object:

@stctheproducer
stctheproducer / clean-up-arch-linux.md
Created February 15, 2021 08:33 — forked from rumansaleem/clean-up-arch-linux.md
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the