Skip to content

Instantly share code, notes, and snippets.

View jhult's full-sized avatar

Jonathan Hult jhult

View GitHub Profile
mlr --icsv --ocsv cut -o -f "Order ID","Title","Item Total" then put '$Title=gsub($Title, "\"", "")' items.csv > tmp-items.csv && mlr --icsv --ocsv cut -o -f "Order Date","Order ID","Total Charged","Payment Instrument Type" then nest --implode --values --across-records -f "Total Charged" orders.csv > tmp-orders.csv && mlr --icsv --ocsv join -u -j "Order ID" --lp order_ --rp item_ -f tmp-orders.csv tmp-items.csv > merged.csv && rm tmp-orders.csv tmp-items.csv
@jhult
jhult / rg_replace.sh
Last active June 30, 2023 03:51 — forked from jefflombard/ag_replace.sh
rgr command - Find and Replace with rg on macOS
#!/bin/zsh
rgr() {
# find and replace
regex="s?${1}?${2}?g;"
rg $1 -l | xargs sed -i.rgr_backup $regex
# delete backups
find . -name "*.rgr_backup" -print0 | xargs rm
}
@jhult
jhult / glibc-2.17_centos6.sh
Last active September 2, 2024 08:38 — forked from harv/glibc-2.17_centos6.sh
update glibc to 2.17 for CentOS 6
#!/bin/bash
# update glibc to 2.17 for CentOS 6
GLIBC=glibc
OS=el6
SERVER=https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6
VERSION=2.17-55
FULL_VERSION=$GLIBC-$VERSION.fc20
X64=x86_64
@jhult
jhult / ldif2json
Last active October 12, 2023 12:56 — forked from Xophmeister/ldif2json
Quick-and-Dirty LDIF to JSON convertor
#!/usr/bin/env -S gawk -f
# Convert LDIF into JSON
# MIT License
# Copyright (c) 2017 Christopher Harrison
function json_string(str) {
# Convert backslashes to double-backslashes
str = gensub("\\\\", "\\\\\\\\", "g", str)