Skip to content

Instantly share code, notes, and snippets.

Avatar

Robert Sigler rmrfslashbin

View GitHub Profile
@rmrfslashbin
rmrfslashbin / README.md
Created Jan 21, 2022
Trino SQL Queries
View README.md

Helpful Trino queries

... to fetch data form my aws-cf-rtl0 project.

Docker

I run Trino in a local Docker container. A Trino query can be invoked from the CLI by passing the query into the --execute param.

docker exec -it trino-us-east-1 trino --output-format ALIGNED --execute "${QUERY}"
@rmrfslashbin
rmrfslashbin / Darwin.md
Last active Apr 9, 2022
Minimal MacOS setup guide. System/UI and CLI (zsh, Oh My Zsh, brew, etc).
View Darwin.md
@rmrfslashbin
rmrfslashbin / python-dotenv-poc.md
Last active Oct 28, 2021
Python API Credentials Storage
View python-dotenv-poc.md

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

@rmrfslashbin
rmrfslashbin / main.go
Last active Sep 22, 2021
Golang function to return a "simple number"
View main.go
package main
import (
"fmt"
"math"
)
func main() {
fmt.Println(NumberFormat(123))
fmt.Println(NumberFormat(12345))
@rmrfslashbin
rmrfslashbin / FFMPEG.md
Created Aug 21, 2021
A simple one-liner to re-process videos from the phone.
View FFMPEG.md

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

@rmrfslashbin
rmrfslashbin / README.md
Last active Apr 4, 2021
Quick guide to setting up Clevis TPM/Luks boot-time unlock
View README.md

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 \
View aws_ec2_instance_store_lvm2.py
#!/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 / 00-README.md
Last active Dec 29, 2020
ESLint fix-on-save for VSCode
View 00-README.md

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
@rmrfslashbin
rmrfslashbin / str2hex.py
Created Oct 3, 2019
Convert a string to hex
View str2hex.py
#!/usr/bin/env python
import binascii
def getHex(string):
x = binascii.hexlify(string.encode())
y = str(x,'ascii')
print("hex ", y)
@rmrfslashbin
rmrfslashbin / FoxyProxy.md
Last active Jul 23, 2022
FoxyProxy: HOW-TO route all traffic through a proxy EXCEPT blacklisted domains.
View FoxyProxy.md

FoxyProxy URL pattern filters.

This recipe sets up FoxyProxy to route all traffic through a proxy EXCEPT blacklisted domain (they will go out directly).

Assumptions

This receipe assumes a fresh FoxyProxy install, one proxy for everthing, excluding defined domains.

FoxyProxy Configuration

  • FoxyProxy should be set to Use proxies based on their pre-defined patterns and priorities.
  • Add a new proxy and configure the Proxy Details tab as needed.