Skip to content

Instantly share code, notes, and snippets.

View thomaskanzig's full-sized avatar
😎
Knowledge is responsibility

Thomas Känzig thomaskanzig

😎
Knowledge is responsibility
View GitHub Profile
@thomaskanzig
thomaskanzig / how-to-use-git-rebase.md
Created April 29, 2025 16:46
How to use git rebase

How to use git rebase

To update your current branch (fix/STORY-1343-hero-section) from the main branch using rebase instead of merge, follow these steps:

# First, fetch the latest changes from remote
git fetch origin

# Then rebase your current branch on top of main
git rebase origin/main
@thomaskanzig
thomaskanzig / different-git-rebase-and-git-merge.md
Last active April 29, 2025 16:47
Git Rebase vs Git Merge

The main differences between git rebase and git merge:

Git Merge

  • Creates a new "merge commit" that combines changes from both branches
  • Preserves the full history and original branch structure
  • Non-destructive operation (doesn't change existing commits)

Git Rebase

  • Moves your branch's commits to start from the tip of the target branch
  • Creates a linear, cleaner history by reapplying your commits one by one
@thomaskanzig
thomaskanzig / atomic-design-introduction.md
Last active April 29, 2025 16:46
Atomic Design Introduction

Atomic Design Introduction

Atomic Design is a methodology for creating design systems. It was introduced by Brad Frost to help designers and developers build consistent, scalable, and reusable UI components. The core idea is to break down interfaces into five hierarchical stages, inspired by chemistry:

atomic-design

@thomaskanzig
thomaskanzig / insufficient-permission-to-add-an-object-to-the-repository-database-git-objects.md
Created April 5, 2023 15:56
Insufficient permission to add an object to the repository database .git/objects

Insufficient permission to add an object to the repository database .git/objects

If you did some git command with user root previously for some reason and now you don't have the permission with any other user, you can simplest do this.

From the root project:

cd .git/objects
@thomaskanzig
thomaskanzig / get-list-and-delete-objects-from-aws-s3-bucket.md
Last active March 31, 2023 09:13
Get, list and delete objects from AWS S3 Bucket

Get, list and delete objects from AWS S3 Bucket

As requirement, install the AWS SDK for PHP library to connect AWS S3.
First of all you need to connect to your AWS S3:

require 'vendor/autoload.php';
use Aws\S3\S3Client;
use Aws\Exception\AwsException;
@thomaskanzig
thomaskanzig / configure-gitlab-ci-runner-with-docker-executor-using-aws-ec2.md
Last active July 4, 2024 10:49
Configure GitLab CI Runner with Docker executor using AWS EC2

Configure GitLab CI Runner with Docker executor using AWS EC2

In this tutorial you will see how you can create you gitlab-ci.yml file in your repository and execute jobs on gitlab pipelines.

1. Create a VM on AWS EC2

  • In AWS, create an instance and choose the Amazon Linux 2 AMI machine.
  • Create a new key pair with the name similar like gitlab-runner. Isn't needed to be the same, just a name so you can identfy the purpose.
    • The key pair type can be ED25519
@thomaskanzig
thomaskanzig / how-to-add-a-new-key-pair-to-your-exisitng-AWS-ec2-instances.md
Created February 7, 2023 17:49
How to add a new key pair to your exisitng AWS ec2 Instances

How to add a new key pair to your exisitng AWS ec2 Instances

To connect Amazon Ec2 Instances we need a Private Key generated while creating a particular Instance. In case, anyhow you deleted that key pair from your account or for security reasons you want to attach a new key to your Instance, then here is the step-by-step tutorial to perform the same.

1. Open Key Pairs page

Once you log in to your AWS account you will see the AWS Management Console. On the left top side, click on the Service drop Menu to select EC2. As you are on the ec2 Dashboard, scroll down and from the left side select “Key Pairs” and then click on the “Create Key Pair“.

2. Create a new Private SSH ec2 key pair

@thomaskanzig
thomaskanzig / fixing-error-with-file-get-contents-permission-denied.md
Created January 18, 2023 14:31
PHP Fixing error with file_get_contents permission denied

PHP Fixing error with file_get_contents permission denied

If you don't receive any content with file_get_contents() and curl , like this error below:

file_get_contents('url'): failed to open stream: Permission denied
  1. Be sure you have allow_url_fopen=On in your php.ini file. (If someone doesn't know where your php.ini file is, quick check with phpinfo() could get you everything.
@thomaskanzig
thomaskanzig / install-php-composer-globally-on-rocky-linux.md
Last active January 17, 2023 17:48
Install PHP Composer on Rocky Linux 8 Globally

Install PHP Composer on Rocky Linux 8 Globally

Download PHP Composer Installer Script:

Run the command below to download PHP composer installer script:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
@thomaskanzig
thomaskanzig / how-to-remove-git-from-the-project.md
Created January 15, 2023 15:55
How to Remove Git from the Project

How to Remove Git from the Project?

To remove Git from project we can remove the .git folder using the Git command.

rm -rf .git*

The Git command rm -rf is used, rm removes a file from Git, and the -rf option of this command removes files recursively and forcefully. .git* removes the folder starting with .git.