Skip to content

Instantly share code, notes, and snippets.

@MooreDerek
MooreDerek / GCLOUD_TRIGGERS_CLI.md
Created May 11, 2022 20:59
Overriding GCloud Trigger substitutions from the command line

It is possible to initiate a build trigger using gcloud, it's as a easy as:

gcloud beta builds triggers run <TRIGGER_ID>

however, it is not possible to override any of the trigger substitutions using the gcloud command line.

However, there is also a REST API that can be used to do the same thing. You'll need to be logged in

gcloud auth login

@MooreDerek
MooreDerek / CHECKOV-RUN-VSCODE.md
Last active April 21, 2022 22:30
How to run checkov in VS Code

Recently been trying my hand at fixing some issues on checkov. As I've been trying to pick up some of the more complicated issues, I've found the need to run checkov in order to debug it. Being a relative noob with python and VS Codde, I thought it might be useful to note how I got this working.

Follow the Contributing steps to get your environment set up. The main program that runs checkov is checkov/main.py - funny that.

So steps to run it are:

  1. In VS Code open main.py
@MooreDerek
MooreDerek / WSL-KALI-APT-UPDATE-ERROR.md
Last active October 21, 2023 18:22
Installing Kali on WSL getting apt update error

Installing Kali

wsl --install -d kali-linux

When terminal starts up try running

sudo apt upgrade and get the following error:

Get:1 http://wlglam.fsmg.org.nz/kali kali-rolling InRelease [30.6 kB]
Err:1 http://wlglam.fsmg.org.nz/kali kali-rolling InRelease
 The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository 
@MooreDerek
MooreDerek / Filtered List AWS EC2 instances
Created January 19, 2021 02:55
List all EC2 instances with 4 CPUs and more than 30000MB of memory
# List all EC2 instances with 4 CPUs and more than 30000MB of memory
aws ec2 describe-instance-types --filters "Name=vcpu-info.default-vcpus,Values=4" \
--query 'InstanceTypes[?MemoryInfo.SizeInMiB > `30000`].[InstanceType, MemoryInfo.SizeInMiB]'
@MooreDerek
MooreDerek / fargate_public_ip.sh
Created November 5, 2019 22:58
Get the Public IP for a Fargate task
CLUSTER=<cluster>
SERVCICE=<service>
# Make sure that the Fargate has aactually started
aws ecs wait services-stable --cluster ${CLUSTER} --services ${SERVICE}
TASK_ARN=`aws ecs list-tasks --cluster ${CLUSTER} --service-name ${SERVICE} | jq -r '.taskArns[] '`
ENI_ID=`aws ecs describe-tasks --cluster ${CLUSTER} --task "${TASK_ARN}" | \
jq -r '.tasks[] | .attachments[] | .details[] | select(.name=="networkInterfaceId") | .value'`