This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |