Skip to content

Instantly share code, notes, and snippets.

View silvioramalho's full-sized avatar
😀
Always coding...

Silvio Ramalho silvioramalho

😀
Always coding...
View GitHub Profile
@silvioramalho
silvioramalho / remove-last-two-commits.md
Created April 17, 2025 19:20
Remove Last Two Commits in Git

Remove Last Two Commits in Git

This guide explains how to remove the last two commits from your branch and restore the state to the third commit from the end (keeping your working tree clean and history intact).

Scenario

  • You're on a feature branch (e.g., feature/add-auth) based on main
  • You've made 4 commits
  • You want to remove the last 2 commits, keeping the state from the third last commit
@silvioramalho
silvioramalho / git-reset-types.md
Created April 17, 2025 19:18
Understanding git reset: soft, mixed, and hard

Understanding git reset: soft, mixed, and hard

This document explains the three main types of git reset and when to use each.


1. git reset --soft HEAD~2

What it does:

  • Removes the last two commits.
@silvioramalho
silvioramalho / squash-commits.md
Created April 17, 2025 18:13
Squash multiple commits into a single signed commit

Squash and Sign Commits in Git

This guide shows how to squash multiple commits into a single signed commit. It's useful when you've made several WIP commits and want to clean up your branch history before pushing or creating a pull request.

Prerequisites

  • A feature branch created from main (e.g., feature/add-auth)
  • At least two commits to be squashed
  • Git commit signing (GPG/SSH/S/MIME) is already configured
@silvioramalho
silvioramalho / certificate-error.md
Created June 15, 2022 12:14
Fix localhost SSL Certificate error

Fix localhost SSL Certificate error

  1. Click on localhost certificate (Chrome browser bar)
  2. Export certificate a. Details tab b. Expor -> PKCS #7, single certificate
  3. Access "certlm.msc" on windows
  4. Choose PKCS #7, single certificate
  5. Import certificate a. Select target: As autoridades de certificação de raiz de confiança

Shell Script - Update coverage XML tag value

sed -e 's/<source>\/home\/app\/web<\/source>/<source>\/opt\/atlassian\/pipelines\/agent\/build\/app<\/source>/' coverage.xml > temp_coverage.xml
mv temp_coverage.xml coverage.xml
@silvioramalho
silvioramalho / install_minikube.md
Last active January 18, 2021 15:18
Install Minikube
@silvioramalho
silvioramalho / AWS_ECS_commands.md
Created January 17, 2021 16:26
AWS ECS common commands

AWS ECS Common Commands

List Clusters

aws ecs list-clusters

List Services

aws ecs list-services

@silvioramalho
silvioramalho / building-docker-image.md
Created January 14, 2021 12:07
Building a docker image

Building a docker image

Dockerfile sample

FROM node:latest
MAINTAINER Silvio Ramalho

ENV NODE_ENV=production
ENV PORT=3000
@silvioramalho
silvioramalho / docker_commands.md
Last active March 22, 2021 14:57
Docker Commands
@silvioramalho
silvioramalho / docker_ubuntu.md
Last active January 14, 2021 12:52
Install docker on Ubuntu

Install Docker on Ubuntu

sudo apt-get remove docker docker-engine docker.io

sudo apt-get update

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository \