Skip to content

Instantly share code, notes, and snippets.

View raihankhan's full-sized avatar
☸️
Exploring kubernetes

Raihan Khan raihankhan

☸️
Exploring kubernetes
View GitHub Profile
@raihankhan
raihankhan / AWS S3 Cloudfront.md
Last active December 11, 2025 17:15
deploy a static web app with a fully private S3 bucket by putting CloudFront in front of it

You can deploy a static web app with a fully private S3 bucket by putting CloudFront in front of it and granting CloudFront exclusive access. The “legacy” style CloudFront distribution uses an Origin Access Identity (OAI) instead of the newer Origin Access Control (OAC).

Prerequisites

  • An AWS account with permissions for S3, CloudFront, and IAM.
  • A built static website folder on your machine (for example containing index.html, CSS, JS, and assets).
  • Optional but recommended: a registered domain (for example via Route 53) and an ACM certificate in us-east-1 if you want HTTPS on a custom domain.

Step 1 – Create a private S3 bucket

@raihankhan
raihankhan / main.go
Created October 20, 2025 09:24
Netbird_resource_ingestor
package main
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"log"
"net"
@raihankhan
raihankhan / Fork a Github Repo to Gitlab.txt
Last active September 29, 2025 10:25
Fork a Github Repo to Gitlab
> https://stackoverflow.com/questions/50973048/forking-git-repository-from-github-to-gitlab
1. Create an empty repository in Gitlab
2. Set the original Github repository as upstream:
```bash
git remote add upstream https://github.com/user/repo
```
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"log"
"os"
mr_demo: = gitlab.MergeRequest {
BasicMergeRequest: gitlab.BasicMergeRequest {
ID: 370891163,
IID: 14,
TargetBranch: "main",
SourceBranch: "service-marketplace-product-2025-03-21T04-52-53Z",
ProjectID: 67898401,
Title: "Update values for marketplace/product - TkAo",
State: "opened",
Imported: false,
@raihankhan
raihankhan / publisher_consumer_pattern.go
Last active August 3, 2024 20:16
A simple pattern for asynchronous publisher-consumer model in Golang.
package main
import (
"fmt"
"math/rand"
"os"
"os/signal"
"sync"
"syscall"
"time"
@raihankhan
raihankhan / Delete Operation for Two Strings.cpp
Last active June 14, 2022 15:42
Leetcode daily solutions
// Leetcode daily challenge - 14.06.22
// https://leetcode.com/problems/delete-operation-for-two-strings
// Top Down DP approach - O(n*m) space and O(n^2) time complexity
class Solution {
public:
int minDistance(string word1, string word2) {
int n = word1.size(),m = word2.size();
int dp[n+1][m+1];