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
""" | |
fizzbuzz.py | |
Implement fizzbuzz without using a comparison operator. | |
Because I said I could. | |
""" | |
import sys |
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/local/bin/python | |
"""Ask complicated maths questions.""" | |
__revision__ = 1 | |
import sys | |
import random | |
import operator |
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
http https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/eu-west-2/index.json | jq '[ .products | to_entries | .[].value.attributes.instanceType | select(. != null) | scan("^[a-z0-9]+") ] | unique' |
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 | |
#MIT No Attribution | |
# | |
#Copyright 2020 James Seward | |
# | |
#Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
#software and associated documentation files (the "Software"), to deal in the Software | |
#without restriction, including without limitation the rights to use, copy, modify, | |
#merge, publish, distribute, sublicense, and/or sell copies of the Software, and to |
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 zsh | |
log_path=/Library/Logs/ArqAgent/backup | |
last_file=(${log_path}/*(om[1])) | |
if grep -q "Backup activity ended" "$last_file"; then | |
echo no | |
exit 1 | |
fi | |
echo yes |
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 zsh | |
# Disable Amazon GuardDuty's k8s log parsing thing everywhere | |
# Assumes at most one GuardDuty detector in each region | |
# Docs: https://docs.aws.amazon.com/guardduty/latest/ug/kubernetes-protection.html | |
for r in $(aws ec2 describe-regions --query 'Regions[].RegionName' --output text); do | |
detector=$( aws guardduty list-detectors --query DetectorIds --output text --region "$r" ) | |
if [[ -z $detector ]]; then |
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
from PIL import Image, ImageDraw | |
WIDTH = 180 | |
HEIGHT = 240 | |
im = Image.new("L", (WIDTH, HEIGHT)) | |
with open("230119180929.irg", "rb") as in_file: | |
in_file.seek(0x7E) | |
draw = ImageDraw.Draw(im) |
OlderNewer