Skip to content

Instantly share code, notes, and snippets.

Past Wordle Breakdown

-ED

worlde verb (present) verb (past) noun adjective participle adverb
BLEED X - X - - -
@gregmark
gregmark / p2columns.awk
Last active August 7, 2022 00:18
p2columns.awk
# p2columns.awk
# -------------
# * aligns two-field output into two even columns
# * column width will equal the number of characters in the longest first-field
# string plus the value of the variable p
# * by default, p (padding) == 1
# * change padding with -v p=N, e.g. to increase padding to 3 spaces:
#
# awk -v p=3 -f awk-script input-file
#
@gregmark
gregmark / terraform_v1.2.3_crash.log
Created June 17, 2022 23:35
Terraform v1.2.3 crash.log on import
2022-06-17T19:34:34.212-0400 [INFO] Terraform version: 1.2.3
2022-06-17T19:34:34.212-0400 [DEBUG] using github.com/hashicorp/go-tfe v1.0.0
2022-06-17T19:34:34.212-0400 [DEBUG] using github.com/hashicorp/hcl/v2 v2.12.0
2022-06-17T19:34:34.212-0400 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
2022-06-17T19:34:34.212-0400 [DEBUG] using github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
2022-06-17T19:34:34.212-0400 [DEBUG] using github.com/zclconf/go-cty v1.10.0
2022-06-17T19:34:34.212-0400 [INFO] Go runtime version: go1.18.1
2022-06-17T19:34:34.212-0400 [INFO] CLI args: []string{"terraform", "import", "time_static.b", "2022-02-02T01:11:11Z"}
2022-06-17T19:34:34.212-0400 [TRACE] Stdout is not a terminal
2022-06-17T19:34:34.212-0400 [TRACE] Stderr is not a terminal
@gregmark
gregmark / git_sneaky_rollback.md
Created September 29, 2021 20:35
Git: roll back a commit using git show

Git: roll back a commit using git show

  1. Get a listing of the files in the commit you want to rollback:
  2. Get the commit hash for the commit before the one you want to "roll back"
  3. Write a script like this one:
#!/bin/bash

dir=core/modules
@gregmark
gregmark / aws_ec2_cheats.md
Last active August 27, 2021 15:00
AWS EC2 Cheat Sheet

AWS EC2 Chitty Shitty

Metadata

Get available leaf nodes

curl http://169.254.169.254/latest/meta-data

Get leaf node

@gregmark
gregmark / macosx_find.md
Last active June 25, 2021 03:20
Find command utility on MacOSX

find command on MacOSX 10.14.6 (Mojave)

Move files older than X=<number of weeks>

find . -ctime +${X}w -print0 | xargs -0 -I{} mv {} /Volumes/USB_DRIVE
@gregmark
gregmark / critical_python_tricks.md
Last active July 29, 2022 23:52
Critical Python Tricks

Critical Python Administrative Fu

virtual env

py3org RealPy

python3 -m venv venv
source venv/bin/activate
@gregmark
gregmark / resume.json
Last active May 20, 2021 20:09
JSON Resume
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Gregory M Chávez",
"label": "DevOps / Site Reliability Engineer",
"image": "https://github.com/gregmark/files/raw/main/avatars/varys2-15k.jpg",
"email": "gregmark@gmail.com",
"phone": "(301) 806-4793",
"url": "https://www.linkedin.com/in/gregmark/",
"summary": "I am a software development generalist with the ability to quickly shift my expertise from different implementations of DevOps, the aspiration, and SRE, the practice. Hot tech skills come and go, but the need for efficient workflows, service observability, code clarity, cost control, team organization, mentorship and automating myself out of a job never will. My commitment to making people and things better every day by leading and contributing to high priority projects, breaking down knowledge silos, sharing information agressively and securing a stake in the organization's success is absolute.",
@gregmark
gregmark / reduce_jpeg_quality_magick.sh
Last active October 7, 2021 00:21
Reduce JPEG image filesize to under 500K with imagemagick
# SETUP
# -----
### install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
### install xquartz, requires system password & log out to complete
brew install xquartz
### install imagemagick
@gregmark
gregmark / vim-cheats-gregmark_1.md
Last active May 2, 2024 03:10
VIM Cheats, gregmark I

VIM Help

CTRL-d - lists possible command completions 
TAB - cycles through possible command completions

Example:

:help tags (then CTRL-d and TAB)