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 -e | |
set -o pipefail | |
if [ $# -ne 0 ]; then | |
echo "Usage: ${0##*/}" >&2 | |
exit 1 | |
fi | |
EARLY_CPIO_DIR=.initrd-mod-early-cpio | |
ARCHIVE_DIR=.initrd-mod-archive |
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 -e | |
set -o pipefail | |
REGION_X=1920 | |
REGION_Y=2210 | |
REGION_WIDTH=320 | |
REGION_HEIGHT=100 | |
RENAME_PATTERN='foo-%s.pdf' | |
for file in "$@"; do |
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 -e | |
set -o pipefail | |
json=$(curl -sS --fail "$PRODUCT_URL" | | |
grep -Po 'Dell.Services.DataModel = .*;' | | |
awk '{sub("Dell.Services.DataModel = ", "");sub(";$", "");print}' | | |
jq '.Stacks[0].Stack' | |
) | |
name=$(jq -r '.Title.InnerValue' <<<"$json") |
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 -e | |
set -o pipefail | |
referrer() { | |
local -n reference="$1" | |
echo "In referrer: ${!reference}" | |
reference=reassigned | |
} |
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 -e | |
set -o pipefail | |
fail() { | |
echo "$*" >&2 | |
return 1 | |
} | |
verify-utilities-available() { | |
local util |
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
@Unroll | |
"LD X, [M] -> #value.hex32"() { | |
setup: | |
Rx3588Processor processor | |
rom.put(0x00 as byte) | |
rom.putInt(value as int) | |
when: | |
processor = new Rx3588Processor().attachRom(rom.array()) | |
processor.setRegister("M", 1) |
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
import java.util.ArrayDeque; | |
import java.util.ArrayList; | |
import java.util.Deque; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.PriorityQueue; | |
import static java.lang.Math.min; | |
import static java.util.stream.Collectors.counting; | |
import static java.util.stream.Collectors.groupingBy; |
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 -e | |
if [ $# -ne 2 -o ! "$1" = "--region" ]; then | |
echo "Usage: ${0##*/} --region <aws-region>" 2>&1 | |
exit 1 | |
fi | |
AWS_REGION="$2" | |
AWS_OPTIONS+=" --region $AWS_REGION --output json" |
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 -e | |
set -o pipefail | |
# PREREQUISITES: | |
# | |
# 1. mailx command line utility | |
# 2. Firewall access to TLS SMTP port 465 on the SES server specified in SES_ENDPOINT, below. | |
# | |
# INSTRUCTIONS: | |
# |
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
import java.util.Map; | |
import java.util.SortedMap; | |
import java.util.TreeMap; | |
public class Dice { | |
public static void main(String[] args) { | |
SortedMap<Long, Long> zeroSixSidedDice = sumOccurrencesOfDiceRoll(6, 0); | |
SortedMap<Long, Long> singleSixSidedDie = sumOccurrencesOfDiceRoll(6, 1); | |
SortedMap<Long, Long> twoSixSidedDice = sumOccurrencesOfDiceRoll(6, 2); | |
SortedMap<Long, Long> threeSixSidedDice = sumOccurrencesOfDiceRoll(6, 3); |