Skip to content

Instantly share code, notes, and snippets.

@zawyelwin
zawyelwin / remove-last-commit.md
Last active September 20, 2021 05:53
Remove last commit from remote git repository

Be careful that this will create an "alternate reality" for people who have already fetch/pulled/cloned from the remote repository. But in fact, it's quite simple:

git reset HEAD^ # remove commit locally
git push origin +HEAD # force-push the new HEAD commit

If you want to still have it in your local repository and only remove it from the remote, then you can use:

@zawyelwin
zawyelwin / amazon-eks-vpc-private-subnets.yaml
Created February 13, 2023 16:53
CloudFormation Template for Amazon EKS VPC - Private and Public subnets
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Amazon EKS Sample VPC - Private and Public subnets'
Parameters:
VpcBlock:
Type: String
Default: 10.0.0.0/16
Description: The CIDR range for the VPC. This should be a valid private (RFC 1918) CIDR range.
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: test-eks
region: us-east-1
version: "1.25"
vpc:
subnets:
private:
{{- if . }}
{{- range . }}
<h3>Target <code>{{ escapeXML .Target }}</code></h3>
{{- if (eq (len .Vulnerabilities) 0) }}
<h4>No Vulnerabilities found</h4>
{{- else }}
<h4>Vulnerabilities ({{ len .Vulnerabilities }})</h4>
<table>
<tr>
<th>Package</th>