This file contains hidden or 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
awk 'NR==FNR {a[$1]++; next} $1 in a' words myfile | |
grep -Fw -f words myfile | |
#* This would extract the lines in myfile that contains the words in the file words anywhere. | |
#The strings in words are treated as fixed strings (not regular expressions) due to the -F option, and the -w option ensures that we only get lines that contains the exact same word (no matches of substrings in words are allowed). | |
#The words in the file words most be listed on separate lines. |
This file contains hidden or 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 bash | |
set -x | |
chmod +x "$1" | |
docker build -t $1 -f- . <<EOF | |
FROM osexp2000/ubuntu-with-utils | |
COPY $1 ./ | |
USER root | |
ENTRYPOINT [ "bash", "$1" ] | |
EOF |
This file contains hidden or 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
using System; | |
using System.Linq; | |
using Xunit; | |
using Xunit.Abstractions; | |
namespace Jail.Booking.ComponentTests | |
{ | |
public class DebugTests | |
{ | |
private readonly ITestOutputHelper _outputHelper; |
This file contains hidden or 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
:${1?addf name 'body'} | |
func_filename="$FUNCS/$1" | |
func_body=$2 | |
if [[ -f $func_filename ]]; | |
then | |
echo "Existing found:" | |
highlight $func_filename --syntax bash | |
read -q "REPLY?Overwrite existing function?" | |
fi |
This file contains hidden or 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
aws ecr --region=us-west-2 describe-repositories | jq -r '.repositories[] | .repositoryName' | grep paul | xargs -L1 aws ecr --region=us-west-2 delete-repository --repository-name |
This file contains hidden or 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
docker build -t ptoaccept --platform amd64 -f Dockerfile ../../../.. | |
docker run --rm --platform linux/amd64 -v $(pwd)/TestResults:/app/TestResults ptoaccept |
This file contains hidden or 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
tf workspace select test | |
tf import module.waf.aws_wafv2_ip_set.main_waf_ip_blacklist cf1527f5-b1f9-48d0-b30a-9708de235b0b/pto-waf-ip-blacklist/REGIONAL | |
tf import module.waf.aws_wafv2_web_acl.main_waf_acl ac78a099-ae47-42d8-a2d6-3c32932470fe/pto-test-main-waf/REGIONAL | |
tf workspace select stage | |
tf import module.waf.aws_wafv2_web_acl.main_waf_acl fdddc840-67ef-4836-a59c-e7b319d9e673/pto-stage-main-waf/REGIONAL |
This file contains hidden or 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
user=user | |
password=`openssl passwd -1 -salt xyz your-password-here` | |
cp /etc/passwd /tmp/passwd.bak | |
echo "${user}:${password}:1000:1000:User,,,:/tmp/${user}:/bin/sh" >> /etc/passwd | |
mkdir /tmp/${user} | |
chmod 1000:1000 /tmp/user |
This file contains hidden or 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
# list of all domains | |
doctl compute domain list | cut -w -f1 | tail -n +2 | xargs curl -v -m 1 | |
# show all NS record ids | |
doctl compute domain records list paulhenkin.com | grep NS | cut -w -f1 | |
This file contains hidden or 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 | |
# assumes bunyan-seq is installed globally - "npm install -g bunyan-seq" | |
# run with: npm run dev | ./bunyan-seq.sh | |
# SEQ_TOKEN comes from either $1, SEQ_TOKEN environment variable, or contents of ~/.seq_token | |
# This script assumes you've previously created a SEQ_TOKEN (reseq.sh - https://gist.githubusercontent.com/henkin/4b965bb0e71223a5d9436507dd717ec0/raw/636ac6f219010042ae0cbf233ffe1fe19c9a052a/reseq.sh) | |
export SEQ_TOKEN=${1:-${SEQ_TOKEN:-$(cat ~/.seq_token)}} | |
echo "token: $SEQ_TOKEN" | |
bunyan-seq --serverUrl http://localhost:5341 --apiKey $SEQ_TOKEN --logOtherAs Debug |