Skip to content

Instantly share code, notes, and snippets.

View stctheproducer's full-sized avatar

Chanda Mulenga stctheproducer

View GitHub Profile
@stctheproducer
stctheproducer / keybase.md
Created January 8, 2025 21:20 — forked from sinewalker/keybase.md
How to import pub/sec PGP keys from keybase to your local GPG keyring.

Import Keybase PGP to GPG

After installing the keybase command-line tool onto a new / fresh computer, you may want to import your PGP key to the local keyring so that you may use the keys with GPG.

Import your PUBLIC PGP key:

keybase pgp export|gpg --import -
@stctheproducer
stctheproducer / app.ts
Last active November 15, 2024 12:05
This is the Svelte implementation of the `Link` component provided by the `Tuyau` package (https://github.com/Julien-R44/tuyau). The types are a little hacky because the Inertia Link component was built in Svelte 4.
// ...imports here
import { setTuyauState, TUYAU_KEY } from '../components/tuyau_state'
const context = new Map([[TUYAU_KEY, setTuyauState()]])
createInertiaApp({
// ...other configs
setup({ el, App, props }) {
if (el?.dataset.serverRendered === 'true') {
@stctheproducer
stctheproducer / money.ts
Created October 24, 2024 14:58
Money class with mathjs evaluation and dinero.js
import * as currencies from '@dinero.js/currencies'
import {
allocate,
createDinero,
dinero,
type Dinero,
type Calculator,
type Currency,
type DivideOperation,
add,
@stctheproducer
stctheproducer / ca-store-generator.js
Created August 21, 2023 14:42 — forked from othiym23/ca-store-generator.js
Hacky script to download Mozilla's root CA store and turn it into a bundle suitable for use with Node TLS.
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var request = require('request');
var CERTDB_URL =
'https://mxr.mozilla.org/nss/source/lib/ckfw/builtins/certdata.txt?raw=1';
var OUTFILE = './certificates.js';
@stctheproducer
stctheproducer / arrayBufferToString.ts
Last active December 2, 2021 16:23
A TypeScript function to convert an array buffer to a binary string
const arrayBufferToString = (arrayBuffer: ArrayBuffer): string => {
let binary = ''
const bytes = new Uint8Array(arrayBuffer)
const len = bytes.byteLength
for (var i = 0; i < len; i++) {
binary += String.fromCharCode(bytes[i])
}
return binary
@stctheproducer
stctheproducer / .envrc
Created September 22, 2021 08:38
Default .envrc to be used with direnv
[ -f .env ] && eval $(cat .env | sed 's/^/export /') || echo "no .env file"
@stctheproducer
stctheproducer / dnsmasq macOS.md
Created September 12, 2021 11:52 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on macOS

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

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

@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

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: