Skip to content

Instantly share code, notes, and snippets.

View caffeinetiger's full-sized avatar

Tony Benavides caffeinetiger

  • Chromatic Ai Swarm
  • Earth
View GitHub Profile
@caffeinetiger
caffeinetiger / docker_multi_platform_building.sh
Last active April 18, 2022 18:17
To use this snippet you will enable the Docker buildx feature which is currently “experimental”. To do so, open up Docker Desktop then navigate to Preferences. Once you’re there, select “Experimental Features” and toggle the slider to on. Click on “A
#!/bin/bash
# List available platforms for building
docker buildx ls
# Create multiple builder instances to build multi-platform with build command
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm64 --push -t membermatters/membermatters .
# Build for single platform
#!/bin/bash
# List installed JDK versions
/usr/libexec/java_home -V
# Export in current session
export JAVA_HOME=`/usr/libexec/java_home -v <version>`
# Create a function in .bashrc, .zshrc, .zshenv, etc
function switch_openjdk_version() {
#!/bin/bash
kubectl autoscale deployment <name-of-deployment> --cpu-percent=75 --min=2 --max=10

Updated: Dec 21, 2020

I’ve personally used these commands to debug in production. I also used GUI methods like k9s and lenses.io.

0. Impersonate a user and group

kubectl get pods --as-group="somecompany:somecompany-teamname" --as="test"
select AURORA_VERSION();
select @@aurora_version;
show variables like '%version';
@caffeinetiger
caffeinetiger / aws_elb_access_logs_headers
Last active April 18, 2022 18:19
Official documentation on access logs and header information: - [Access logs for your Classic Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/access-log-collection.html) - [Access logs for your Network Load Balancer](ht
Application Load Balancer Access Log Headers
type time elb client:port target:port request_processing_time target_processing_time response_processing_time elb_status_code target_status_code received_bytes sent_bytes "request" "user_agent" ssl_cipher ssl_protocol target_group_arn "trace_id" "domain_name" "chosen_cert_arn" matched_rule_priority request_creation_time "actions_executed" "redirect_url" "error_reason" "target:port_list" "target_status_code_list" "classification" "classification_reason"
Network Load Balancer Access Log Headers
type version time elb listener client:port destination:port connection_time tls_handshake_time received_bytes sent_bytes incoming_tls_alert chosen_cert_arn chosen_cert_serial tls_cipher tls_protocol_version tls_named_group domain_name alpn_fe_protocol alpn_be_protocol alpn_client_preference_list
Classic Load Balancer Access Log Headers
@caffeinetiger
caffeinetiger / disable_device.ps1
Last active April 18, 2022 18:19
Take from [Automatically Disable or Enable your GPU (or any other device) when your laptop power state changes](https://dev.to/muhammedziyad/automatically-disable-and-enable-your-gpu-or-any-other-device-when-your-laptop-power-state-changes-hf5). Ena
# Replace string with the Device Instance Path of your choice
pnputil /disable-device "PCI\VEN_10DE&DEV_1FBC&SUBSYS_0A691028&REV_A1\4&30232E66&0&0008"
@caffeinetiger
caffeinetiger / install_krew_kubectl_plugin_manager.sh
Last active April 18, 2022 18:20
Some tips and tricks on getting logs using kubectl. ### Sources - [stack overflow - kubectl logs - continously](https://stackoverflow.com/questions/39454962/kubectl-logs-continuously) - [Krew - kubectl plugin manager](https://krew.sigs.k8s.io/) - [s
#!/bin/bash
(
set -x; cd "$(mktemp -d)" &&
OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
KREW="krew-${OS}_${ARCH}" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
tar zxvf "${KREW}.tar.gz" &&
./"${KREW}" install krew
@caffeinetiger
caffeinetiger / install_all_aws_tools_modules.ps1
Last active April 18, 2022 18:20
How to setup and install AWS Tools for Powershell without headaches.
Install-Module -Name AWS.Tools.AccessAnalyzer -Confirm:$false
Install-Module -Name AWS.Tools.Account -Confirm:$false
Install-Module -Name AWS.Tools.ACMPCA -Confirm:$false
Install-Module -Name AWS.Tools.AlexaForBusiness -Confirm:$false
Install-Module -Name AWS.Tools.Amplify -Confirm:$false
Install-Module -Name AWS.Tools.AmplifyBackend -Confirm:$false
Install-Module -Name AWS.Tools.AmplifyUIBuilder -Confirm:$false
Install-Module -Name AWS.Tools.APIGateway -Confirm:$false
Install-Module -Name AWS.Tools.ApiGatewayManagementApi -Confirm:$false
Install-Module -Name AWS.Tools.ApiGatewayV2 -Confirm:$false