Skip to content

Instantly share code, notes, and snippets.

View Segmentational's full-sized avatar

Jacob B. Sanders Segmentational

  • Colorado, United States
  • 22:48 (UTC -12:00)
View GitHub Profile
@Segmentational
Segmentational / AWS-List-Available-Regions.Bash
Last active December 21, 2021 22:20
AWS List Available Regions Bash Script
aws ec2 describe-regions --all-region --query '*[].RegionName'
@Segmentational
Segmentational / index.ts
Created December 23, 2021 05:39
Class Proxying Functional Compositions Node.js
class Construct extends Function {
layers: boolean | undefined = undefined;
service: boolean | undefined = undefined;
artifacts: boolean | undefined = undefined;
new() {
return new Construct();
}
constructor() {
import * as URL from "url";
import * as HTTPs from "https";
/***
* HTTPs Query Configuration Object
* --------------------------------
*
* @param url { String }
*
* @param method {String}
@Segmentational
Segmentational / index.js
Last active February 5, 2022 07:20
HTTPs Request, Configuration, and Exportable Module
import * as URL from "url";
import * as HTTPs from "https";
/***
* HTTPs Query Configuration Object
* --------------------------------
*
* @param url { String }
*
* @param method {String}
@Segmentational
Segmentational / Command.Bash
Created December 26, 2021 03:16
AWS SSM Regions Parameter
aws ssm get-parameters-by-path --path /aws/service/global-infrastructure/services/lambda/regions \
--query 'Parameters[].Value' --output text | tr '[:blank:]' '\n' | grep -v -e ^cn- -e ^us-gov- | sort -r
@Segmentational
Segmentational / Script.Perl
Created January 1, 2022 19:02
Perl Symbolic Links
#!/usr/bin/perl
use Cwd;
use strict;
use warnings;
use File::Find;
my $CWD = Cwd::abs_path();
@Segmentational
Segmentational / package.json
Created January 1, 2022 19:04
TLS `package.json` NPM Package Script Command(s)
{
"tls.generate": "openssl req -config localhost.conf -new -x509 -sha256 -newkey rsa:2048 -nodes -keyout localhost.key -days 1024 -out localhost.crt",
"tls.encrypt": "openssl pkcs12 -export -out localhost.pfx -inkey localhost.key -in localhost.crt",
"tls.macos.sign": "sudo security -v add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain localhost.crt",
"tls.ubuntu.install": "sudo apt install libnss3-tools --yes",
"tls.ubuntu.store": "pk12util -d \"sql:${HOME}/.pki/nssdb\" -i localhost.pfx",
"tls.ubuntu.approve": "certutil -d sql:${HOME}/.pki/nssdb -A -t \"P,,\" -n \"Development Certificate\" -i localhost.crt"
}
@Segmentational
Segmentational / Script.Bash
Created January 1, 2022 19:04
Git Bash Commit Message Wrapper with Remote Branch Resolution
#!/bin/env bash --posix
# -*- Coding: UTF-8 -*- #
# -*- System: Linux -*- #
# -*- Usage: *.* -*- #
set -euo pipefail
#
# ========================================================================
@Segmentational
Segmentational / index.js
Created January 1, 2022 19:07
Node NPM HTTPs Form Writing Standard Library
const FS = require("fs");
const Path = require("path");
const Query = require("querystring");
const Runtime = require("process");
const Process = require("child_process");
/// Signals: https://man7.org/linux/man-pages/man3/errno.3.html
const CWD = Path.parse(Path.resolve("."));
const Package = Runtime.env.npm_package_configuration || Runtime.env.npm_package_json;
@Segmentational
Segmentational / NGINX.py
Created January 10, 2022 23:28
Python NGINX Interface Class + Utilities
import re
import shlex
import shutil
import subprocess
import dataclasses
from subprocess import Popen
from typing import Union, Any
@dataclasses.dataclass
class Semantic: