Skip to content

Instantly share code, notes, and snippets.

View rmrfslashbin's full-sized avatar

Robert Sigler rmrfslashbin

View GitHub Profile
@rmrfslashbin
rmrfslashbin / RSA-Encryption-Notes.md
Last active September 20, 2018 17:28
Notes related to using public/private keys to encrypt data

RSA Encryption Notes

Notes related to using public/private keys to encrypt data.

Generate a private/public keypair

This section generates a new private key and extracts the public key.

Private & public parts

openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:4096

Extract public part

openssl rsa -pubout -in private_key.pem -out public_key.pem

@rmrfslashbin
rmrfslashbin / keybase.md
Last active September 20, 2018 18:25
My Keybase Proof

Keybase proof

I hereby claim:

  • I am rmrfslashbin on github.
  • I am rmrfslashbin (https://keybase.io/rmrfslashbin) on keybase.
  • I have a public key ASCcgFp0cp9qksvUqIs9i9iaiMscJkzD-mRGYbeLpCHGiQo

To claim this, I am signing this object:

@rmrfslashbin
rmrfslashbin / str2hex.py
Created October 3, 2019 01:04
Convert a string to hex
#!/usr/bin/env python
import binascii
def getHex(string):
x = binascii.hexlify(string.encode())
y = str(x,'ascii')
print("hex ", y)
@rmrfslashbin
rmrfslashbin / pipe-to-audio.md
Last active April 24, 2020 16:29
Howto: Pipe stuff to /dev/audio

Sometimes /dev/urandom sounds nice.

$ cat /dev/urandom | padsp tee /dev/audio > /dev/null

What about /boot?

$ sudo cat /dev/nvme0n1p2 | padsp tee /dev/audio > /dev/null
@rmrfslashbin
rmrfslashbin / 00-README.md
Last active December 29, 2020 00:34
ESLint fix-on-save for VSCode

ESLint fix-on-save for VSCode

This brief guide will enable fix-on-save in VScode for js and vue files.

Install ESLint

ESLint needs to be installed twice: once inside your project and once globally.

# Install globally
$ npm install -g eslint

# Install in project
#!/usr/bin/env python3
##
# This script walks block storage devices and locates
# EC2 instance stores. It then lables the disks as
# LMV2 physical volumes (PV), creates an LVM2 volume
# group (VG), then an LVM2 logical volume (LV) and
# finally formats the new LV as XFS.
##
@rmrfslashbin
rmrfslashbin / README.md
Last active April 4, 2021 16:44
Quick guide to setting up Clevis TPM/Luks boot-time unlock

A brief guide to set up TPM based luks partition unlocing at boot-time.

BIOS

The TPM must be enabled in the BIOS

Software install

sudo apt install \
  clevis \
 clevis-luks \
@rmrfslashbin
rmrfslashbin / FFMPEG.md
Created August 21, 2021 14:39
A simple one-liner to re-process videos from the phone.

ffmpeg -i ${INPUT} -c:v libx265 -preset veryslow -vf 'format=yuv420p' -crf 28 ${OUTPUT}.mp4

@rmrfslashbin
rmrfslashbin / main.go
Last active September 22, 2021 21:09
Golang function to return a "simple number"
package main
import (
"fmt"
"math"
)
func main() {
fmt.Println(NumberFormat(123))
fmt.Println(NumberFormat(12345))
@rmrfslashbin
rmrfslashbin / python-dotenv-poc.md
Last active October 28, 2021 14:05
Python API Credentials Storage

How to store & access API credentials in Python projects

This gist will explore how to leverage a "dotenv" ecosystem to mange application credentials.

Github Repo

The gist follows code in the repo https://github.com/rmrfslashbin/python-dotenv-poc.

The twelve-factor app

The Twelve-Factor App concept provides numerous best-practice guidelines for applications and scipts. This gist will provide a python-based foundation, using the dotenv concept, to manage application credentials as described here: https://12factor.net/config

python-dotenv