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
# Reset Git history to a single commit | |
# 1. Create an orphan branch (no history) | |
git checkout --orphan temp-branch | |
# 2. Add all files to the new branch | |
git add . | |
# 3. Commit the current state | |
git commit -m "Initial commit" |
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
#!/bin/bash | |
if [ "$#" -ne 4 ]; then | |
echo "Usage: $0 <start_time> <end_time> <log_group_name> <trace_id>" | |
echo 'Example: $0 "2025-07-09 00:00:00" "2025-07-09 23:59:59" /aws/lambda/log_group_name 1-686dd42e-de1fff5def777620facd7b76' | |
exit 1 | |
fi | |
START_TIME="$1" | |
END_TIME="$2" |
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
CLUSTER_NAME="ecs-bazinga-sitizapp" | |
BASTION_CONTAINER="ecss-bazinga-sitizapp-jumphost" | |
export AWS_REGION=ap-southeast-1 | |
TASK_ARN=$(aws ecs list-tasks --cluster $CLUSTER_NAME --service-name $BASTION_CONTAINER | jq '.taskArns[0]') | |
TASK_ARN_ARRAY=(`echo $TASK_ARN | tr '/' ' '`) | |
TASK_ID_ARRAY=(`echo ${TASK_ARN_ARRAY[2]} | tr '"' ' '`) | |
TASK_ID="${TASK_ID_ARRAY[0]}" |
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
-Xmx12g | |
-Xms8g | |
-XX:MaxMetaspaceSize=4g | |
-XX:+UseG1GC |
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
windows: | |
- name: start | |
root: ~/Developer | |
layout: main-vertical | |
panes: | |
- name: main | |
commands: | |
- reset && clear | |
- cd hello | |
- name: session-2 |
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
#!/bin/bash | |
set -euo pipefail | |
script_name=$(basename "$0") | |
usage() { | |
echo "Usage: ./$script_name [clone_location] [base_repo_url]\n" | |
echo "Example: ./$script_name /path/to/clone git@github.com:bdhmiloo/" | |
exit 1 |
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 nexus-docker.ship.gov.sg/flyway/flyway:10.8.1-alpine | |
RUN mkdir -p /flyway/sql | |
COPY /sql-scripts/ /flyway/sql/ | |
RUN mkdir -p /flyway/conf | |
COPY /flyway/flyway.conf /flyway/conf/ | |
ENTRYPOINT ["flyway"] |
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
#!/bin/bash | |
find . -type d -name ".terragrunt-cache" -prune -exec rm -rf {} \; | |
find . -type d -name ".terraform" -prune -exec rm -rf {} \; | |
find . -type f -name ".terraform.lock.hcl" -prune -exec rm -rf {} \; |
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
#!/bin/bash | |
set -euo pipefail | |
script_name=$(basename "$0") | |
usage() { | |
echo "Usage: ./$script_name <repo> <tag> [account]\n" | |
echo "Example: ./$script_name some-ecr-repo 123456:654321" | |
echo " repo - The ecr repository name" |
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
#!/bin/bash | |
STACK_NAME=$1 | |
STACK_DRIFT_DETECTION_ID=$(aws cloudformation detect-stack-drift --stack-name "$STACK_NAME" --query 'StackDriftDetectionId' --output text) | |
echo "Drift detection initiated with ID: $STACK_DRIFT_DETECTION_ID" | |
STATUS="DETECTION_IN_PROGRESS" | |
while [ "$STATUS" == "DETECTION_IN_PROGRESS" ]; do | |
echo "Waiting for drift detection to complete..." |
NewerOlder